script: hash the seed in the brotli fuzzer

Seeding SplitMix64 with seed * 0x9E3779B97F4A7C15 made consecutive seeds
generate the same sequence shifted by one number, so shards with
consecutive seeds repeated each other's cases.
This commit is contained in:
Claude committed 2026-10-27 14:01:14 +00:00
1 parent 8a8df6667a
commit a856d133d9
1 file changed
+6 -1
+6 -1
View File
@@ -2062,7 +2062,12 @@ main(int argc, char** argv) {
}
}
g_seed = seed;
g_rng_state = seed * 0x9E3779B97F4A7C15ull;
// Hash the seed: SplitMix64 adds 0x9E3779B97F4A7C15 to its state per
// number, so a starting state of (seed * 0x9E3779B97F4A7C15) would make
// seed N+1's sequence that of seed N shifted by one number, and shards with
// consecutive seeds would soon generate the same cases.
g_rng_state = seed;
g_rng_state = r64();
if (!strncmp(argv[1], "-replay=", 8)) {
return replay_dec(argv[1] + 8);
} else if (!strcmp(argv[1], "-dec")) {