code wiki / (root) / nx_firstbyte.nx

nx_firstbyte.nx

buildroot/runtime/nx_firstbyte.nx

27154 B548 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_firstbyte.nx -- FIRST-BYTE-UP ANALYSIS FOR /compare: what does a rung REST ON, where does its chain stop being sound, and WHICH unsound link is the one you can actually act on? WHY THIS EXISTS (measured 2026-08-23). Five foundation defects were each found LATE, by a lane trying to build the rung ABOVE them: nx_skeleton capped at 32 bones / 2048 verts against a corpus of 104-370 joints and 14,164-423,919 verts; nx_gsplat pinned to a compile-time 512x384 while every inner kernel was ALREADY viewport-agnostic; PF_NB=48 binning an oracle holding 4096 points/section; the LANGUAGE having no vector types; and nothing able to bind a generated mesh to a generated skeleton. In EVERY case /compare showed the rung OPEN and never showed WHAT IT RESTS ON. *** NOT A SECOND GRAPH. *** nx_eco_graph_build already walks and persists the import graph, and eg_ancestors is "roots-to-god (transitive imports, down to leaves)" -- that IS the first-byte-up chain, and it had never been pointed at a compare board. This organ derives NO edges: it is the JOIN between <domain>.matrix rows and that closure, plus a per-link soundness query. *** THE CAP AXIS IS MEASURED. *** `nx_capcensus file <path>` answers per module IN ITS EXIT CODE -- 0 CLEAN / 1 CAPPED / 3 UNREADABLE -- so a foundation check BRANCHES WITHOUT PARSING. We compose that verdict; we never re-implement its classifier. Because the answer is the exit code and not the text, a truncated capture cannot change it. ABSTENTION IS INHERITED: the census refuses to report CLEAN over a module it never read, so this organ refuses READY over a chain containing such a module. *** RANKING: "NEAREST" IS NOT "MOST ACTIONABLE". *** v1 named the FIRST capped link found. With only 2.56% of estate bounds DERIVED, most chains carry SEVERAL capped links -- so v1 reported `first_unsound=nx_syscalls.nx` on rungs whose real problem was elsewhere: true, and completely non-actionable. A CAP IN A LEAF EVERYONE SHARES IS A DIFFERENT FINDING FROM A CAP IN YOUR OWN MODULE, AND REPORTING THE FIRST HIDES THE SECOND. Every capped link is now reported, classified and ranked: OWN the rung's own source -- the lane that owns this rung owns the fix. Ranked first. RARE few dependents -- a targeted fix. Ranked by ASCENDING fan-in, rarest first. UBIQUITOUS appears in EVERY resolved chain on this board -- an estate-wide concern, never a rung's blocker. Ranked last so it can never mask an actionable link again. BOTH CLASS BOUNDARIES ARE DERIVED, NOT PICKED. "Ubiquitous" is defined by the board itself (present in all N resolved chains, N counted this run), and "rare" is ordered by the graph's own fan-in via eg_ca -- the closure is already computed, so the dependent count is free. There is no threshold constant anywhere in this classification, because a picked one would be the seventh phony cap. A rung with ONE capped link in its own module and a rung with NINE scattered through shared leaves are different situations, and the per-rung own/rare/ubiq counts now say which is which. KNOWN ERROR TERM ON EVERY CAPPED VERDICT, disclosed by the census itself: it flagged CE_C_SHOWMAX=12 -- a COUNTER INDEX, not a capacity bound -- because the name contains "MAX".

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_eco_graph.nx nx_gatekit_lib.nx nx_firstbyte.nx

imports: nx_syscalls.nxnx_eco_graph.nxnx_gatekit_lib.nx

imported by: nobody (leaf or entry point)

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

main fb_w sys_write sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ eg_load sys_mmap ↻ sov_get_ints sys_mmap ↻ ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 sov_get_copy sys_mmap ↻ ss_get ↻ fb_wn sys_mmap ↻ sys_write ↻

structs

none

consts

78const FB_STORE: *u8 = "knowledge/store/ecograph_full" as *u8
79const FB_MATPFX: *u8 = "buildroot/knowledge/compare/" as *u8
80const FB_MATSFX: *u8 = ".matrix" as *u8
81const FB_CENSUS: *u8 = "./nx_capcensus.elf" as *u8
82const FB_RTPFX: *u8 = "buildroot/runtime/" as *u8
83const FB_HDLPFX: *u8 = "buildroot/runtime/_hdl_build/" as *u8
84const FB_PATHW: i64 = 4096
85const FB_NAMEW: i64 = 256
88const FB_CAPBUF: i64 = 65536
90const FB_EXIT_NOTREADY: i64 = 1
91const FB_EXIT_USAGE: i64 = 2
92const FB_EXIT_NOGRAPH: i64 = 3
93const FB_EXIT_NOMATRIX: i64 = 4
95const FB_READY: i64 = 0
96const FB_PLACEHOLDER: i64 = 1
97const FB_ABSENT: i64 = 2
98const FB_UNKNOWN: i64 = 3
99const FB_EMPTY: i64 = 4
100const FB_CAPPED: i64 = 5
101const FB_UNOBS: i64 = 6
103const FB_Q_CLEAN: i64 = 1
104const FB_Q_CAPPED: i64 = 2
105const FB_Q_UNREAD: i64 = 3
108const FB_K_OWN: i64 = 0
109const FB_K_RARE: i64 = 1
110const FB_K_UBIQ: i64 = 2

functions

125func fb_rank_class(node: i64, own: i64, nres: i64) -> i64
called by 1: main
131func fb_w(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
132func fb_span(b: *u8, s: i64, e: i64) -> i64 { if e > s { sys_write(1, ((b as i64) + s) as *u8, e - s) } return 0 }
called by 1: main calls 1: sys_write
134func fb_wn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
147func fb_join(dst: *u8, pfx: *u8, base: *u8) -> i64
157func fb_matpath(dom: *u8) -> i64
called by 1: main calls 1: fb_join
168func fb_cap_query(base: *u8) -> i64
called by 1: fb_state_of calls 2: fb_joingk_run_capture
184func fb_state_of(g: *EcoGraph, node: i64) -> i64
called by 1: main calls 1: fb_cap_query
193func fb_field(b: *u8, ls: i64, le: i64, idx: i64, fe: *i64) -> i64
called by 1: main
211func fb_basename(b: *u8, s: i64, e: i64) -> i64
called by 1: main
222func fb_is_absent_sym(b: *u8, s: i64, e: i64) -> i64
called by 1: main
233func main(argc: i64, argv: *i64) -> i64