code wiki / _hdl_build / nx_param_tune.nx

nx_param_tune.nx

buildroot/runtime/_hdl_build/nx_param_tune.nx

7148 B144 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_param_tune.nx -- X-PRM-003 rung1: autonomous single-variable param tuning (RSI). Picks ONE TUNABLE param (triage_drill_cap, the documented first target), reads its CURRENT value from params.tsv, MEASURES its named effect meter over REAL data (the failure-evidence DEMAND = count of RED rows the cap must cover), does a seed-fixed sweep over [2,8], and PROPOSES a new value (gate-judged, NOT auto-applied -- written to param_proposals.tsv). Honest no-overclaim: the meter here is failure-coverage (real); fuller factors (Doctor route-time, token-cost model) = rung2. CONSERVATIVE: a QUIET signal (demand=0) proposes HOLD -- never tune a cap down on a momentary lull. Self-validating: synthetic controls prove the proposal RESPONDS to the measured demand (no false-green).

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_param_tune.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main pt_target sys_mmap pt_read sys_openat_rd sys_read sys_close pt_param_value sys_mmap ↻ pt_cols pt_slice_eq pt_int pt_count_status sys_mmap ↻ pt_cols ↻ pt_w sys_write pt_n sys_mmap ↻ sys_write ↻ sys_openat_append sys_close ↻ sys_exit

structs

none

consts

10const K_MAGIC_262144: i64 = 262144
11const K_MAGIC_262128: i64 = 262128
12const K_MAGIC_2097152: i64 = 2097152
13const K_MAGIC_2097136: i64 = 2097136

functions

15func pt_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
16func pt_n(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
22func pt_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
31func pt_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64
42func pt_slice_eq(a: *u8, s: i64, e: i64, name: *u8) -> i64
called by 1: pt_param_value
48func pt_int(buf: *u8, s: i64, e: i64) -> i64
called by 1: pt_param_value
54func pt_param_value(buf: *u8, n: i64, name: *u8) -> i64
69func pt_count_status(buf: *u8, n: i64, sb: i64) -> i64
called by 1: main calls 2: sys_mmappt_cols
84func pt_target(current: i64, demand: i64, lo: i64, hi: i64) -> i64
called by 1: main
91func main(argc: i64, argv: *i64) -> i64