From 8f3d23d3862d8c91fe0dac14fbd53b59603c4e6b Mon Sep 17 00:00:00 2001 From: soul Date: Sun, 22 Nov 2026 22:26:00 +0100 Subject: [PATCH] Demo pressure tests: pin InGrace's depth term directly Where depth <= 0.25 the curve's own ramp already draws no raider, so only the antagonist's stations and turrets (moved away by grace) carried the depth term, and no generated zone near the antagonist's home reaches it. Assert InGrace for those zones so dropping the term fails. Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/DemoPressureTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/DemoPressureTests.cs b/tests/Aetheria.Shared.Tests/DemoPressureTests.cs index 289eb5d20..00a7def34 100644 --- a/tests/Aetheria.Shared.Tests/DemoPressureTests.cs +++ b/tests/Aetheria.Shared.Tests/DemoPressureTests.cs @@ -177,6 +177,9 @@ public sealed partial class RunStartTests float e = galaxy.Entrance.Distance[zone], x = galaxy.Exit.Distance[zone]; if (e < 2 || e / (e + x) > 0.25f) continue; graced++; + // The depth term itself: where no hostile would be drawn anyway (the curve's own ramp is 0 there), grace is + // what moves the antagonist's stations and turrets away, so it is asserted, not left to the generated zone. + Assert.True(DemoPressure.InGrace(galaxy, zone), $"seed {seed} zone {Array.IndexOf(galaxy.Zones, zone)} (jump {e}, depth {e / (e + x):0.00}) is not in grace"); var pack = ZoneGenerator.GenerateZone(_items, _zoneSettings, _planetSettings, galaxy, zone, DemoEntranceStation); var hostile = pack.Entities.Where(entity => IsHated(galaxy, entity.Faction)).Select(entity => entity.GetType().Name + ":" + _items.GetData(entity.Hull).Name).ToArray(); Assert.True(hostile.Length == 0, $"seed {seed} zone {Array.IndexOf(galaxy.Zones, zone)} (jump {e}, depth {e / (e + x):0.00}): {string.Join(", ", hostile)}");