code wiki / (root) / nx_lbclimb_lib.nx

nx_lbclimb_lib.nx

buildroot/runtime/nx_lbclimb_lib.nx

15276 B320 linesdepth 5pulls 7 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_barfresh_lib.nx nx_ladder_lib.nx nx_leaderboard_lib.nx nx_lbclimb_lib.nx nx_lbclimb.nx nx_lbclimb_gate.nx

imports: nx_syscalls.nxnx_barfresh_lib.nxnx_ladder_lib.nxnx_leaderboard_lib.nx

imported by: nx_lbclimb.nxnx_lbclimb_gate.nx

structs

none

consts

28const LBC_BOARD_TAG: *u8 = "climbboard|"
29const LBC_GATE_TAG: *u8 = "climbgate|"
30const LBC_F_B_BOARD: i64 = 1
31const LBC_F_B_TARGET: i64 = 2
32const LBC_F_G_RUNG: i64 = 1
33const LBC_F_G_BOARD: i64 = 2
34const LBC_F_G_FLOOR: i64 = 3
35const LBC_F_G_BASIS: i64 = 4
36const LBC_FLOOR_UNGATED: *u8 = "-"
37const LBC_FLOOR_LEADER: *u8 = "leader"
38const LBC_LEADER_STEP: i64 = 1 // one tenth of a point above the leader, in the x10 scale the boards print
40const LBC_S_GATED: i64 = 0
41const LBC_S_UNGATED: i64 = 1 // a climbgate row whose floor is the dash: declared unmeasured
42const LBC_S_NOGATE: i64 = 2 // no climbgate row for this board at all
43const LBC_S_BADFLOOR: i64 = 3 // a floor that is neither a score, the dash nor the word leader
45const LBC_V_REACHES: i64 = 0
46const LBC_V_SHORT: i64 = 1
47const LBC_V_NOGATES: i64 = 3
48const LBC_V_NOBOARD: i64 = 4
49const LBC_V_BADTARGET: i64 = 5
51const LBC_EXIT_REACHES: i64 = 0
52const LBC_EXIT_SHORT: i64 = 1
53const LBC_EXIT_ABSTAIN: i64 = 3
55const LBC_KF: i64 = 5
56const LBC_K_ROFF: i64 = 0 // line start of the rung row
57const LBC_K_STATE: i64 = 1
58const LBC_K_FLOOR: i64 = 2 // floor x10, LBC_NONE when not gated
59const LBC_K_REACH: i64 = 3 // the rank the floor reaches, LBC_NONE when not gated
60const LBC_K_GATE: i64 = 4 // line start of the deciding climbgate row, LBC_NONE when there is none
62const LBC_BF: i64 = 5
63const LBC_B_LINE: i64 = 0
64const LBC_B_NAMEOFF: i64 = 1
65const LBC_B_NAMELEN: i64 = 2
66const LBC_B_TGTOFF: i64 = 3
67const LBC_B_TGTLEN: i64 = 4
69const LBC_N_CONTENDERS: i64 = 0
70const LBC_N_GATED: i64 = 1
71const LBC_N_UNGATED: i64 = 2
72const LBC_N_NOGATE: i64 = 3
73const LBC_N_BADFLOOR: i64 = 4
74const LBC_N_STRAY: i64 = 5 // climbgate rows for this board naming a rung outside the contender population
75const LBC_N_DUPGATE: i64 = 6 // further climbgate rows for a (rung, board) pair an earlier row already gated
76const LBC_N_LEADER_X10: i64 = 7
77const LBC_N_ESTATE_X10: i64 = 8
78const LBC_N_ESTATE_RANK: i64 = 9
79const LBC_N_RIVALS: i64 = 10
80const LBC_N_BEST_FLOOR_X10: i64 = 11
81const LBC_N_BEST_REACH: i64 = 12
82const LBC_N_REACHERS: i64 = 13 // gated contenders whose floor is strictly above the leader
83const LBC_N_MOVERS: i64 = 14 // gated contenders whose floor reaches a better rank than the estate holds
84const LBC_N_DYNAMIC: i64 = 15 // gates spelled with the word leader
85const LBC_N_COUNT: i64 = 16
86const LBC_NONE: i64 = 0 - 1
87const LBC_I64: i64 = 8
88const LBC_NAME_CAP: i64 = 128

functions

91func lbc_span_z(buf: *u8, off: i64, len: i64, dst: *u8) -> i64
called by 2: lcc_boardg_run
102func lbc_boards(pbuf: *u8, pn: i64, b: *i64, cap: i64) -> i64
131func lbc_gate_find(pbuf: *u8, pn: i64, board: *u8, ridoff: i64, ridlen: i64, dups: *i64) -> i64
156func lbc_climb(pbuf: *u8, pn: i64, lbuf: *u8, ln: i64, board: *u8, tgtoff: i64, tgtlen: i64, k: *i64, c: *i64) -> i64
292func lbc_partition_sum(c: *i64) -> i64
called by 2: lcc_boardmain
296func lbc_verdict_name(v: i64) -> *u8
called by 1: lcc_board
305func lbc_state_name(s: i64) -> *u8
called by 1: lcc_gate_line
315func lbc_exit_of(v: i64) -> i64
called by 2: mainmain