code wiki / (root) / nx_compare_rank_caps_gate.nx

nx_compare_rank_caps_gate.nx

buildroot/runtime/nx_compare_rank_caps_gate.nx

28990 B502 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic compare
docsdependenciesstructsconstsfunctions

about

nx_compare_rank_caps_gate.nx -- GATE for the ranker's POPULATION HONESTY (lane F, 2026-08-23). THE DEFECT THIS GUARDS: nx_compare_rank carried RANK_MAX_ROWS=64 / RANK_MAX_RUNGS=64 / RANK_FIELD_MAX=24 / 8 versions / 16 milestones as silent caps. browser.matrix has 76 rows, so every row past 64 was invisible and its rung read UNMAPPED (value 0) while its watch row existed. A ranker that drops the tail of its own population publishes a prefix as the whole order. Every bound is now DERIVED from the loaded bytes; this gate proves the derivation by driving the subject binary over synthetic domains that EXCEED every former cap, over the real browser and toolchain domains, and against INDEPENDENT counts the gate takes itself from the same files (rung| lines, matrix data rows, symbol->row mapping). FIXTURE ROOT: /tmp/nxrkcap_<pid>/ (reaped by the tmpstorereap beat; nothing in it is EXECUTED from /tmp -- the subject and the forks it makes are reached through symlinks/absolute paths into the exec-capable serving root, and noexec binds to the executed file's mount, not the CWD). It carries its OWN buildroot/knowledge/compare/ (synthetic + copied real domains), its own buildroot/fx/ organ, a symlink buildroot/runtime -> the real runtime (rk_measure reads organ sources there), and symlinks to the real nx_dr_ocm_cli / nx_store_put / nx_pm_intake elfs. The subject is run with CWD = the fixture root, so every plane it publishes and every pm-intake ask it files lands INSIDE the fixture, never in the estate's planes. Falls back to _build/nxrkcap_<pid>/ only if /tmp cannot be created. Usage: nx_compare_rank_caps_gate [subject_elf] (default ./nx_compare_rank.elf; CWD = serving root) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_compare_rank_caps_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

structs

none

consts

26const RKC_FORMER_CAP: i64 = 64 // the cap this gate retires (RANK_MAX_RUNGS/ROWS); used ONLY to assert that a
28const RKC_SYN_RUNGS: i64 = 70 // > the former 64-rung cap; the synthetic plan has this many rung| rows
29const RKC_SYN_EXTRA_ROWS: i64 = 9 // matrix rows beyond the rungs' own (header-like noise rows), so rows=79 > 64
30const RKC_SYN_COLS: i64 = 20 // rival columns on the wide matrix: 9 + 20 fields > the former 24-field cap
31const RKC_SYN_VERS: i64 = 9 // > the former 8-version cap; versions 1..8 met, the 9th unmet
32const RKC_SYN_MS: i64 = 18 // > the former 16-milestone cap (RKC_SYN_VERS of them referenced by ver| rows)
33const RKC_SYN_PRESENT_A: i64 = 3 // rung index whose symbol the fx organ DEFINES (measured present)
34const RKC_SYN_PRESENT_B: i64 = 68 // a second present symbol, PAST the former cap
35const RKC_SYN_NOROW: i64 = 66 // a rung past the former cap with NO matrix row at all: must read UNMAPPED
36const RKC_CAPTURE: i64 = 1048576 // captured stdout of one subject run (a pipe, size unknowable): named for
38const RKC_PATH: i64 = 1024 // one composed fixture path (root <= getcwd + 32 + names <= 64 each)
39const RKC_MODE_X: i64 = 0x1ed
40const RKC_MODE_RW: i64 = 0x1a4

functions

42func rc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: rc_countrc_field
43func rc_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var oo: i64 = o; while s[i] != (0 as u8) { d[oo] = s[i]; oo = oo + 1; i = i + 1 } d[oo] = 0 as u8; return oo }
called by 1: rc_write_synthetic
44func rc_catn(d: *u8, o: i64, v: i64) -> i64
called by 1: rc_write_synthetic calls 1: sys_mmap
58func rc_starts(s: *u8, p: *u8) -> i64 { var i: i64 = 0; while p[i] != (0 as u8) { if s[i] != p[i] { return 0 } i = i + 1 } return 1 }
called by 1: rc_census
59func rc_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 }
61func rc_count(hay: *u8, n: i64, needle: *u8) -> i64
calls 1: rc_slen
77func rc_field(hay: *u8, n: i64, key: *u8) -> i64
calls 1: rc_slen
106func rc_eol(b: *u8, n: i64, p: i64) -> i64
called by 1: rc_census
112func rc_write_file(path: *u8, b: *u8, n: i64) -> i64
121func rc_copy(src: *u8, dst: *u8) -> i64
128func rc_run_subject(subject: *u8, dom: *u8, out: *u8, outlen: *i64) -> i64
140func rc_census(plan: *u8, matrix: *u8, out: *i64) -> i64
256func rc_write_synthetic(root: *u8, dom: *u8) -> i64
333func rc_mk(root: *u8, sub: *u8) -> i64
345func rc_copy_domain(cwd: *u8, root: *u8, dom: *u8) -> i64
359func main(argc: i64, argv: *i64) -> i64