MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / extension_factor

Method extension_factor

hail-fuzz/src/extension.rs:358–370  ·  view source on GitHub ↗

Returns a factor to use for length extension that attempts to increase the size of inputs that regularly cause execution to stop.

(&self, key: StreamKey)

Source from the content-addressed store, hash-verified

356 /// Returns a factor to use for length extension that attempts to increase the size of inputs
357 /// that regularly cause execution to stop.
358 pub(crate) fn extension_factor(&self, key: StreamKey) -> f64 {
359 let average = self.average_stream_end_execs();
360 let stream_exits = self.stream_exits.get(&key).copied().unwrap_or(0) as f64;
361 if stream_exits <= average {
362 return 1.0;
363 }
364 let factor = 1.0 + (stream_exits - average).log2().max(0.0);
365 debug_assert!(
366 !factor.is_nan(),
367 "factor={factor} (exits={stream_exits}, average={average})"
368 );
369 factor
370 }
371}
372
373fn save_metadata(fuzzer: &mut Fuzzer, state: &MultiStreamExtendStage) {

Callers 1

get_extension_factorMethod · 0.80

Calls 2

getMethod · 0.45

Tested by

no test coverage detected