-
Notifications
You must be signed in to change notification settings - Fork 381
feat(fuzz): Add experimental comptime code generator #8207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6f630b0
Add comptime program generation sample
rkarabut 7d5cb29
Clean up
rkarabut 0388160
Merge branch 'master' into rk/ast-fuzzer-comptime
rkarabut bbb4a0c
Fixes
rkarabut 44a52d3
Switch to using FunctionPrintOptions
rkarabut 2bc3e33
Move include_brillig
rkarabut b1191ea
Add min_functions to config
rkarabut 5fc95dd
Remove extra clone
rkarabut b362d56
Fix clippy
rkarabut 87bf76e
fmt
rkarabut 4a301a9
Rework generator
rkarabut e5f91bf
Update tooling/ast_fuzzer/src/program/mod.rs
rkarabut 99b0cc0
Fix fctx passing
rkarabut 1da9758
fmt
rkarabut 1897c41
Update tooling/ast_fuzzer/src/program/mod.rs
rkarabut 0560155
Clean up
rkarabut 903727f
fmt
rkarabut 5699e7a
Merge remote-tracking branch 'origin/master' into rk/ast-fuzzer-comptime
rkarabut ee2452e
Make clippy happy
rkarabut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //! Print a random comptime AST | ||
| //! | ||
| //! ```shell | ||
| //! cargo run -p noir_ast_fuzzer --example sample_comptime | ||
| //! ``` | ||
| use arbitrary::Unstructured; | ||
| use noir_ast_fuzzer::{Config, DisplayAstAsNoirComptime, arb_program_comptime}; | ||
| use rand::RngCore; | ||
|
|
||
| fn main() { | ||
| let data = { | ||
| let mut rng = rand::thread_rng(); | ||
| let mut data = [0u8; 1024 * 1024]; | ||
| rng.fill_bytes(&mut data); | ||
| data | ||
| }; | ||
| let mut u = Unstructured::new(&data); | ||
|
|
||
| let mut config = Config::default(); | ||
| config.max_globals = 0; | ||
|
|
||
| let program = arb_program_comptime(&mut u, config).expect("arb_program"); | ||
| println!("{}", DisplayAstAsNoirComptime(&program)); | ||
| } |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.