nx_debt_recurrence_gate.nx
buildroot/runtime/nx_debt_recurrence_gate.nx
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
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
structs
| none |
consts
| 17 | const RG_ROOT: *u8 = "/tmp/nx_debt_recurrence_gate" |
| 18 | const RG_F1: *u8 = "/tmp/nx_debt_recurrence_gate/f1.plane" |
| 19 | const RG_F2: *u8 = "/tmp/nx_debt_recurrence_gate/f2.plane" |
| 20 | const RG_F3: *u8 = "/tmp/nx_debt_recurrence_gate/f3.plane" |
| 21 | const RG_F4: *u8 = "/tmp/nx_debt_recurrence_gate/f4.plane" |
| 22 | const RG_F1_SPINE: *u8 = "/tmp/nx_debt_recurrence_gate/f1.plane.recurrence.spine" |
| 23 | const RG_MODE_RWX: i64 = 493 |
| 24 | const RG_MODE_RW: i64 = 420 |
| 25 | const RG_LINE: i64 = 512 |
| 26 | const RG_DOC: i64 = 65536 |
| 27 | const RG_TAB: i64 = 9 |
| 28 | const RG_NOW: i64 = 1788676000 |
| 29 | const RG_TOPN: i64 = 20 |
| 31 | const RG_ALPHA_PRIOR: i64 = 100 |
| 32 | const RG_ALPHA_RECUR: i64 = 200 |
| 33 | const RG_ALPHA_AGAIN: i64 = 500 |
| 34 | const RG_GAMMA_PRIOR: i64 = 300 |
| 35 | const RG_F1_ROWS: i64 = 6 |
| 36 | const RG_F1_SCOPES: i64 = 3 |
| 39 | const RG_F4_SCOPES: i64 = 300 |
| 40 | const RG_F4_ID0: i64 = 1000 |
| 41 | const RG_F4_BURST_ID: i64 = 2000 |
| 42 | const RG_F4_BURST_ROWS: i64 = 2 |
| 43 | const RG_OLD_TABLE_BOUND: i64 = 256 |
| 45 | const RG_M_ST: i64 = 0 |
| 46 | const RG_M_IDS: i64 = 1 |
| 47 | const RG_M_Q: i64 = 2 |
| 48 | const RG_M_N: i64 = 3 |
| 49 | const RG_M_CAP: i64 = 4 |
| 50 | const RG_M_SLOTS: i64 = 8 |
functions
| 52 | func rg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 53 | func rg_w(fd: i64, s: *u8) -> i64 { return sys_write(fd, s, rg_slen(s)) } |
| 54 | func rg_tab(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = RG_TAB as u8; return sys_write(fd, b, 1) } |
| 55 | func rg_nl(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = DRC_NL as u8; return sys_write(fd, b, 1) } |
| 56 | func 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) } |
| 58 | func rg_row(fd: i64, id: i64, sev: i64, scope: *u8, status: *u8, desc: *u8) -> i64 |
| 62 | func rg_open(path: *u8) -> i64 { sys_unlinkat(path); return sys_openat_wr(path, RG_MODE_RW) } |
| 64 | func rg_base(fd: i64, alpha_second_status: *u8) -> i64 |
| 75 | func rg_f4(fd: i64) -> i64 |
| 90 | func rg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 91 | func 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 } |
| 92 | func rg_lines(path: *u8) -> i64 |
| 101 | func rg_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 110 | func rg_measure(path: *u8, m: *i64, r: *i64) -> i64 |
| 124 | func rg_scope_slot(q: *u8, st: *i64, nsc: i64, name: *u8) -> i64 |
| 139 | func main(argc: i64, argv: *i64) -> i64 |