code wiki / _hdl_build / nx_compare_rank_gate.nx

nx_compare_rank_gate.nx

buildroot/runtime/_hdl_build/nx_compare_rank_gate.nx

27438 B489 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic compare
docsdependenciesstructsconstsfunctions

about

nx_compare_rank_gate.nx -- THE LIAR-KILLER ON THE RANKER (operator 2026-08-18: "validate it ... if some stupid shit like your made up magic numbers come into the system or any other stupid blockers happen the team can overcome the blocker ... a liar killer extraordinaire ... not allowing you to build shitty clay and polish it and call it sota"). A ranker that cannot be refused is another authoritative number nobody audits. This gate makes every failure class the operator named UNPASSABLE in silence, and every RED prints the UNBLOCK ACTION so a team member acts without the seat that caused it: T1 NO CHOSEN COEFFICIENTS: nx_law_warden countfile on the ranker's own source must be 0 inline magic. A seat that smuggles a constant back in turns this RED before the ranking is trusted. T2 GRAPHICS VALIDATION: on the REAL graphics board the top critical-path rung must be the referee panel (cjc_panel) -- the pre-declared Phase-0 gate: nothing above it is measurable without it. A wrong first pick means the mathematics regressed. (Runs the live ranker on the live board.) T3 CLAY-POLISH REFUSAL: on the fixture, a rung whose row shows EVERY rival LEADING (the field is lapping us -- catch-up gap) must rank ABOVE an equal-cost rung nobody has (the exceed lane) -- polishing a lead while the field laps you on fundamentals is the clay-polish failure by name. (CoD makes this true: leading/rivals=1 doubles the value.) T4 DERIVATION FIRES: fixture rungs with est=- print UNESTIMATED; two rungs on one organ print cluster=2; enablement counts a dependency root ABOVE its dependents. Anti-vacuity: the derivation is proven to move numbers, not just to print names. T5 SPONSOR BITES BOTH WAYS: a minus2 sponsor row on the fixture domain LOWERS the affected rung's priority versus the run without it, and the run names the row -- a plane write that cannot move the number means the term is dead. neg-control-sponsor-absent = the run without the row. T6 THE RANKER COUNTS ITSELF: done + open == rungs on the summary line (partition sums), else RED. T7 SUMMARY CARRIES THE RULE: the published rule line names WSJF+real-options+dep-graph -- a ranker whose printed rule drifts from its header is a lie with a trusted byline. Fixture is assembled at RUNTIME (never checked in: a detector that scans source would find its own fixture). The ranker reads buildroot/knowledge/compare/<dom>.* by construction, so the fixture domain `rankgatefx` is written THERE and REMOVED at the end -- and it is harmless on any early-exit path: no regen.list row names it, so no page can ever emit it, and the fixture sponsor row is closed. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_gate_verdict.nx nx_compare_rank_gate.nx

imports: nx_syscalls.nxnx_tool_run.nxnx_gate_verdict.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_puts sys_write ↻ sys_mmap ↻ tr_run_capture_to tr_run_capture_tr tr_run_capture_core tr_run_capture_core_owned tr_run_capture_core_eviden sys_mmap_shared tr_clock_ms sys_munmap sys_pipe2 sys_fork sys_close sys_default_signal sys_bind_parent_lifetime sys_exit ↻ sys_setpgid tr_capture_redirect sys_chdir sys_close_inherited sys_execve tr_exec_failed

structs

none

consts

36const RG_CAP: i64 = 262144
37const RG_TIMEOUT_MS: i64 = 240000
38const RG_FX_DOM: *u8 = "rankgatefx"
39const RG_FX_PLAN: *u8 = "buildroot/knowledge/compare/rankgatefx.plan"
40const RG_FX_MATRIX: *u8 = "buildroot/knowledge/compare/rankgatefx.matrix"
41const RG_RANKER: *u8 = "./nx_compare_rank.elf"
42const RG_RANKER_BUILD: *u8 = "./buildroot/_build/nx_compare_rank.sov.elf"
43const RG_RANKER_STAGED: *u8 = "./nx_compare_rank.sov.elf.new"
45const RG_MODE_RW: i64 = 420
163const RGD_DIR: *u8 = "buildroot/knowledge/compare"
164const RGD_BASE: *u8 = "knowledge/status/rungid_dup.conf"
165const RGD_DBUF: i64 = 65536
166const RGD_MAXID: i64 = 1024
167const RGD_IDLEN: i64 = 24
168const RGD_DENT_NAME_OFF: i64 = 19 // getdents64: d_ino 8 + d_off 8 + d_reclen 2 + d_type 1
169const RGD_DENT_RECLEN_OFF: i64 = 16

functions

47func rg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
48func rg_has(hay: *u8, hlen: i64, needle: *u8) -> i64
called by 1: main calls 1: rg_slen
62func rg_find(hay: *u8, hlen: i64, needle: *u8, from: i64) -> i64
called by 3: rg_int_afterrg_rank_ofmain calls 1: rg_slen
75func rg_int_after(hay: *u8, hlen: i64, needle: *u8) -> i64
called by 2: rg_pri_ofmain calls 2: rg_findrg_slen
87func rg_pri_of(out: *u8, olen: i64, rid: *u8) -> i64
called by 1: main calls 2: sys_mmaprg_int_after
100func rg_rank_of(out: *u8, olen: i64, rid: *u8) -> i64
called by 1: main calls 2: sys_mmaprg_find
122func rg_write(path: *u8, body: *u8) -> i64
129func rg_run(dom: *u8, out: *u8, olen: *i64) -> i64
171func rgd_slen(a: *u8) -> i64 { var n: i64 = 0; while a[n] != (0 as u8) { n = n + 1 } return n }
called by 1: rgd_ends_plan
172func rgd_cat(d: *u8, p: i64, src: *u8) -> i64 { var i: i64 = 0; while src[i] != (0 as u8) { d[p + i] = src[i]; i = i + 1 } d[p + i] = 0 as u8; return p + i }
called by 2: rgd_scan_planmain
173func rgd_ends_plan(nm: *u8) -> i64
called by 1: rgd_fleet_in calls 1: rgd_slen
184func rgd_id_eq(tbl: *u8, k: i64, id: *u8, idn: i64) -> i64
called by 1: rgd_scan_plan
192func rgd_scan_plan(dirp: *u8, nm: *u8, rep: *u8, repos: *i64, repcap: i64) -> i64
256func rgd_fleet(rep: *u8, repcap: i64, files: *i64) -> i64 { return rgd_fleet_in(RGD_DIR, rep, repcap, files) }
259func rgd_fleet_in(dirp: *u8, rep: *u8, repcap: i64, files: *i64) -> i64
293func main(argc: i64, argv: *i64) -> i64