code wiki / _hdl_build / nx_sweepcheck.nx

nx_sweepcheck.nx

buildroot/runtime/_hdl_build/nx_sweepcheck.nx

7447 B165 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_sweepcheck.nx -- MECHANISES THE MOST EXPENSIVE RECURRING ERROR OF THIS PROGRAM: reporting a result from a parameter that never reached the code. WHY THIS EXISTS (measured, not theorised). Across one session the same defect class was hit repeatedly: * a reference-weight sweep returned 523/517/518/523 -- flat, because the handler never parsed the argument. I nearly concluded the model change had failed. * an index-offset A/B read 504 vs 508 and was declared "noise". The knob was hardcoded downstream; the 4-point difference was PROMPT TEXT, not the knob. * a dilation sweep at reach 0 / 4 / 12 returned BYTE-IDENTICAL results and was written up as a regression WITH AN INVENTED ROOT CAUSE. The verb had fallen through to a different code path. In every case the tell was the same and free: A SWEPT PARAMETER THAT PRODUCES NO VARIATION IS NOT AN INEFFECTIVE PARAMETER -- IT IS AN UNWIRED ONE. Analysing such results is worse than useless, because a plausible story gets attached to numbers that mean nothing. Per the banked law "A SESSION MUST REMEMBER < A TOOL THAT CANNOT DO THE WRONG THING", the check is mechanised here instead of trusted to discipline. Feed it the measurements from any sweep BEFORE interpreting them; it refuses the ones that carry no information. nx_sweepcheck values <v1> <v2> ... -> GREEN if the sweep varies, RED if it is flat (unwired) nx_sweepcheck selftest expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_sweepcheck.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main sw_w sys_write sw_streq sw_selftest sys_mmap sw_verdict sw_w ↻ sw_distinct sw_spread sw_n nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sw_w ↻ sw_n ↻ sys_exit sys_mmap ↻ sw_atoi sw_verdict ↻

structs

none

consts

25const SW_MIN_SAMPLES: i64 = 2

functions

27func sw_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: sw_verdictsw_selftestmain calls 1: sys_write
32func sw_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: sw_verdictsw_selftest calls 1: nxi_out
33func sw_streq(a: *u8, b: *u8) -> i64
called by 1: main
39func sw_atoi(s: *u8) -> i64
called by 1: main
50func sw_distinct(vals: *i64, n: i64) -> i64
called by 1: sw_verdict
63func sw_spread(vals: *i64, n: i64) -> i64
called by 1: sw_verdict
77func sw_verdict(vals: *i64, n: i64, emit: i64) -> i64
98func sw_selftest() -> i64
called by 1: main calls 4: sys_mmapsw_verdictsw_wsw_n
142func main(argc: i64, argv: *i64) -> i64