code wiki / _hdl_build / nx_worldgen_tuner.nx

nx_worldgen_tuner.nx

buildroot/runtime/_hdl_build/nx_worldgen_tuner.nx

12125 B270 linesdepth 8pulls 12 transitivereach 0 importersview sourcekind tooltopic worldgen
docsdependenciesstructsconstsfunctions

about

nx_worldgen_tuner.nx -- TEAM-OWNED verdict-targeted knob tuner (operator 2026-06-10 "build the team's capabilities to handle your callouts"). The refine loop auto-files a verdict row NAMING a weak axis; this organ picks that assignment up MECHANICALLY: read knowledge/status/worldgen_best.conf (preset, density, axis) coordinate-descend the generator's exposed knobs (river_depth, rill_depth, rill_radius, detail_amp) score = (worst-of-seeds grade, named-axis value) lexicographic bank winner -> knowledge/status/worldgen_knobs.conf (+ /tmp copy) on banked-knobs CHANGE -> auto-file one arc=PROCGEN pm row nx_worldgen_refine consumes the banked knobs each beat, so the tuned metric IS the gate metric. Verdict -> assignment -> tune -> re-verdict: the loop is closed with the 8-axis grader as referee, no LLM anywhere. TUNER lines -> stdout + /tmp/nishi_worldgen_tuner.log. Exit 0 = tuned (banked best >= starting score), 1 = regression refused. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_worldgen_tunelib.nx nx_worldgen_tuner.nx

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

main sys_openat_append sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ tl_read_file sys_openat_rd sys_read sys_close tl_conf_get tl_conf_get_refine tl_conf_find_val tl_word_at tl_load_knobs nx_water_default_river_dep _w_river_depth nx_water_default_rill_dept nx_water_default_rill_radi _w_rill_radius sys_mmap ↻ tl_read_file ↻ tl_conf_get ↻ tl_eval sys_mmap ↻ tl_compose_world nx_procgen_landscape_cfg 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 nx_sig_compose_cfg

structs

none

consts

23const K_MAGIC_1024: i64 = 1024
24const K_MAGIC_1228: i64 = 1228
25const K_MAGIC_1433: i64 = 1433
26const K_MAGIC_4096: i64 = 4096
27const K_MAGIC_4095: i64 = 4095

functions

29func tn_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
30func tn_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 }
called by 2: tn_reportmain
31func tn_cat_n(dst: *u8, off: i64, v: i64) -> i64
called by 2: tn_reportmain calls 1: sys_mmap
45func tn_grid_len(knob: i64) -> i64
called by 1: main
54func tn_grid_val(knob: i64, i: i64) -> i64
called by 1: main
97func tn_report(logfd: i64, tag: *u8, ts: i64, knobs: *i64, grade: i64,
119func main() -> i64