diff --git a/tests/Aetheria.Shared.Tests/FireControlCut9Tests.cs b/tests/Aetheria.Shared.Tests/FireControlCut9Tests.cs index 2ebeb72f1..811fc3a47 100644 --- a/tests/Aetheria.Shared.Tests/FireControlCut9Tests.cs +++ b/tests/Aetheria.Shared.Tests/FireControlCut9Tests.cs @@ -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 diff --git a/tests/Aetheria.Shared.Tests/FloatingBodyTests.cs b/tests/Aetheria.Shared.Tests/FloatingBodyTests.cs index 275f5e43c..3e0780dd3 100644 --- a/tests/Aetheria.Shared.Tests/FloatingBodyTests.cs +++ b/tests/Aetheria.Shared.Tests/FloatingBodyTests.cs @@ -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() {