code wiki / _hdl_build / nx_compare_rank_artifact_20260910.nx

nx_compare_rank_artifact_20260910.nx

buildroot/runtime/_hdl_build/nx_compare_rank_artifact_20260910.nx

82310 B1226 linesdepth 10pulls 54 transitivereach 0 importersview sourcekind tooltopic compare
docsdependenciesstructsconstsfunctions

about

nx_compare_rank.nx -- THE ROADMAP RANKER: priority computed from the boards, never chosen by a seat. Operator 2026-08-18: "we need sota best of breed prioritization and ranking from the foundation first bit up in our compares to drive our roadmaps ... it needs to push back on your random doing of low priorities" and "we cant keep having you do random shit and say its effective". A seat picking rungs by whatever is cheapest with parts in-tree is the defect; this organ makes the compare COMPUTE the order from data the boards already carry and PUBLISH it where every seat, MCP caller and RACI row reads it. It decides nothing itself: the math is nx_dr_ocm (DR-6 opportunity-cost ranker, Priority=(V*M)/C, integer deterministic -- REGISTERED-DARK until today, adopted here) and the plane write is nx_store_put; this organ only DERIVES the three inputs per open rung, all from data: THE MATHEMATICS (v5, 2026-08-18 -- operator: "a full mathematical system on opportunity cost, clustering, foundation-up capabilities, best-of-breed research as of August 2026", not a seat's coefficients). Every term is COUNTED or a RATIO of board data; the only chosen constant left is RANK_COST_UNKNOWN and it fires only on a plan row that declared no cost (a labeled data defect). value v = deficit + CoD + option + enables (all from matrix codes + dep rows) deficit = sum of rival codes on the rung's row (2 leads, 1 present, 0 absent): value at stake CoD = deficit x (rivals LEADING / rivals total): WSJF cost-of-delay -- the fraction of the field already ahead is the time-criticality; every unit open, that many rivals widen it option = 1, ONLY when every rival is absent: the lead itself, held by nobody -- its unlocking value is already the enables leg below (one leg each; a v5 draft double-charged it) enables = number of OTHER open rungs whose transitive dependency closure contains this rung: the foundation-first / opportunity-enablement leg (WSJF) and the compound-option leg (real-options portfolio theory), counted from dep rows momentum m = 1 + declared dependencies already MEASURED present (substrate landed; never 0 because nx_dr_ocm multiplies and a zero would hide the rung) cost c = the plan's own est u in tenths, DIVIDED by the rung's cluster size (open rungs sharing the same organ file share substrate: read once, one build lane, one gate to extend -- graph clustering on the organ column, measured never labelled); unestimated -> labeled sponsor = the operator's sponsor- plane coefficient (PR6), applied to value, every firing row named priority = nx_dr_ocm( v x sponsor, m, c ) = (V x M x 1000)/C with forgone-best-alternative and budget-aware greedy selection (DR-6, integer deterministic) critical path: the FIRST unmet product version's milestone rungs + transitive open deps rank before everything else (ver| rows) -- staged delivery 0.1 -> 1.0 -> 2.0. Provenance: WSJF/cost-of-delay (SAFe LPM), real-options R&D portfolio valuation with project interdependencies (Blau et al.; OptFolio-class DSS), integer-programming portfolio selection under budget (knapsack form -- dr_ocm's greedy is the bounded-effort stand-in), dependency-graph enablement. pmdash.refs carries the citations. What is NOT here, honestly: uncertainty distributions (PTRS-style success probabilities per rung) -- the estate has no measured per-rung success rate yet; PR7's actuals-write-back is the data that makes that term possible, and it will be added when the data

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_catalog_lib.nx nx_symdecl_lib.nx nx_barfresh_lib.nx nx_ladder_lib.nx nx_swcompare_lib.nx nx_compare_rank_artifact_20260

imports: nx_syscalls.nxnx_tool_run.nxnx_catalog_lib.nxnx_symdecl_lib.nxnx_barfresh_lib.nxnx_ladder_lib.nxnx_swcompare_lib.nx

imported by: nobody (leaf or entry point)

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

main rk_puts sys_write rk_slen sg_id rk_slen ↻ rk_streq rk_int 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 ↻ rk_cat rk_read_all sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sg_parse sys_mmap ↻ sg_sha sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init

structs

none

consts

65const RANK_EXIT_BAR_STALE: i64 = 5 // a declared bar older than the current month with no this-month attestation: the board hands out no work
66const RANK_EXIT_LADDER_PARTIAL: i64 = 6 // a declared ladder to SOTA left half-declared (an undated target, a rung with no role): refused the same way
77const RK_DEC_MAX: i64 = 20 // max decimal digits of an i64 (19) plus a sign: the width of one
79const RK_NUMBUF: i64 = RK_DEC_MAX + 4 // one number rendered to text + NUL + slack for the '-' and terminator
82const RANK_COST_UNKNOWN: i64 = 100 // 10.0 u: an unestimated rung is treated as EXPENSIVE, labeled --
85const RANK_DEFAULT_BUDGET: i64 = 300 // 30.0 u -- above every plan's full-parity figure, so the greedy
88const RANK_STORE_FIELDS: i64 = 8
97const RK_NOTE_LITERALS: i64 = 531
98const RK_NOTE_NUMS: i64 = 13
99const RK_SPONSOR_ROW_LITERALS: i64 = 11
100const RANK_FORK_CAP: i64 = 4096 // captured stdout of one nx_store_put / nx_pm_intake fork: their
106const RK_OCM_OBJ_BYTES: i64 = 89 + 8 * RK_DEC_MAX
107const RK_OCM_HDR_BYTES: i64 = 195 + 5 * RK_DEC_MAX + 16
114const RANK_FIX_PER_RUNG: i64 = 64 + 10 * RK_DEC_MAX // row skeleton: kind, pipes, numbers, newline
119const RANK_UNMAPPED_ROW: i64 = 48
123const RANK_FIX_TAIL: i64 = 512 // the stamped last line + the unmapped count line
124const RANK_PM_TOP: i64 = 3 // critical rungs filed into pm intake per run: enough to drive
255const SPONSOR_BASE: i64 = 4 // plus2 = +50%, plus1 = +25%, minus1 = -25%, minus2 = -50%
256const SPONSOR_PLANE_CAP: i64 = 262144
355const SELFSUFF_BASE: i64 = 4
356const SELFSUFF_FLOOR: i64 = 1
357const SELFSUFF_PEN_CAP: i64 = SELFSUFF_BASE - SELFSUFF_FLOOR

functions

127func rk_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
128func rk_puts(s: *u8) -> i64 { sys_write(1, s, rk_slen(s)); return 0 }
called by 2: rk_write_rankmain calls 2: sys_writerk_slen
129func rk_pn(v: i64) -> i64
called by 2: rk_write_rankmain calls 2: sys_mmapsys_write
141func rk_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 }
142func rk_catn(d: *u8, o: i64, v: i64) -> i64
152func rk_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 }
153func rk_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 }
158func rk_read_all(path: *u8, outb: *i64) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
166func rk_lines(b: *u8, n: i64) -> i64
called by 1: main
173func rk_max_pipes(b: *u8, n: i64) -> i64
called by 1: main
185func rk_split(s: *u8, fld: *i64, maxf: i64) -> i64
called by 1: main
191func rk_tenths(s: *u8) -> i64
called by 1: main
205func rk_int(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v }
called by 1: main
207func rk_sym_is(rowsym: *u8, sym: *u8) -> i64
called by 1: main calls 2: rk_streqrk_starts
218func rk_measure(org: *u8, sym: *u8) -> i64
235func rk_dark(org: *u8, sym: *u8) -> i64
257func rk_has(hay: *u8, needle: *u8) -> i64
called by 1: rk_sponsor_term calls 1: rk_slen
270func rk_sponsor_term(plane: *u8, plen: i64, dom: *u8, rid1: *u8, sym: *u8, nb: *u8, no0: i64, noOut: *i64) -> i64
362func rk_ss_eqf(b: *u8, s: i64, e: i64, lit: *u8) -> i64
called by 1: rk_selfsuff_term
374func rk_ss_atoi(b: *u8, s: i64, e: i64) -> i64
called by 1: rk_selfsuff_term
389func rk_selfsuff_term(led: *u8, ln: i64, dom: *u8, org: *u8, nb: *u8, no0: i64, noOut: *i64) -> i64
445func rk_list_one(idstr: *u8, mode: i64, rid: *i64, nr: i64, rdone: *i64, crit: *i64) -> i64
called by 1: rk_list_scan calls 1: rk_streq
459func rk_list_scan(ls: *u8, mode: i64, rid: *i64, nr: i64, rdone: *i64, crit: *i64) -> i64
called by 1: main calls 3: sys_mmaprk_slenrk_list_one
480func rk_write_rank(dom: *u8, buf: *u8, n0: i64, nr: i64, ndone: i64, nopen: i64, nfinish: i64, tgt: i64, vlab: *i64) -> i64
510func qcap_stage_max(vlab: *i64, nver: i64) -> i64
called by 1: main calls 1: rk_slen
517func main(argc: i64, argv: *i64) -> i64