code wiki / _hdl_build / nx_gatescan.nx

nx_gatescan.nx

buildroot/runtime/_hdl_build/nx_gatescan.nx

15214 B324 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_gatescan.nx -- FIND THE ORGANS NOTHING IS CHECKING. ===== WHY THIS EXISTS ============================================ Two defects were found by luck in this ecosystem within one session: nx_pow10 -- no gate of its own. Its header claimed an interpolation error of <=0.3%; measured, it is 0.66%. That figure had been inherited into a FOOD-SAFETY margin note. nx_arrhenius -- no gate AND nothing imported it. It returned exactly 1.0 for every input, i.e. "temperature does not affect reaction rate", from a file whose own comment claimed it carefully managed precision across the reciprocal step. Both were caught because someone happened to look. That is not a control. A session must remember; a tool cannot forget. This organ turns "no gate + no callers = an unverified intention" from a law into a scan. ===== THE MEASUREMENT ============================================ Composes the existing graph engine rather than rebuilding it: the whole- tree walk and accurate import edges already exist and are proven, so this adds exactly one idea on top of them. HAS_GATE -- a node named <base>_test.nx or <base>_gate.nx exists. CONSUMERS -- importers that are NOT that organ's own gate. ★THE SECOND HALF IS THE LOAD-BEARING ONE. Raw fan-in (Ca) counts the gate as an importer, so the moment you write a gate for a dead organ its Ca becomes 1 and a naive orphan check calls it "used". That is exactly what would have hidden nx_arrhenius the instant it was gated. Consumers are therefore counted with gate/test importers EXCLUDED. ===== RISK IS RANKED, NOT LISTED ================================= A flat list of ungated files invites working the easy end. The two classes are not equally dangerous and the ranking says so: UNGATED-LOAD-BEARING (no gate, N consumers) -- an error here propagates into N callers and is attributed to whichever one notices first.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_eco_graph.nx nx_import_scan.nx nx_gatelib.nx nx_gatescan.nx

imports: nx_syscalls.nxnx_eco_graph.nxnx_import_scan.nxnx_gatelib.nx

imported by: nobody (leaf or entry point)

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

main eg_new sys_mmap sys_mmap ↻ gl_walk sys_openat_rd sys_mmap ↻ sys_getdents64 dirent_type dirent_name gl_isdotdot gl_join gl_walk ↻ gl_len gl_is_nx eg_intern eg_hash eg_name_eq gl_read sys_openat_rd ↻ sys_read sys_close nis_scan nis_is_ws eg_add_edge dirent_reclen sys_close ↻ eg_finalize sys_mmap ↻ gl_len ↻ gl_is_gate_name gl_ends gl_len ↻ gl_attribute gl_ends ↻ eg_find eg_name_eq ↻ gw sys_write gn

structs

none

consts

59const GS_MAGIC_4096: i64 = 4096
60const GS_MAGIC_1024: i64 = 1024
62const GS_MAXNODE: i64 = 24000
63const GS_MAXEDGE: i64 = 300000
64const GS_ARENA: i64 = 4194304
65const GS_HASH: i64 = 65536
66const GS_FILECAP: i64 = 262144
91const GS_DEAD_FLOOR: i64 = 3

functions

93func gw(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 1: main calls 1: sys_write
94func gn(v: i64) -> i64 { let b: *u8 = sys_mmap(24); var m: i64 = v; if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m } let t: *u8 = sys_mmap(24); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { b[i] = t[k - 1 - i]; i = i + 1 } sys_write(1, b, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
105func gs_make_gate_name(name: *u8, n: i64, suffix: *u8, out: *u8) -> i64
called by 1: main calls 1: gl_len
137func main(argc: i64, argv: *i64) -> i64