code wiki / (root) / nx_procgen_water_test.nx

nx_procgen_water_test.nx

buildroot/runtime/nx_procgen_water_test.nx

7988 B198 linesdepth 7pulls 11 transitivereach 0 importersview sourcekind gate/prooftopic procgen
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_procgen_preset.nx nx_procgen_water.nx nx_procgen_biome.nx nx_procgen_features.nx nx_world_quality_grader.nx nx_procgen_water_test.nx

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

main sys_mmap t_fill_cone nx_water_trace nx_water_lowest_neighbor nx_water_lowest_neighbor ↻ nx_water_carve nx_water_carve_floor nx_water_carve_band nx_procgen_landscape_v2 nx_procgen_landscape nx_procgen_preset_is_valid _preset_octaves _preset_persistence_q10 _preset_base_radius _apply_density nx_perlin_alloc sys_mmap ↻ _perlin_lcg_step sys_mmap ↻ _fill_heightmap nx_perlin_fbm_2d nx_perlin_2d _perlin_hash_2d _perlin_dot_2d _perlin_grad_2d_x _perlin_grad_2d_y _perlin_ease _perlin_lerp nx_sig_compose nx_sig_compose_cfg _sig_n_peaks _sig_peak_radius _sig_peak_amp _sig_argmin sys_mmap ↻ nx_poisson_disk_sample sys_mmap ↻ nx_prng_init nx_prng_next

structs

none

consts

32const WW: nx_int = 64
33const WH: nx_int = 64

functions

36func t_fill_cone(hm: *i64) -> nx_int
called by 1: main
55func main() -> i64