code wiki / _hdl_build / nx_gatelib_test.nx

nx_gatelib_test.nx

buildroot/runtime/_hdl_build/nx_gatelib_test.nx

9270 B170 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_gatelib_test.nx -- the gate the extracted library needed immediately. ★DE-DUPLICATING CREATED A NEW UNGATED LOAD-BEARING ORGAN. Folding nine duplicated functions into one library gave that library two consumers and no test of its own -- precisely the class the consumers exist to find. A refactor that removes duplication while adding unverified code has moved the debt, not paid it. ⚠AND MY OWN SCANNER DID NOT SURFACE IT. With two consumers the library scores severity 2, which ranks BELOW the fixed floor of 3 given to organs nothing calls at all, so it sat under 5020 dead files in the ranking. A load-bearing organ with two consumers matters MORE than a dead one with none, and the ranking said the opposite. Filed against nx_gatescan and noted here because the tool found nothing while the defect was real. This gate calls the library DIRECTLY. The two consumer gates keep their own independent re-derivations of the same rules, and that is deliberate: a direct unit test proves the library does what it says, while a separate implementation agreeing proves the rule itself is right. They answer different questions and neither replaces the other. expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gatelib.nx nx_gate.nx nx_gatelib_test.nx

imports: nx_syscalls.nxnx_gatelib.nxnx_gate.nx

imported by: nobody (leaf or entry point)

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

main gl_is_nx gl_is_gate_name gl_ends gl_len tw sys_write gl_ends ↻ eg_new sys_mmap eg_intern eg_hash eg_name_eq eg_finalize sys_mmap ↻ sys_mmap ↻ gl_attribute gl_ends ↻ eg_find eg_name_eq ↻ tn sys_mmap ↻ sys_write ↻ gl_has_token gl_is_ident 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 ↻ gl_read sys_openat_rd ↻ sys_read

structs

none

consts

none

functions

26func tw(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
27func tn(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
29func main() -> i64