-
Notifications
You must be signed in to change notification settings - Fork 757
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
Fuzzer: Adjust parameters by input size, sometimes #7276
base: main
Are you sure you want to change the base?
Conversation
// A typical random wasm input from fuzz_opt.py is fairly large (to minimize | ||
// the process creation overhead of all the things we run from python), and | ||
// the defaults are tuned to that. | ||
double size = random.remaining(); |
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.
Why does random.remaining()
correspond to the input size? This seems non-obvious, so perhaps is worth a comment.
// the process creation overhead of all the things we run from python), and | ||
// the defaults are tuned to that. | ||
double size = random.remaining(); | ||
const double MEAN_SIZE = 40 * 1024; |
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 number taken from measurements? Do we expect it to change much over time? (Not that it would matter much if it did.)
|
||
auto bits = random.get(); | ||
if (bits & 1) { | ||
fuzzParams->MAX_NEW_GC_TYPES = fuzzParams->MAX_NEW_GC_TYPES * ratio; |
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.
Can we use *= ratio
here and below?
// Only increase the number of tries. Trying fewer times does not help | ||
// find more interesting patterns. | ||
if (ratio > 1) { | ||
fuzzParams->TRIES = fuzzParams->TRIES * ratio; |
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.
Can we give TRIES
a more descriptive name?
Rather than always have a fixed max of heap types, globals, etc. allow more if the
input size is large. This adds variety.
There is a cost to this variety, we go from 0.89% ignored runs to 1.1% (that is,
slightly more runs contain something that prevents us from doing the work
we want, like hitting a host limitation or seeing the testcase just traps). This
increase seems small enough to be reasonable, and we only do this half the
time, so the old behavior is still being tested at half throughput.