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)
| 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 | |
| 373 | fn save_metadata(fuzzer: &mut Fuzzer, state: &MultiStreamExtendStage) { |
no test coverage detected