Skip to main content

corpus_prng

Function corpus_prng 

Source
pub fn corpus_prng(seed: u64, i: usize, lo: i64, hi: i64) -> i64
Expand description

The repo’s deterministic hash PRNG — the same mixing crates/logicaffeine_tests/tests/common/spatial.rs uses, restated here because a corpus builder that lives in the compiler cannot reach into the test tree. Same seed, same index, same window ⇒ same value, on every machine and every run.

★ TOTAL, AND THE WINDOW IS ORDERED BEFORE IT IS USED. A caller who hands the ends crossed gets a value from the window those ends span, never one outside it: the whole force of a corpus is the promise that every element it produces is inside the range the program declared and inside CORPUS_MAGNITUDE_CAP, and a builder that can quietly break that promise turns “the rewrite diverged” into “the datapath rounded” with nothing in the report to tell them apart.