code wiki / (root) / nx_procgen_features_test.nx

nx_procgen_features_test.nx

buildroot/runtime/nx_procgen_features_test.nx

5766 B139 linesdepth 6pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic procgen
docsdependenciesstructsconstsfunctions

about

nx_procgen_features_test.nx -- KATs for the P3 biome-lawed feature kinds. Exit 0 = all pass; first failing KAT's number is the exit code. KAT 1 determinism: same (land, biomes, seed) twice -> identical kinds. KAT 2 validity: every kind is sealed (0..3). KAT 3 histogram conservation: counts sum to n_features. KAT 4 variety axis LIVE: grader FEATURE_VARIETY >= 9830 (WIN floor) worst-of-3-seeds on the mountain preset. KAT 5 variety discriminates: an all-ICE biome map (rock-only law) scores 0; the real map scores strictly higher. KAT 6 biome law holds: a pure-DESERT map grows NO trees. KAT 7 independent streams: kinds seed does not change the biome map. KAT 8 width: every preset x 3 seeds stays >= 6553 (marginal floor) -- the variety axis must never fall back into LOSS territory (honest 2026-06-10 baseline: meadow worst = 6585; forest/meadow rock-band skew is the named P4/P5 improvement surface). license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_procgen_preset.nx nx_procgen_biome.nx nx_procgen_features.nx nx_world_quality_grader.nx nx_procgen_features_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_procgen_preset.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 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 _pd_cos _pd_sin _pd_accept _pd_dist_sq nx_sig_peak_t nx_sig_ridge_t _sig_seg_d2 nx_sig_basin

structs

none

consts

26const FW: nx_int = 64
27const FH: nx_int = 64

functions

29func main() -> i64