[CN-Testing] Allow fixing of base allocation address#536
Open
ZippeyKeys12 wants to merge 2 commits intorems-project:mainfrom
Open
[CN-Testing] Allow fixing of base allocation address#536ZippeyKeys12 wants to merge 2 commits intorems-project:mainfrom
ZippeyKeys12 wants to merge 2 commits intorems-project:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new test-generation/runtime flag to pin the random input allocator’s backing buffer to a fixed virtual address, enabling reproducible pointer values across runs (especially when combined with a fixed --seed).
Changes:
- Add
--fixed-alloc-base=<ADDR>CLI flag to cn-testing runner and OCamltestcommand. - Implement fixed-address allocation via
mmap(withMAP_FIXED_NOREPLACEwhere available) inbennetrandom allocator. - Plumb the new option through test-generation config and build script generators (bash/make).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| runtime/libcn/src/cn-testing/test.c | Parses and forwards --fixed-alloc-base to the random allocator. |
| runtime/libcn/src/bennet/state/rand_alloc.c | Implements fixed-base buffer mapping (mmap) and exposes a setter API. |
| runtime/libcn/include/bennet/state/rand_alloc.h | Documents and declares bennet_rand_alloc_set_fixed_base. |
| lib/testGeneration/testGenConfig.mli | Adds fixed_alloc_base to config interface. |
| lib/testGeneration/testGenConfig.ml | Stores fixed_alloc_base in config + accessor. |
| lib/testGeneration/buildScripts/make.ml | Emits --fixed-alloc-base into generated Make-based runners. |
| lib/testGeneration/buildScripts/bash.ml | Emits --fixed-alloc-base into generated Bash runners. |
| bin/test.ml | Adds --fixed-alloc-base CLI flag and threads it into TestGeneration config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b38d6ad to
1975406
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For pointer generation, we allocate a large buffer and generate addresses inside it (depending on ownership and size required).
This PR adds
--fixed-alloc-base=<ADDR>which allows setting the address of this buffer.