code wiki / _hdl_build / nx_constscan_beat.nx

nx_constscan_beat.nx

buildroot/runtime/_hdl_build/nx_constscan_beat.nx

9611 B279 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_constscan_beat.nx -- STANDING guard for LM-030, the const-pointer direct-index SILENT MISCOMPILE. WHY A BEAT: on 2026-07-30 I reproduced LM-030 with a controlled probe/control pair -- CONST[i] compiles clean, runs, and returns WRONG DATA with no diagnostic anywhere -- then scanned all 17,501 .nx in the tree and found hits=0. Clean TODAY is not a property; it is a snapshot. A defect whose only symptom is a wrong number needs a continuous guard, because the first reintroduction is invisible by construction. WHY THE DETECTOR WAS DARK, which is the real lesson: nx_doc_constscan already existed and had even measured the same garbage value, but it was SOURCE-ONLY -- never built, never in tool_allowlist.conf, never on the sweep rail. A detector nobody can run is not a guard. This beat is the missing rail. Discovers + batches + aggregates ONLY. It forks the proven ./nx_doc_constscan_run.elf exactly as nx_store_fold_beat forks nx_store_compact, so the DETECTOR keeps sole ownership of what counts as a hit. Batching exists because the runner takes files as argv and the tree is ~17.5k files -- one exec cannot hold them, so this is xargs-in-an-organ, not a re-implementation. Sweep-row contract: exit 0 = zero LM-030 sites; exit 1 = at least one, surfaced RED with the count. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_constscan_beat.nx

imports: nx_syscalls.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap cb_len sys_openat_rd cb_puts sys_write cb_len ↻ sys_getdents64 dirent_reclen dirent_name cb_is_scannable cb_len ↻ cb_is_fixture tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read sys_wait4 wait_exit_code cb_hits sys_close ↻ cb_putn sys_mmap ↻ sys_write ↻ sys_munmap

structs

none

consts

22const CB_DIRBUF: i64 = 262144
23const CB_ARENA: i64 = 1048576
24const CB_OUTCAP: i64 = 262144
25const CB_PATHCAP: i64 = 1024
26const CB_BATCH: i64 = 96
27const CB_AVSLOTS: i64 = 100
28const CB_STDOUT: i64 = 1
29const CB_NL: i64 = 10

functions

31func cb_len(s: *u8) -> i64
38func cb_puts(s: *u8) -> i64
called by 1: main calls 2: sys_writecb_len
42func cb_putn(v: i64) -> i64
called by 1: main calls 3: sys_mmapsys_writesys_munmap
77func cb_is_fixture(nm: *u8) -> i64
called by 1: cb_is_scannable
96func cb_is_scannable(nm: *u8) -> i64
called by 1: main calls 2: cb_lencb_is_fixture
116func cb_hits(buf: *u8, n: i64) -> i64
called by 1: main
164func main(argc: i64, argv: *i64) -> i64