code wiki / (root) / nx_ladder_lib.nx

nx_ladder_lib.nx

buildroot/runtime/nx_ladder_lib.nx

19026 B388 linesdepth 4pulls 5 transitivereach 127 importersview sourcekind librarytopic ladder
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_barfresh_lib.nx nx_ladder_lib.nx nx_compare_rank.nx nx_compare_rank_artifact_20260910. nx_compare_rank_refresh_test_20260 nx_compare_shared_fit_lib_20260910 nx_ladder.nx nx_ladder_gate.nx nx_lbclimb.nx nx_lbclimb_gate.nx nx_lbclimb_lib.nx nx_measurement_binding_lib.nx

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

40const LD_TARGET_TAG: *u8 = "sotatarget|"
41const LD_LADDER_TAG: *u8 = "rungrole|"
42const LD_RUNG_TAG: *u8 = "rung|"
43const LD_CLASS_BIC: *u8 = "best-in-class"
44const LD_CLASS_FRONTIER: *u8 = "frontier"
45const LD_ROLE_SUBSTRATE: *u8 = "substrate"
46const LD_ROLE_ARM: *u8 = "arm"
47const LD_ROLE_CONTENDER: *u8 = "contender"
48const LD_ROLE_SUPERSEDED: *u8 = "superseded"
49const LD_I64: i64 = 8
51const LD_F_T_ID: i64 = 1
52const LD_F_T_CLASS: i64 = 2
53const LD_F_T_BAR: i64 = 3
54const LD_F_T_STATEMENT: i64 = 4
55const LD_F_T_REF: i64 = 5
56const LD_F_L_RUNG: i64 = 1
57const LD_F_L_ROLE: i64 = 2
58const LD_F_L_TARGET: i64 = 3
59const LD_F_L_WHY: i64 = 4
60const LD_F_R_ID: i64 = 1
61const LD_F_R_TITLE: i64 = 2
62const LD_F_R_DEPS: i64 = 7
64const LD_C_BIC: i64 = 0
65const LD_C_FRONTIER: i64 = 1
66const LD_C_BADCLASS: i64 = 2
68const LD_R_SUBSTRATE: i64 = 0
69const LD_R_ARM: i64 = 1
70const LD_R_CONTENDER: i64 = 2
71const LD_R_SUPERSEDED: i64 = 3
72const LD_R_BADROLE: i64 = 4
74const LD_P_PLACED: i64 = 0
75const LD_P_UNPLACED: i64 = 1
76const LD_P_BADROLE: i64 = 2
77const LD_P_BADTARGET: i64 = 3
79const LD_T_DATED: i64 = 0
80const LD_T_UNDATED: i64 = 1
81const LD_T_BADCLASS: i64 = 2
82const LD_T_DUPLICATE: i64 = 3
84const LD_EXIT_LADDERED: i64 = 0
85const LD_EXIT_PARTIAL: i64 = 1
86const LD_EXIT_NOLADDER: i64 = 3
88const LD_N_TARGETS: i64 = 0
89const LD_N_BIC: i64 = 1
90const LD_N_FRONTIER: i64 = 2
91const LD_N_UNDATED: i64 = 3
92const LD_N_BADCLASS: i64 = 4
93const LD_N_RUNGS: i64 = 5
94const LD_N_PLACED: i64 = 6
95const LD_N_UNPLACED: i64 = 7
96const LD_N_BADROLE: i64 = 8
97const LD_N_BADTARGET: i64 = 9
98const LD_N_SUBSTRATE: i64 = 10
99const LD_N_ARM: i64 = 11
100const LD_N_CONTENDER: i64 = 12
101const LD_N_SUPERSEDED: i64 = 13
102const LD_N_LADDER_ROWS: i64 = 14
103const LD_N_ORPHANS: i64 = 15
107const LD_N_UNCLIMBED: i64 = 16
108const LD_N_DUPTARGET: i64 = 17 // sotatarget rows whose id an earlier row already carries (state DUPLICATE)
109const LD_N_DUPROLE: i64 = 18 // rungrole rows for a rung an earlier rungrole row already placed
110const LD_N_COUNT: i64 = 19
111const LD_NONE: i64 = 0 - 1

functions

114func ld_span_is(buf: *u8, off: i64, len: i64, lit: *u8) -> i64
121func ld_class_code(buf: *u8, off: i64, len: i64) -> i64
called by 1: ld_classify calls 1: ld_span_is
127func ld_role_code(buf: *u8, off: i64, len: i64) -> i64
called by 1: ld_classify calls 1: ld_span_is
135func ld_role_name(r: i64) -> *u8
called by 1: ldc_report
143func ld_class_name(k: i64) -> *u8
called by 1: ldc_report
149func ld_place_name(p: i64) -> *u8
called by 1: ldc_report
156func ld_tstate_name(t: i64) -> *u8
called by 1: ldc_report
163func ld_verdict_name(v: i64) -> *u8
170func ld_bar_exists(buf: *u8, n: i64, idoff: i64, idlen: i64) -> i64
187func ld_classify(buf: *u8, n: i64, toff: *i64, tcls: *i64, tst: *i64, roff: *i64, rrole: *i64, rtgt: *i64, rst: *i64, c: *i64) -> i64
311func ld_partition_sum(c: *i64) -> i64
315func ld_role_sum(c: *i64) -> i64
called by 1: main
339func ld_target_climbers(nt: i64, nr: i64, rtgt: *i64, rst: *i64, tclimb: *i64, c: *i64) -> i64
called by 1: ldc_report
358func ld_verdict(c: *i64) -> i64
376func ld_refusal_rule(c: *i64) -> *u8
called by 3: mainldc_reportmain