Reported after a real long-running world (elapsedMy ~1340) showed seaLevel
drifted to -2900m, with "land" at -2000m next to "ocean" at -4000m.
Root cause: adjustSeaLevel()'s geographic land target (elevation above
seaLevel, fixed 30%) and advect()'s crust-type land conservation
(targetLand/landBand, held near whatever Phase-1 forming settled at for
that seed) are two independent notions of "land" that aren't guaranteed to
agree -- this seed's continental crust settled at only ~26%. With genuine
land structurally short of the target, the controller had no lower bound
and kept sinking seaLevel to misclassify progressively older, deeper
oceanic crust as land -- and since that crust keeps ageing and deepening
even at a fixed seaLevel, it was chasing a moving target with no way to
ever settle.
Added seaLevelMin/seaLevelMax config fields (default +-3000m) that clamp
adjustSeaLevel()'s candidate nudge, so a world that can't reach the target
land fraction settles at a plausible offset instead of an unbounded one.
New test_sealevel.cpp reproduces the pathology with a continuous elevation
distribution (not a synthetic cliff) and confirms the controller still
engages but never crosses either bound.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TMfyZv91tonDnPJqbaTVJE