-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(fuzz): ast-seeded dictionary #12015
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
Conversation
Not blocking but I would recommend implementing constant folding to some degree i.e. evaluate |
thanks! One thing here - this means we should collect from tests too which we don't do in PR, is this correct? |
AFAIK neither Echidna or slither's printer filters tests out. I think not including forge-std makes sense. Also, I am not sure how the push/pop/log dictionary is managed currently in Foundry, but I think Echidna will always keep the constant pool around and eject the dynamically collected values after running a full sequence. For example, a user's balance that is emitted in one run may help within the same sequence but probably unlikely to help in a totally unrelated sequence. |
👍 @0xrusowsky let's include too
Please let us know if you see any redundant data / ways to improve the dict. Thank you! |
^ note that AST literals are injected into |
6f35d1b
to
fc4f3d4
Compare
a9373d6
to
3440429
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! left a comment re tests, please check if worth adding them. thanks!
"#]]); | ||
}); | ||
|
||
// TODO(rusowsky): figure out why it is flaky |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still a TODO or good to be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to be removed, always passes locally
"#]]); | ||
}); | ||
|
||
forgetest_init!(should_fuzz_literals, |prj, cmd| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's awesome! I assume this one should pass now quite quickly and we can include too?
foundry/crates/forge/tests/cli/test_cmd/invariant/storage.rs
Lines 3 to 6 in e98bff5
forgetest_init!( | |
#[ignore = "slow"] | |
storage, | |
|prj, cmd| { |
Since should_fuzz_literals
test is only for stateless fuzz, would it make sense to add an invariant one as well? I am thinking in particular to replicate this one
forgetest_init!(invariant_fixtures, |prj, cmd| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grandizzy all passes as expected, see 4d9ee25
(#12015)
…y into rusowsky/ast-fuzz-dict
Motivation
closes #10233
Solution
solar::sema::Compiler
to collect all relevant AST literals found in the sources (excluding libs and scripts) and seed theFuzzerDictionary
with them at initialization.Future improvements
PR Checklist