nx_worldgen_tunelib.nx
buildroot/runtime/nx_worldgen_tunelib.nx
about
nx_worldgen_tunelib.nx -- shared library for the worldgen knob-tuning
loop (no main; consumed by nx_worldgen_tuner, its KAT test, and
nx_worldgen_refine). The capability this closes (operator 2026-06-10
"build the team's capabilities to handle your callouts"): the refine
loop's auto-filed verdict NAMES a weak axis; this library lets a team
organ OPTIMIZE the generator's exposed knobs against exactly that axis
-- verdict -> assignment -> tuner -> re-verdict, with the 8-axis grader
as referee and no LLM anywhere in the loop.
Knobs (all DATA, swept under the verdict):
river_depth -- channel incision depth (P4)
rill_depth -- drainage texture depth (P4)
rill_radius -- drainage density (poisson) (P4)
detail_amp -- fine-octave relief (nx_sig_detail)
Score = (grade, named-axis value) lexicographic: grade dominates;
the banked refine axis breaks ties, so the tuner climbs the axis the
verdict called out without ever trading the grade away.
license_tier: ORIGINAL
dependencies 7 imports · 4 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: _ts_diag.nxnx_worldgen_refine.nxnx_worldgen_tuner.nxnx_worldgen_tuner_test.nx
structs
| none |
consts
| 28 | const TL_MAGIC_1024: i64 = 1024 |
| 29 | const TL_MAGIC_4096: i64 = 4096 |
| 30 | const TL_MAGIC_4095: i64 = 4095 |
| 32 | const TL_W: i64 = 64 |
| 33 | const TL_H: i64 = 64 |
| 34 | const TL_RELIEF: i64 = 1024 |
| 35 | const TL_SEEDS: i64 = 3 |
| 38 | const TL_K_RIVER_DEPTH: i64 = 0 |
| 39 | const TL_K_RILL_DEPTH: i64 = 1 |
| 40 | const TL_K_RILL_RADIUS: i64 = 2 |
| 41 | const TL_K_DETAIL_AMP: i64 = 3 |
| 42 | const TL_K_PEAKS_EXTRA: i64 = 4 |
| 43 | const TL_K_AMP_BOOST: i64 = 5 |
| 44 | const TL_K_TERRACE: i64 = 6 |
| 45 | const TL_K_COUNT: i64 = 7 |
functions
| 49 | func tl_compose_world(seed: i64, preset: i64, density: i64, |
| 66 | func tl_eval(preset: i64, density: i64, knobs: *i64, out12: *i64) -> i64 |
| 102 | func tl_axis_offset(refine_axis: i64) -> i64 |
| 115 | func tl_axis_value(out12: *i64, refine_axis: i64) -> i64 |
| 127 | func tl_health(out12: *i64) -> i64 |
| 150 | func tl_score(grade: i64, out12: *i64, refine_axis: i64) -> i64 |
| 165 | func tl_conf_get(buf: *u8, n: i64, key: *u8, fallback: i64) -> i64 |
| 209 | func tl_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 224 | func tl_conf_find_val(buf: *u8, n: i64, key: *u8) -> i64 called by 1: tl_conf_get_refine |
| 251 | func tl_word_at(buf: *u8, n: i64, off: i64, word: *u8) -> i64 called by 1: tl_conf_get_refine |
| 265 | func tl_conf_get_refine(buf: *u8, n: i64, fallback: i64) -> i64 |
| 280 | func tl_grade_name(g: i64) -> *u8 |
| 290 | func tl_refine_name(r: i64) -> *u8 |
| 306 | func tl_load_knobs(conf_path: *u8, preset: i64, knobs: *i64) -> i64 |