fuzzgen: Mostly Forward Branching (#4894)

* cranelift: Test Forward branching

* fuzzgen: Separate terminators

* fuzzgen: Avoid generating jumptables if we have no valid targets

* fuzzgen: Forward Jump Tables

* fuzzgen: Cleanup some feedback

Thanks @jameysharp!

* fuzzgen: Cleanup block generation

Thanks @jameysharp!

* fuzzgen: Style Cleanups

These were accidentally reverted in a rebase

* fuzzgen: Prevent block0 from being targeted for branches

* fuzzgen: Add jump tables sorting TODO
This commit is contained in:
Afonso Bordado
2022-09-15 19:29:50 +01:00
committed by GitHub
parent 9d99eff6f9
commit 09f46e351e
2 changed files with 275 additions and 144 deletions

View File

@@ -35,6 +35,10 @@ pub struct Config {
pub static_stack_slots_per_function: RangeInclusive<usize>,
/// Size in bytes
pub static_stack_slot_size: RangeInclusive<usize>,
/// Determines how often we generate a backwards branch
/// Backwards branches are prone to infinite loops, and thus cause timeouts.
pub backwards_branch_ratio: (usize, usize),
}
impl Default for Config {
@@ -55,6 +59,9 @@ impl Default for Config {
funcrefs_per_function: 0..=8,
static_stack_slots_per_function: 0..=8,
static_stack_slot_size: 0..=128,
// 0.1% allows us to explore this, while not causing enough timeouts to significantly
// impact execs/s
backwards_branch_ratio: (1, 1000),
}
}
}