diff --git a/Tools/Scripts/MapGenerator.cs b/Tools/Scripts/MapGenerator.cs index 66b6991..f44835d 100644 --- a/Tools/Scripts/MapGenerator.cs +++ b/Tools/Scripts/MapGenerator.cs @@ -545,7 +545,15 @@ public partial class MapGenerator : TextureRect if (_coastWide && finalH < seaHere) { float depthM = (seaHere - finalH) * 251f; - finalH = seaHere - IslandFalloff.CoastShelf(depthM) / 251f; + // The remap is strictly positive on positive depth, so in exact + // arithmetic the waterline cannot move. In float32 it can: for a + // pixel a few microns under water, (sea - shallowerDepth) rounds + // back up to exactly sea, and `H < sea` then calls it land. That + // cost 5 px of 67 M on the first batch — immaterial in itself, but + // it falsifies the invariant the whole separability argument rests + // on. Hold the result strictly below sea and the invariant is exact. + finalH = Mathf.Min(seaHere - IslandFalloff.CoastShelf(depthM) / 251f, + System.MathF.BitDecrement(seaHere)); } // --- 6. OFFSHORE ISLANDS (task 11) ---