From ab396c786a3370f105d489f929f01127f26393d5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 9 Oct 2026 14:57:48 +0200 Subject: [PATCH] Tests: the evasion volleys fire enough shots to resolve the price gap With the target's fit written out the jinking price is .383 against .440 coasting, but 200 rolled shots gave 93 hits jinking against 78 coasting: the gap between the prices is smaller than the noise of two 200-shot volleys. 2000 shots put the expected gap near four standard deviations; the assertion is unchanged. Co-Authored-By: Claude Opus 5.5 --- tests/Aetheria.Shared.Tests/EvasionTermTests.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/EvasionTermTests.cs b/tests/Aetheria.Shared.Tests/EvasionTermTests.cs index 1d4337380..9723cad90 100644 --- a/tests/Aetheria.Shared.Tests/EvasionTermTests.cs +++ b/tests/Aetheria.Shared.Tests/EvasionTermTests.cs @@ -584,6 +584,10 @@ public sealed partial class RunStartTests return (hits, price); } + // The two volleys' hit counts are rolls, so their gap is the price gap plus noise. At the price gap this fixture + // has (about .06 on .44) 200 shots flip the comparison one seed in eight; this many keeps it near four standard deviations. + private const int EvVolleySize = 2000; + // The evasion term is in the live price, the HUD's forecast and the roll: a ship crossing at 150 m/s that has been // jinking is harder to hit than the same ship coasting, for a projectile gun. [Fact] @@ -597,7 +601,7 @@ public sealed partial class RunStartTests EvCross(range, jinking: false); var coastingDiagnostic = FireControl.Inspect(gun, shooter, target); var coastingPrice = FireControl.HitProbability(gun, shooter, target); - var coasting = EvVolley(range, gun, shooter, 200); + var coasting = EvVolley(range, gun, shooter, EvVolleySize); Assert.Equal(0f, coastingDiagnostic.Evasion); Assert.Equal(1f, coastingDiagnostic.PEvasion); Assert.True(coastingPrice > .2f, $"fixture: a coasting target is hittable ({coastingPrice})"); @@ -605,10 +609,10 @@ public sealed partial class RunStartTests EvCross(range, jinking: true); var jinkingDiagnostic = FireControl.Inspect(gun, shooter, target); var jinkingPrice = FireControl.HitProbability(gun, shooter, target); - var jinking = EvVolley(range, gun, shooter, 200); - Console.WriteLine($"EVASION price: coasting {coastingPrice:F3} hits {coasting.hits}/200 committed {coasting.price:F3}; " + + var jinking = EvVolley(range, gun, shooter, EvVolleySize); + Console.WriteLine($"EVASION price: coasting {coastingPrice:F3} hits {coasting.hits}/{EvVolleySize} committed {coasting.price:F3}; " + $"jinking {jinkingPrice:F3} (evasion {jinkingDiagnostic.Evasion:F2} m, tracking {jinkingDiagnostic.Tracking:F1}, PEvasion {jinkingDiagnostic.PEvasion:F3}) " + - $"hits {jinking.hits}/200 committed {jinking.price:F3}"); + $"hits {jinking.hits}/{EvVolleySize} committed {jinking.price:F3}"); Assert.True(jinkingDiagnostic.Evasion > 0f); Assert.True(jinkingDiagnostic.PEvasion < 1f);