-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Various improvements to differential fuzzing #4845
Changes from 2 commits
d7a2bf9
faa0628
d8faf0f
c2bb4e1
6898c18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ pub fn choose( | |
u: &mut Unstructured<'_>, | ||
existing_config: &Config, | ||
allowed: &[&str], | ||
) -> arbitrary::Result<Box<dyn DiffEngine>> { | ||
) -> arbitrary::Result<Option<Box<dyn DiffEngine>>> { | ||
// Filter out any engines that cannot match the `existing_config` or are not | ||
// `allowed`. | ||
let mut engines: Vec<Box<dyn DiffEngine>> = vec![]; | ||
|
@@ -54,13 +54,16 @@ pub fn choose( | |
} | ||
} | ||
|
||
if engines.is_empty() { | ||
return Ok(None); | ||
} | ||
Comment on lines
+57
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slightly surprised we would ever have a case where we can't run the test case in Wasmtime. What is even the point at that time? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the issue this is addressing is if testing Wasmtime against Wasmtime has been disabled using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yeah this is only applicable when you're doing something like |
||
|
||
// Use the input of the fuzzer to pick an engine that we'll be fuzzing | ||
// Wasmtime against. | ||
assert!(!engines.is_empty()); | ||
let index: usize = u.int_in_range(0..=engines.len() - 1)?; | ||
let engine = engines.swap_remove(index); | ||
log::debug!("selected engine: {}", engine.name()); | ||
Ok(engine) | ||
Ok(Some(engine)) | ||
} | ||
|
||
/// Provide a way to instantiate Wasm modules. | ||
|
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.
Instead of bailing out when an engine doesn't support a config, can we have a pre-pass where the engine is given mutable access to the config to turn off anything that it doesn't support? This just seems like better use of fuzzing time than rejecting iterations and bailing out.
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.
Yeah I've come around to feeling this way as well, I'll work on refactoring to enable this