From d9c887c129664a578a94f34c3dab19cc0c0a0f39 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 25 Sep 2026 01:49:51 +0200 Subject: [PATCH] Cut 1 Stryker fix batch: cover EvaluateBelt and belt Radius Stryker over Zone.cs (231 mutants, scoped by --mutate to this cut's file) found two real gaps, both NoCoverage/Survived, not equivalents: - Zone.EvaluateBelt and AsteroidBelt.Evaluate -- the renderer's own path (ZoneRenderer.cs Update, AsteroidBeltUI.Update) -- were never called by any test, so the whole batch body and its loop bound were unreached. EvaluateBeltFillsEveryAsteroidExactlyAsChunkPoseWould pins that the batch path fills every index exactly as the per-index ChunkPose would, closing the gap without duplicating the orbit formula a second time. - AsteroidBelt.Radius (data.Asteroids.Max(a => a.Distance)) had no assertion; a Max-to-Min mutant survived. BeltRadiusIsTheFarthestAsteroidsDistance pins it, since the renderer's visibility bounds and minimap mesh both size off this field. Full suite: 262/262 green (260 + these 2). Co-Authored-By: Claude Opus 5.5 --- .../Aetheria.Shared.Tests/MiningCut1Tests.cs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/MiningCut1Tests.cs b/tests/Aetheria.Shared.Tests/MiningCut1Tests.cs index b47a0bcc1..d35dcfca4 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut1Tests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut1Tests.cs @@ -198,4 +198,44 @@ public sealed class MiningCut1Tests : IDisposable belt.RespawnTimers[brokenIndex] = settings.AsteroidRespawnTime.Evaluate(asteroids[brokenIndex].Size); Assert.Equal(0f, belt.Size(brokenIndex, settings)); } + + // Stryker gap (2026-09-25 Stryker pass on this cut): nothing called Zone.EvaluateBelt or + // AsteroidBelt.Evaluate, the renderer's own path (ZoneRenderer.cs:452-478), leaving both at NoCoverage. + // This does not re-derive the orbit formula (that is ChunkPoseIsTheOrbitAtZoneTime's job); it pins that the + // batch path is the same function as the per-index one, per index, over every asteroid -- so the renderer's + // buffer can never quietly diverge into a second copy of the pose formula. + [Fact] + public void EvaluateBeltFillsEveryAsteroidExactlyAsChunkPoseWould() + { + var (zone, beltKey, asteroids, _) = BuildFixture(); + zone.Update(0.37f); + + var buffer = new float4[asteroids.Length]; + zone.EvaluateBelt(beltKey, buffer); + + Assert.Equal(asteroids.Length, buffer.Length); + for (var i = 0; i < asteroids.Length; i++) + { + var expected = zone.ChunkPose(beltKey, i); + Assert.Equal(expected.x, buffer[i].x, 4); + Assert.Equal(expected.y, buffer[i].y, 4); + Assert.Equal(expected.z, buffer[i].z, 4); + Assert.Equal(expected.w, buffer[i].w, 4); + } + } + + // Stryker gap: AsteroidBelt.Radius (Zone.cs, AsteroidBelt constructor) had no assertion, so Max survived a + // Min mutation. The renderer's visibility bounds (ZoneRenderer.cs:452) and minimap mesh (:663) both use it + // as the belt's farthest asteroid; a Min there would cull or mis-bound the belt. + [Fact] + public void BeltRadiusIsTheFarthestAsteroidsDistance() + { + var (zone, beltKey, asteroids, _) = BuildFixture(); + + var expectedRadius = float.MinValue; + foreach (var a in asteroids) + if (a.Distance > expectedRadius) expectedRadius = a.Distance; + + Assert.Equal(expectedRadius, zone.AsteroidBelts[beltKey].Radius, 4); + } }