code wiki / (root) / nx_debt_recurrence_gate.nx

nx_debt_recurrence_gate.nx

buildroot/runtime/nx_debt_recurrence_gate.nx

15251 B235 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic debt
docsdependenciesstructsconstsfunctions

about

nx_debt_recurrence_gate.nx -- CE3 (codeeffectiveness ce_recurrence): recurrence per defect class, PROVEN on planted planes with hand-computed answers. In-process over nx_debt_recurrence_lib (the ONE ruler nx_debtmine composes). The accept rule, tooth by tooth: a planted recurring class shows a NON-DECREASING count across two beats (F1 -> F2), a genuinely resolved class FALLS (F1 -> F3), and the measure NAMES the prior filing id and the recurring ids rather than a bare number. Plus: a scope with no resolved prior never counts, the first eaten row is the prior and never its own recurrence, a malformed row is counted not dropped, the emitted JSON carries the ids, the spine sidecar takes one row per measured run and the production spine is untouched. Rows are written with real TAB bytes. F4 (2026-09-06): a plane with MORE distinct scopes than the retired 256-slot table held is counted IN FULL and reports scopes_capped=0 -- the first live beat (4,353 rows) hit that bound and published a floor wearing a total; this tooth is the bite that proves the row-derived capacity REMOVED the cap rather than moved it. F4 also carries one id burst (two rows filed in one epoch-second share an id), the class the live plane showed under stale-mirror. exit: 0 GREEN . 1 RED . 3 SKIP license_tier: ORIGINAL No hw writes.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_debt_recurrence_lib.nx nx_debt_recurrence_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_debt_recurrence_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ sys_mkdir rg_open sys_unlinkat sys_openat_wr rg_base rg_row rg_n sys_mmap ↻ sj_catn sys_mmap ↻ sys_write ↻ rg_tab sys_mmap ↻ sys_write ↻ rg_w sys_write ↻ rg_slen rg_nl sys_mmap ↻ sys_write ↻

structs

none

consts

17const RG_ROOT: *u8 = "/tmp/nx_debt_recurrence_gate"
18const RG_F1: *u8 = "/tmp/nx_debt_recurrence_gate/f1.plane"
19const RG_F2: *u8 = "/tmp/nx_debt_recurrence_gate/f2.plane"
20const RG_F3: *u8 = "/tmp/nx_debt_recurrence_gate/f3.plane"
21const RG_F4: *u8 = "/tmp/nx_debt_recurrence_gate/f4.plane"
22const RG_F1_SPINE: *u8 = "/tmp/nx_debt_recurrence_gate/f1.plane.recurrence.spine"
23const RG_MODE_RWX: i64 = 493
24const RG_MODE_RW: i64 = 420
25const RG_LINE: i64 = 512
26const RG_DOC: i64 = 65536
27const RG_TAB: i64 = 9
28const RG_NOW: i64 = 1788676000
29const RG_TOPN: i64 = 20
31const RG_ALPHA_PRIOR: i64 = 100
32const RG_ALPHA_RECUR: i64 = 200
33const RG_ALPHA_AGAIN: i64 = 500
34const RG_GAMMA_PRIOR: i64 = 300
35const RG_F1_ROWS: i64 = 6
36const RG_F1_SCOPES: i64 = 3
39const RG_F4_SCOPES: i64 = 300
40const RG_F4_ID0: i64 = 1000
41const RG_F4_BURST_ID: i64 = 2000
42const RG_F4_BURST_ROWS: i64 = 2
43const RG_OLD_TABLE_BOUND: i64 = 256
45const RG_M_ST: i64 = 0
46const RG_M_IDS: i64 = 1
47const RG_M_Q: i64 = 2
48const RG_M_N: i64 = 3
49const RG_M_CAP: i64 = 4
50const RG_M_SLOTS: i64 = 8

functions

52func rg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
53func rg_w(fd: i64, s: *u8) -> i64 { return sys_write(fd, s, rg_slen(s)) }
called by 2: rg_rowrg_base calls 2: sys_writerg_slen
54func rg_tab(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = RG_TAB as u8; return sys_write(fd, b, 1) }
called by 1: rg_row calls 2: sys_mmapsys_write
55func rg_nl(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = DRC_NL as u8; return sys_write(fd, b, 1) }
called by 2: rg_rowrg_base calls 2: sys_mmapsys_write
56func rg_n(fd: i64, v: i64) -> i64 { let b: *u8 = sys_mmap(RG_LINE); let o: i64 = sj_catn(b, 0, v); return sys_write(fd, b, o) }
called by 1: rg_row calls 3: sys_mmapsj_catnsys_write
58func rg_row(fd: i64, id: i64, sev: i64, scope: *u8, status: *u8, desc: *u8) -> i64
62func rg_open(path: *u8) -> i64 { sys_unlinkat(path); return sys_openat_wr(path, RG_MODE_RW) }
called by 1: main calls 2: sys_unlinkatsys_openat_wr
64func rg_base(fd: i64, alpha_second_status: *u8) -> i64
called by 1: main calls 3: rg_rowrg_wrg_nl
75func rg_f4(fd: i64) -> i64
called by 1: main calls 3: sys_mmapsj_catnrg_row
90func rg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
91func rg_size(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 - 1 } let s: i64 = sys_lseek(fd, 0, 2); sys_close(fd); return s }
92func rg_lines(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
101func rg_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: rg_slen
110func rg_measure(path: *u8, m: *i64, r: *i64) -> i64
124func rg_scope_slot(q: *u8, st: *i64, nsc: i64, name: *u8) -> i64
called by 1: main calls 1: rg_slen
139func main(argc: i64, argv: *i64) -> i64