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:
@@ -37,7 +37,8 @@ public class NestJobSpacingValidationTests
|
|||||||
);
|
);
|
||||||
|
|
||||||
var bounds = program.BoundingBox();
|
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 accepted = 0;
|
||||||
var rejected = 0;
|
var rejected = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user