code wiki / _hdl_build / nx_gatequality.nx

nx_gatequality.nx

buildroot/runtime/_hdl_build/nx_gatequality.nx

14479 B322 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_gatequality.nx -- HOW MUCH OF AN ORGAN ITS GATE ACTUALLY EXERCISES. ===== WHY THIS EXISTS ============================================ nx_gatescan answers "does anything test this file". That question has a blind spot large enough to have hidden a real defect in this tree: a gate touching four of an organ's twelve functions counts as a gate, so the organ reads as covered. That is exactly what happened in the food-chemistry lane. A neighbouring gate imported the ingredient catalog and exercised si_name, si_density_mg_per_ml, si_capsule_fill_mg and si_cost_is_indicative -- the packaging and cost helpers. si_class and si_is_lawful_dietary, the two functions deciding whether a substance may LAWFULLY BE SOLD, were exercised by nothing at all, and the scan reported the file as gated. ★COVERAGE ACCUMULATES AROUND WHATEVER A NEIGHBOUR HAPPENED TO NEED, so the most consequential function in a file is frequently the least checked. Existence is the wrong question. This organ asks the other one. ===== THE MEASUREMENT ============================================ 1. From each organ, extract its top-level `func` definitions. 2. Find the gates attributed to it (same rule as nx_gatescan: the organ stem followed by an underscore, ending _test.nx or _gate.nx). 3. In each gate, look for a real reference to each function name. 4. Coverage = referenced / defined, unioned across all of that organ's gates -- an organ tested by three files is covered by their union. ★★COMMENTS ARE STRIPPED BEFORE MATCHING, AND THAT IS NOT A DETAIL. Gates in this tree carry long explanatory headers that NAME the functions they discuss. Matching raw text would count a function as exercised because its own gate mentioned it in prose -- and the worse the coverage, the more likely someone wrote a comment about it. The measurement would have been anti-correlated with the truth. ★MATCHING IS TOKEN-EXACT. A substring match would count si_class as covered by a reference to si_class_of, which is how a coverage tool starts reporting numbers that are reassuring and false.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_eco_graph.nx nx_gatelib.nx nx_gatequality.nx

imports: nx_syscalls.nxnx_eco_graph.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 ↻ gw sys_write gn sys_mmap ↻ sys_write ↻ gl_len ↻ gl_is_gate_name gl_ends gl_len ↻ gl_attribute gl_ends ↻ eg_find eg_name_eq ↻

structs

none

consts

55const GQ_MAGIC_4096: i64 = 4096
57const GQ_MAXNODE: i64 = 24000
58const GQ_MAXEDGE: i64 = 8
59const GQ_ARENA: i64 = 4194304
60const GQ_HASH: i64 = 65536
61const GQ_FILECAP: i64 = 262144
62const GQ_PATHARENA: i64 = 4194304
67const GQ_MAXFUNCS: i64 = 64

functions

69func 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
70func 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
104func gq_close_reach(src: *u8, n: i64, names: *u8, offs: *i64, lens: *i64, spans: *i64, fc: i64, seed: i64) -> i64
called by 1: main calls 1: gl_has_token
140func main(argc: i64, argv: *i64) -> i64