test(engine): seed spacing brute-force sampling deterministically

The seed came from string.GetHashCode, which .NET randomizes per process,
so each run drew different samples and the "ring" case occasionally drew
fewer than six rejections and failed its coverage assertion (1 in 6 runs),
even though every validator decision matched the brute-force reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aj
2026-09-25 08:12:07 -04:00
co-authored by Claude Opus 5.5
parent 029299ccf8
commit 6ab45e6de7
@@ -37,7 +37,8 @@ public class NestJobSpacingValidationTests
);
var bounds = program.BoundingBox();
var random = new Random(name.GetHashCode(StringComparison.Ordinal) & 0x7fff);
// string.GetHashCode is randomized per process; a stable seed keeps the sampling reproducible.
var random = new Random(name.Aggregate(17, (hash, c) => unchecked(hash * 31 + c)) & 0x7fff);
var accepted = 0;
var rejected = 0;