nx_lbclimb_lib.nx
buildroot/runtime/nx_lbclimb_lib.nx
about
nx_lbclimb_lib.nx -- THE ONE climb ruler (search R0d, ecosystem EC62, 2026-09-17): does a board's DECLARED ladder
reach the leader of the public leaderboard it names, and which rank does each declared gate reach?
WHY. The operator asked "what ladder do we need to climb to beat rank 1" and a seat answered by hand, staging the
rungs with accept numbers NO rung had pre-declared. The estate already held every input as DATA -- the leaderboard
rows (<dom>.leaderboard, nx_leaderboard_lib) and the dated targets and rung roles (<dom>.plan, nx_ladder_lib) -- and
lacked only the JOIN and one datum: the score each contender rung must reach on the board. This lib is that join.
climbboard|<board>|<sotatarget id>|<note> which leaderboard board measures which target
climbgate|<rung>|<board>|<floor>|<basis> the rung's accept floor on that board: a score (22.9), a single
dash (declared UNMEASURED) or the word leader (strictly above the
leader of the day, so the gate moves when the public board does)
The floor is never the last field, so a CRLF-terminated row parses (the trailing CR lands in the prose).
POPULATION: the rungs whose rungrole row says contender toward the board's target. PARTITION (the CLI prints it):
contenders = gated + ungated + nogate + badfloor. A climbgate row naming a rung outside that population is a STRAY:
counted, never voting (a gate planted on a substrate rung cannot make a ladder reach).
VERDICT: REACHES when at least one gated contender's floor is strictly above the leader; SHORT when numeric gates
exist and none clears the leader; NOGATES when no contender carries a numeric gate; NOBOARD when the leaderboard
holds no rival row for the board; BADTARGET when the climbboard row names no declared sotatarget. SHORT is the
forcing verdict: the declared ladder cannot reach the target whatever ships, so the board owes a rung whose gate does.
Pure over two buffers (plan, leaderboard): the gate drives it in-process; the CLI, the goal mapper and the emitter
compose it and never re-derive it.
license_tier: ORIGINAL. No hw writes (Rule 26).
dependencies 4 imports · 2 importers
imports: nx_syscalls.nxnx_barfresh_lib.nxnx_ladder_lib.nxnx_leaderboard_lib.nx
imported by: nx_lbclimb.nxnx_lbclimb_gate.nx
structs
| none |
consts
| 28 | const LBC_BOARD_TAG: *u8 = "climbboard|" |
| 29 | const LBC_GATE_TAG: *u8 = "climbgate|" |
| 30 | const LBC_F_B_BOARD: i64 = 1 |
| 31 | const LBC_F_B_TARGET: i64 = 2 |
| 32 | const LBC_F_G_RUNG: i64 = 1 |
| 33 | const LBC_F_G_BOARD: i64 = 2 |
| 34 | const LBC_F_G_FLOOR: i64 = 3 |
| 35 | const LBC_F_G_BASIS: i64 = 4 |
| 36 | const LBC_FLOOR_UNGATED: *u8 = "-" |
| 37 | const LBC_FLOOR_LEADER: *u8 = "leader" |
| 38 | const LBC_LEADER_STEP: i64 = 1 // one tenth of a point above the leader, in the x10 scale the boards print |
| 40 | const LBC_S_GATED: i64 = 0 |
| 41 | const LBC_S_UNGATED: i64 = 1 // a climbgate row whose floor is the dash: declared unmeasured |
| 42 | const LBC_S_NOGATE: i64 = 2 // no climbgate row for this board at all |
| 43 | const LBC_S_BADFLOOR: i64 = 3 // a floor that is neither a score, the dash nor the word leader |
| 45 | const LBC_V_REACHES: i64 = 0 |
| 46 | const LBC_V_SHORT: i64 = 1 |
| 47 | const LBC_V_NOGATES: i64 = 3 |
| 48 | const LBC_V_NOBOARD: i64 = 4 |
| 49 | const LBC_V_BADTARGET: i64 = 5 |
| 51 | const LBC_EXIT_REACHES: i64 = 0 |
| 52 | const LBC_EXIT_SHORT: i64 = 1 |
| 53 | const LBC_EXIT_ABSTAIN: i64 = 3 |
| 55 | const LBC_KF: i64 = 5 |
| 56 | const LBC_K_ROFF: i64 = 0 // line start of the rung row |
| 57 | const LBC_K_STATE: i64 = 1 |
| 58 | const LBC_K_FLOOR: i64 = 2 // floor x10, LBC_NONE when not gated |
| 59 | const LBC_K_REACH: i64 = 3 // the rank the floor reaches, LBC_NONE when not gated |
| 60 | const LBC_K_GATE: i64 = 4 // line start of the deciding climbgate row, LBC_NONE when there is none |
| 62 | const LBC_BF: i64 = 5 |
| 63 | const LBC_B_LINE: i64 = 0 |
| 64 | const LBC_B_NAMEOFF: i64 = 1 |
| 65 | const LBC_B_NAMELEN: i64 = 2 |
| 66 | const LBC_B_TGTOFF: i64 = 3 |
| 67 | const LBC_B_TGTLEN: i64 = 4 |
| 69 | const LBC_N_CONTENDERS: i64 = 0 |
| 70 | const LBC_N_GATED: i64 = 1 |
| 71 | const LBC_N_UNGATED: i64 = 2 |
| 72 | const LBC_N_NOGATE: i64 = 3 |
| 73 | const LBC_N_BADFLOOR: i64 = 4 |
| 74 | const LBC_N_STRAY: i64 = 5 // climbgate rows for this board naming a rung outside the contender population |
| 75 | const LBC_N_DUPGATE: i64 = 6 // further climbgate rows for a (rung, board) pair an earlier row already gated |
| 76 | const LBC_N_LEADER_X10: i64 = 7 |
| 77 | const LBC_N_ESTATE_X10: i64 = 8 |
| 78 | const LBC_N_ESTATE_RANK: i64 = 9 |
| 79 | const LBC_N_RIVALS: i64 = 10 |
| 80 | const LBC_N_BEST_FLOOR_X10: i64 = 11 |
| 81 | const LBC_N_BEST_REACH: i64 = 12 |
| 82 | const LBC_N_REACHERS: i64 = 13 // gated contenders whose floor is strictly above the leader |
| 83 | const LBC_N_MOVERS: i64 = 14 // gated contenders whose floor reaches a better rank than the estate holds |
| 84 | const LBC_N_DYNAMIC: i64 = 15 // gates spelled with the word leader |
| 85 | const LBC_N_COUNT: i64 = 16 |
| 86 | const LBC_NONE: i64 = 0 - 1 |
| 87 | const LBC_I64: i64 = 8 |
| 88 | const LBC_NAME_CAP: i64 = 128 |
functions
| 91 | func lbc_span_z(buf: *u8, off: i64, len: i64, dst: *u8) -> i64 |
| 102 | func lbc_boards(pbuf: *u8, pn: i64, b: *i64, cap: i64) -> i64 |
| 131 | func lbc_gate_find(pbuf: *u8, pn: i64, board: *u8, ridoff: i64, ridlen: i64, dups: *i64) -> i64 |
| 156 | func lbc_climb(pbuf: *u8, pn: i64, lbuf: *u8, ln: i64, board: *u8, tgtoff: i64, tgtlen: i64, k: *i64, c: *i64) -> i64 called by 2: lcc_boardg_run calls 14: bf_count_rowssys_mmapld_classifybf_line_endbf_fieldbf_span_eq+8 |
| 292 | func lbc_partition_sum(c: *i64) -> i64 |
| 296 | func lbc_verdict_name(v: i64) -> *u8 called by 1: lcc_board |
| 305 | func lbc_state_name(s: i64) -> *u8 called by 1: lcc_gate_line |
| 315 | func lbc_exit_of(v: i64) -> i64 |