Tests: pin For's double mix against the single-xor collapse and Commit's | 1u seed bit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d62d44cb99
commit
6c15a33315
2 changed files with 25 additions and 0 deletions
|
|
@ -247,6 +247,20 @@ public sealed class FireControlCut9Tests : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
// Commit's seed is ((CombatSeed * K) ^ ShotId) | 1 before the fmix32: the `| 1` is part of the shot dice that
|
||||
// 9.1 shipped, so two shot ids that differ only in bit 0 share a seed and so a draw. Mutation: drop the
|
||||
// `| 1` -- the pairs below then draw different rolls.
|
||||
[Fact]
|
||||
public void ShotIdsDifferingOnlyInTheLowBitShareTheirDraw()
|
||||
{
|
||||
var e = BuildDieEngagement(TestSettings(), "Cut9-LowBit");
|
||||
var four = BisectRoll(e, 4);
|
||||
Assert.Equal(four, BisectRoll(e, 5), 5);
|
||||
var six = BisectRoll(e, 6);
|
||||
Assert.Equal(six, BisectRoll(e, 7), 5);
|
||||
Assert.NotEqual(four, six, 3);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------
|
||||
// 9.2: pOnHull must stay monotonic in Precision over the whole domain. A neutral shooter/target pair
|
||||
// (Accuracy 1, huge Resolution/Tracking, zero weapon Spread), the same isolation convention
|
||||
|
|
|
|||
|
|
@ -138,6 +138,17 @@ public sealed class FloatingBodyTests : IDisposable
|
|||
Assert.Equal(1u, zero.state);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NeighbouringZonesAndOrdinalsNeverShareADraw()
|
||||
{
|
||||
// Folding stream and ordinal into the zone seed with one xor would make (zone, n) and (zone ^ 1, n ^ 1)
|
||||
// the same seed; the double mix keeps them apart.
|
||||
for (uint zone = 0; zone < 64; zone++)
|
||||
for (uint n = 0; n < 16; n++)
|
||||
Assert.NotEqual(SimulationDice.For(zone, SimulationDice.LootStream, n).NextUInt(),
|
||||
SimulationDice.For(zone ^ 1u, SimulationDice.LootStream, n ^ 1u).NextUInt());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BodyIdsAreUniqueInAZone()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue