nx_ladder_lib.nx
buildroot/runtime/nx_ladder_lib.nx
about
nx_ladder_lib.nx -- THE ONE RULER FOR A BOARD'S LADDER TO SOTA: every rung says what it is FOR, and the board says
what best-in-class and the frontier ARE, dated.
Operator 2026-09-06, after a day spent climbing toward a 2014 bar: "how you framed it here is how all the /compare
domains should be emitting with clarity on what dependencies from the first byte up all grow us each rung up to sota
with a clear target on what is best in class and what is frontier." The framing that answered "how much of the 2014
work applies to the 2026 stuff" was a role per rung (the ruler and the syntax tools are SUBSTRATE the frontier itself
uses; the perceptron is a triangulation ARM, not the contender; the target was SUPERSEDED) against two named, dated
targets. This lib makes that framing DATA every board carries and every consumer reads, instead of prose one seat
wrote once.
THE DATA (rows in <domain>.plan, pipe-separated, NO pipe inside a field):
sotatarget|<id>|<class>|<sotabar-id>|<statement>|<ref key>
class is best-in-class (the proven, deployed leader today) or frontier (the research edge, current month);
<sotabar-id> names the sotabar| row that DATES it (nx_barfresh_lib judges that month), so a target without a
bar is UNDATED -- the exact defect that cost the day.
rungrole|<rung-id>|<role>|<target-id>|<why>
role is substrate (infrastructure the target's own methods consume: data, rulers, syntax tools, arithmetic),
arm (a sovereign arm that triangulates or baselines the target without competing for its number),
contender (a rung whose done-rule is a number against the target's) or superseded (kept as capability, retired
as a claim). Dependencies come from the rung| row's own deps field; this row adds the DIRECTION.
THE STATES: per target DATED (its bar row exists), UNDATED, BADCLASS, DUPLICATE (its id an earlier sotatarget row
already carries: one target declared twice); per rung PLACED, UNPLACED (no rungrole row), BADROLE, BADTARGET (its
rungrole row names a target no sotatarget row declares); rungrole rows naming no rung are ORPHANS, and a rungrole row
for a rung an earlier rungrole row already placed is a DUPLICATE ROLE (counted apart from orphans, refused alike).
MEASURED 2026-09-14 on search.plan: two sotatarget rows for one bar and one rung id used twice landed across a
transport drop, and only the rung id was refused (the plan-graph rule); ld_refusal_rule names WHICH rule refused so a
consumer prints it from this lib instead of paraphrasing.
THE VERDICT: NO-LADDER (exit 3) when the plan declares no target rows -- a domain opts in by declaring its first target
and is LABELED until then, never refused; LADDERED (exit 0) when both classes are declared and dated and every rung is
placed; PARTIAL (exit 1) otherwise, with every offender named -- a half-declared ladder is the "12-year-old tech"
shape (a target without a month, a rung with no direction), so once a board opts in it is held to the whole contract.
COMPOSES nx_barfresh_lib's line and field readers (one parser for plan rows) and its sotabar tag; classifies only.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 20 importers
diagram shows first 10 each side; +0 more imports, +10 more importers in the complete lists below.
imports: nx_syscalls.nxnx_barfresh_lib.nx
imported by: nx_compare_rank.nxnx_compare_rank_artifact_20260910.nxnx_compare_rank_refresh_test_20260907.nxnx_compare_shared_fit_lib_20260910.nxnx_ladder.nxnx_ladder_gate.nxnx_lbclimb.nxnx_lbclimb_gate.nxnx_lbclimb_lib.nxnx_measurement_binding_lib.nxnx_swcompare_evidence_lib_t138.nxnx_swcompare_growth_candidate_20260910.nxnx_swcompare_heading_lib_20260907.nxnx_swcompare_ladder_candidate.nxnx_swcompare_lib.nxnx_swcompare_preview_lib_t56.nxnx_swcompare_production_lib_20260907.nxnx_swcompare_release_candidate.nxnx_workmix.nxnx_workmix_lib.nx
structs
| none |
consts
| 40 | const LD_TARGET_TAG: *u8 = "sotatarget|" |
| 41 | const LD_LADDER_TAG: *u8 = "rungrole|" |
| 42 | const LD_RUNG_TAG: *u8 = "rung|" |
| 43 | const LD_CLASS_BIC: *u8 = "best-in-class" |
| 44 | const LD_CLASS_FRONTIER: *u8 = "frontier" |
| 45 | const LD_ROLE_SUBSTRATE: *u8 = "substrate" |
| 46 | const LD_ROLE_ARM: *u8 = "arm" |
| 47 | const LD_ROLE_CONTENDER: *u8 = "contender" |
| 48 | const LD_ROLE_SUPERSEDED: *u8 = "superseded" |
| 49 | const LD_I64: i64 = 8 |
| 51 | const LD_F_T_ID: i64 = 1 |
| 52 | const LD_F_T_CLASS: i64 = 2 |
| 53 | const LD_F_T_BAR: i64 = 3 |
| 54 | const LD_F_T_STATEMENT: i64 = 4 |
| 55 | const LD_F_T_REF: i64 = 5 |
| 56 | const LD_F_L_RUNG: i64 = 1 |
| 57 | const LD_F_L_ROLE: i64 = 2 |
| 58 | const LD_F_L_TARGET: i64 = 3 |
| 59 | const LD_F_L_WHY: i64 = 4 |
| 60 | const LD_F_R_ID: i64 = 1 |
| 61 | const LD_F_R_TITLE: i64 = 2 |
| 62 | const LD_F_R_DEPS: i64 = 7 |
| 64 | const LD_C_BIC: i64 = 0 |
| 65 | const LD_C_FRONTIER: i64 = 1 |
| 66 | const LD_C_BADCLASS: i64 = 2 |
| 68 | const LD_R_SUBSTRATE: i64 = 0 |
| 69 | const LD_R_ARM: i64 = 1 |
| 70 | const LD_R_CONTENDER: i64 = 2 |
| 71 | const LD_R_SUPERSEDED: i64 = 3 |
| 72 | const LD_R_BADROLE: i64 = 4 |
| 74 | const LD_P_PLACED: i64 = 0 |
| 75 | const LD_P_UNPLACED: i64 = 1 |
| 76 | const LD_P_BADROLE: i64 = 2 |
| 77 | const LD_P_BADTARGET: i64 = 3 |
| 79 | const LD_T_DATED: i64 = 0 |
| 80 | const LD_T_UNDATED: i64 = 1 |
| 81 | const LD_T_BADCLASS: i64 = 2 |
| 82 | const LD_T_DUPLICATE: i64 = 3 |
| 84 | const LD_EXIT_LADDERED: i64 = 0 |
| 85 | const LD_EXIT_PARTIAL: i64 = 1 |
| 86 | const LD_EXIT_NOLADDER: i64 = 3 |
| 88 | const LD_N_TARGETS: i64 = 0 |
| 89 | const LD_N_BIC: i64 = 1 |
| 90 | const LD_N_FRONTIER: i64 = 2 |
| 91 | const LD_N_UNDATED: i64 = 3 |
| 92 | const LD_N_BADCLASS: i64 = 4 |
| 93 | const LD_N_RUNGS: i64 = 5 |
| 94 | const LD_N_PLACED: i64 = 6 |
| 95 | const LD_N_UNPLACED: i64 = 7 |
| 96 | const LD_N_BADROLE: i64 = 8 |
| 97 | const LD_N_BADTARGET: i64 = 9 |
| 98 | const LD_N_SUBSTRATE: i64 = 10 |
| 99 | const LD_N_ARM: i64 = 11 |
| 100 | const LD_N_CONTENDER: i64 = 12 |
| 101 | const LD_N_SUPERSEDED: i64 = 13 |
| 102 | const LD_N_LADDER_ROWS: i64 = 14 |
| 103 | const LD_N_ORPHANS: i64 = 15 |
| 107 | const LD_N_UNCLIMBED: i64 = 16 |
| 108 | const LD_N_DUPTARGET: i64 = 17 // sotatarget rows whose id an earlier row already carries (state DUPLICATE) |
| 109 | const LD_N_DUPROLE: i64 = 18 // rungrole rows for a rung an earlier rungrole row already placed |
| 110 | const LD_N_COUNT: i64 = 19 |
| 111 | const LD_NONE: i64 = 0 - 1 |
functions
| 114 | func ld_span_is(buf: *u8, off: i64, len: i64, lit: *u8) -> i64 |
| 121 | func ld_class_code(buf: *u8, off: i64, len: i64) -> i64 |
| 127 | func ld_role_code(buf: *u8, off: i64, len: i64) -> i64 |
| 135 | func ld_role_name(r: i64) -> *u8 called by 1: ldc_report |
| 143 | func ld_class_name(k: i64) -> *u8 called by 1: ldc_report |
| 149 | func ld_place_name(p: i64) -> *u8 called by 1: ldc_report |
| 156 | func ld_tstate_name(t: i64) -> *u8 called by 1: ldc_report |
| 163 | func ld_verdict_name(v: i64) -> *u8 |
| 170 | func ld_bar_exists(buf: *u8, n: i64, idoff: i64, idlen: i64) -> i64 |
| 187 | func ld_classify(buf: *u8, n: i64, toff: *i64, tcls: *i64, tst: *i64, roff: *i64, rrole: *i64, rtgt: *i64, rst: *i64, c: *i64) -> i64 called by 15: mainmainmainplan_pass_headingldc_reportg_run+9 calls 9: sys_mmapbf_count_rowsbf_line_endbf_line_startsbf_fieldld_class_code+3 |
| 311 | func ld_partition_sum(c: *i64) -> i64 |
| 315 | func ld_role_sum(c: *i64) -> i64 called by 1: main |
| 339 | func ld_target_climbers(nt: i64, nr: i64, rtgt: *i64, rst: *i64, tclimb: *i64, c: *i64) -> i64 called by 1: ldc_report |
| 358 | func ld_verdict(c: *i64) -> i64 |
| 376 | func ld_refusal_rule(c: *i64) -> *u8 |