code wiki / _hdl_build / nx_layerscan_gate.nx
nx_layerscan_gate.nx
buildroot/runtime/_hdl_build/nx_layerscan_gate.nx
about
nx_layerscan_gate.nx -- LAYERING-VIOLATION CENSUS: which runtime/ organs import a lib that exists ONLY
in _hdl_build/, and are therefore SILENTLY UNBUILDABLE?
WHY (three instances found BY CHANCE in one session, each a whole capability):
nx_clock.nx -> darkened 174 gguf/f32_llm organs (the sovereign LLM stack, frozen ~Jul 16)
nx_bm25.nx -> darkens rights-enforced DMS search (licensed-media consent gating)
nx_fft.nx -> darkens nx_fft_f32 -> nx_autograd_tensor -> THE ENTIRE TRAINING CAPABILITY
Each was found only because somebody happened to build the right target. Three hits from a handful of
attempts means this is a POPULATION, not a coincidence -- and it is mechanically detectable in one pass.
THE RULE BEING ENFORCED (banked law, re-confirmed by measurement): **runtime/ CANNOT import _hdl_build/**,
while _hdl_build/ CAN import runtime/. Proven both directions: nx_syscalls.nx exists ONLY in runtime/ and
every _hdl_build organ imports it and builds; nx_clock.nx existed ONLY in _hdl_build/ and runtime/nx_loop.nx
could not see it until a copy was placed in runtime/. The asymmetry is what makes the remedy a MOVE.
METHOD, deliberately probe-based rather than table-based: for each flat runtime/*.nx, scan its import lines;
for each imported basename X, if runtime/X does NOT exist but _hdl_build/X DOES, that is a violation. No
name tables, no hashing -- two openat probes per import, so the scan cannot silently overflow a table.
FIX FOR EVERY HIT IS THE SAME AND IT IS A MOVE, NEVER A COPY: relocate the lib _hdl_build/ -> runtime/.
Because _hdl_build can still reach runtime/, existing consumers keep resolving it and NO duplicate basename
is created. Copy-and-leave manufactures the same-name-two-copies divergence class measured repeatedly.
ENVELOPE, declared in output and never silent: FLAT scan of runtime/ (no recursion, so _attic/_retired/
_stage_local shadows are excluded); only the first LS_HEADCAP bytes of each file are scanned for imports
(imports are declared at the top of every organ in this tree); file and hit counts are capped and the caps
are PRINTED with the remainder. A capped scan reports PARTIAL, never a clean total.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| 31 | const LS_RUNTIME: *u8 = "buildroot/runtime" as *u8 |
| 32 | const LS_HDL: *u8 = "buildroot/runtime/_hdl_build" as *u8 |
| 33 | const LS_DIRBUF: i64 = 262144 |
| 34 | const LS_PATHBUF: i64 = 1024 |
| 35 | const LS_HEADCAP: i64 = 16384 |
| 43 | const LS_FILECAP: i64 = 40000 |
| 44 | const LS_MAXSHOW: i64 = 30 |
| 45 | const LS_RECLEN_OFF: i64 = 16 |
| 46 | const LS_NAME_OFF: i64 = 19 |
functions
| 48 | func ls_puts(s: *u8) |
| 54 | func ls_puti(x: i64) |
| 80 | func ls_ends_nx(nm: *u8, n: i64) -> i64 called by 1: main |
| 88 | func ls_exists(path: *u8) -> i64 |
| 96 | func ls_join(out: *u8, dir: *u8, name: *u8) called by 1: ls_scan_file |
| 115 | func ls_match(b: *u8, at: i64, end: i64, pat: *u8, pl: i64) -> i64 called by 1: ls_scan_file |
| 126 | func ls_scan_file(fname: *u8, ctr: *i64) |
| 177 | func main(argc: i64, argv: *i64) -> i64 |