nx_procgen_water_test.nx
buildroot/runtime/nx_procgen_water_test.nx
about
nx_procgen_water_test.nx -- KATs for P4 causal water (rivers + rills).
Exit 0 = all pass; first failing KAT's number is the exit code.
KAT 1 trace physics: on a synthetic cone, a trace from the apex is
strictly height-decreasing and reaches the map edge.
KAT 2 trace stops at a local minimum (synthetic bowl) -- water collects.
KAT 3 carve lowers exactly the channel: centre cells down by depth,
a far cell untouched; mask marks the path.
KAT 4 determinism: v2 twice -> byte-identical heightmaps AND masks.
KAT 5 v2 differs from v1 (water actually happened) and the mask is
non-empty on every preset x 2 seeds (width: rivers always form).
KAT 6 water mask overrides feature kinds: with-mask WATER count >
no-mask WATER count; conservation holds.
KAT 7 LOCAL_VARIATION axis moves UP on v2 vs v1 (worst-of-3 mountain
seeds) -- the ADD_DETAIL claim, instrument-proven.
KAT 8 no grade regression: v2 grade >= v1 grade on the same
(seed, preset), worst-of-3 mountain (water never makes the
verdict worse).
KAT 9 caprock resists: a top-band cell on a carve path is untouched
(and unmasked) while a lower cell on the same path carves --
the STRUCTURAL-ESCALATION rung's law, geometry-exact.
license_tier: ORIGINAL
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_procgen_preset.nxnx_procgen_water.nxnx_procgen_biome.nxnx_procgen_features.nxnx_world_quality_grader.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 32 | const WW: nx_int = 64 |
| 33 | const WH: nx_int = 64 |
functions
| 36 | func t_fill_cone(hm: *i64) -> nx_int called by 1: main |
| 55 | func main() -> i64 |