code wiki / _hdl_build / nx_worldgen_refine.nx
nx_worldgen_refine.nx
buildroot/runtime/_hdl_build/nx_worldgen_refine.nx
about
nx_worldgen_refine.nx -- TEAM-OWNED worldgen quality gate + AUTO-REFINE
loop (operator 2026-06-10: "s class exceed instead of our crummy proc gen
-- build the team to do the work"; operator 2026-05-16: "build an iterative
loop ... i dont want to have to manually check if you generate good maps").
The loop nobody has to babysit:
nx_procgen_landscape(seed, preset, w, h, density) -- current generator
-> nx_world_quality_grade (8 axes, Q14, sealed F..S, refine_axis)
-> hill-climb the exposed knobs (preset x density x seed batch)
-> bank the BEST params to /tmp/nishi_worldgen_best.conf (data-driven;
the voxel build reads params, never hardcodes them -- Cardinal 11)
HONEST BASELINE FIRST: the first sweep grades the CURRENT generator as-is.
"Crummy" becomes a NUMBER with named failing axes; every later rung
(composed primitives: causal rivers, erosion, constraint placement per
the procgen cardinals) must MOVE that number through this same gate.
Note the grader's own posture: Minecraft/No-Man's-Sky/Houdini have NO
mathematical world-quality verdict -- this instrument is itself the
EXCEED axis; S-class = the generator earns NX_GRADE_S under it.
WORLDGEN lines -> stdout + /tmp/nishi_worldgen_gate.log.
Exit: 0 if best grade >= floor (argv[1], default C=2), else 1.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_worldgen_tunelib.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
| 27 | const WR_MAGIC_8192: i64 = 8192 |
| 28 | const WR_MAGIC_8191: i64 = 8191 |
| 30 | const WR_W: i64 = 64 |
| 31 | const WR_H: i64 = 64 |
| 32 | const WR_RELIEF: i64 = 1024 // Q10 full-scale elevation |
| 33 | const WR_SEEDS_PER_CFG: i64 = 3 // median-ish stability without burning cycles |
| 34 | const WR_DENSITY_STEPS: i64 = 4 // density_q10 in {512, 1024, 1536, 2048} |
functions
| 36 | func wr_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } calls 1: sys_write |
| 37 | func wr_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } |
| 38 | func wr_cat_n(dst: *u8, off: i64, v: i64) -> i64 |
| 51 | func wr_grade_name(g: i64) -> *u8 |
| 61 | func wr_refine_name(r: i64) -> *u8 |
| 78 | func wr_eval_cfg(preset: i64, density_q10: i64, out12: *i64) -> i64 |
| 89 | func wr_report(logfd: i64, ts: i64, preset: i64, density: i64, out12: *i64) -> i64 |
| 123 | func wr_oscillation_check(ts: i64, grade: i64, axis: i64) -> i64 |
| 213 | func main(argc: i64, argv: *i64) -> i64 |