From c2b27b10eeb6a0aebb84311a9d6d55c23decfab8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 25 Sep 2026 03:11:27 +0200 Subject: [PATCH] Cut 12.2 Soul fix batch 2, S2: pin the within-prong ratio, not just direction TwoProngHullSplitsTheScatterAcrossBothIntervals's own within-prong check (atNearColumn > atFarColumn) held under M12/M12b (an entire second silhouette built at the wrong sigma) and the sigma/sqrt(2) Stryker mutants, because every wrong sigma tried still puts more mass on the nearer column -- direction alone cannot separate a sigma of 1.5 from 1.5*sqrt(2). Their analytic near/far mass ratios are well apart (~2.9 true vs ~1.73 at sigma*sqrt(2)), so the test now computes the true ratio from the same per-cell Gaussian integral it already uses and asserts the empirical ratio (8000 shots) tracks it within a tolerance that rejects the wrong-sigma ratio. Manually verified against the exact M12 and M12b patches from Soul's mutation script: both now fail this test (empirical ratios 581 and 1.68, matching a collapsed and a sqrt(2)-shifted sigma respectively, against the analytic ~2.9). Co-Authored-By: Claude Opus 5.5 --- .../FireControlCut12Tests.cs | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/FireControlCut12Tests.cs b/tests/Aetheria.Shared.Tests/FireControlCut12Tests.cs index 2d0d504e0..a634bec05 100644 --- a/tests/Aetheria.Shared.Tests/FireControlCut12Tests.cs +++ b/tests/Aetheria.Shared.Tests/FireControlCut12Tests.cs @@ -921,14 +921,28 @@ public sealed class FireControlCut12Tests : IDisposable Assert.True(Math.Abs(empiricalShareA - expectedShareA) < .05, $"prong A's empirical share {empiricalShareA:F3} does not match its analytic share {expectedShareA:F3}"); - // Within-prong shape, not just the aggregate share: prong A is x in {0,1}, projected lateral centres - // 0 and -1 respectively (ell=(-1,0)); a=-3 sits closer to x=1's centre (-1) than x=0's (0), so a real - // Gaussian shape (not a coin flip within the prong, and not "first cell only") puts strictly more mass - // on x=1 than x=0. + // S2 fix batch (Hands, 2026-09-25): within-prong SHAPE, pinned by ratio, not just direction. Prong A is + // x in {0,1}, projected lateral centres 0 and -1 respectively (ell=(-1,0)), a=-3. The old + // "atNearColumn > atFarColumn" check survived M12/M12b (an entire second silhouette built at sigma + // floor .5 or at sigma*sqrt(2)) and the sigma/sqrt(2) Stryker mutants at :~753/:~750, because every one + // of those wrong sigmas still puts more mass on the nearer column -- direction alone can't tell a + // sigma of 1.5 from a sigma of 1.5*sqrt(2). The RATIO can: Soul's own figures are ~2.9 at the true + // sigma against ~1.73 at sigma*sqrt(2), well separated at 8000 shots. The near and far columns' own raw + // (unmerged) intervals are exactly the two ends of `raw` for prong A, reused here rather than + // recomputed. + var nearInterval = raw.First(iv => Math.Abs(iv.Lo - (-1.5f)) < 1e-3f); // x=1: [-1.5,-0.5) + var farInterval = raw.First(iv => Math.Abs(iv.Lo - (-0.5f)) < 1e-3f); // x=0: [-0.5,0.5) + var nearMass = Mass(nearInterval); + var farMass = Mass(farInterval); + var analyticRatio = nearMass / farMass; + Assert.True(analyticRatio > 2.3, $"fixture: analytic near/far ratio ({analyticRatio:F3}) must be well clear of the wrong-sigma ratio (~1.73) to actually distinguish the two"); + var atNearColumn = hits.Count(o => o.Cell.x == 1); var atFarColumn = hits.Count(o => o.Cell.x == 0); - Assert.True(atNearColumn > atFarColumn, - $"expected the column nearer the aim point (x=1, {atNearColumn} hits) to outweigh the far one (x=0, {atFarColumn} hits)"); + Assert.True(atNearColumn > 0 && atFarColumn > 0, $"expected hits on both columns, got near={atNearColumn} far={atFarColumn}"); + var empiricalRatio = atNearColumn / (double) atFarColumn; + Assert.True(Math.Abs(empiricalRatio - analyticRatio) < .6, + $"empirical near/far ratio {empiricalRatio:F3} ({atNearColumn}/{atFarColumn}) does not track the analytic ratio {analyticRatio:F3} -- a sigma perturbed by sqrt(2) would give ~1.73 instead"); } // HitsLandOnTheFacingEdge supersedes EveryHitLandsOnMetal: on a concave (holed) hull, every hit's Cell is