code wiki / (root) / nx_lbclimb.nx

nx_lbclimb.nx

buildroot/runtime/nx_lbclimb.nx

13944 B285 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_lbclimb.nx -- CLI over nx_lbclimb_lib (search R0d, ecosystem EC62, 2026-09-17): the estate answers "what ladder do we climb to beat the leader" from DATA -- the domain's plan (dated targets, contender rungs, climbboard and climbgate rows) joined with its leaderboard file (rival rows, the estate's own measured row). nx_lbclimb <domain> [board] [journal=<path>] journal=<path> appends ONE row per judged board (lbclimb|epoch|domain|board|target|leader=..|...|VERDICT), built in a buffer and written with one write, so a daily beat leaves a time spine of where the estate stands against the leader. Per board: the leader, the estate's score and rank, then every contender toward the board's target in floor order (the rank its gate reaches, whether that moves the estate's rank, whether it clears the leader), the partition contenders = gated + ungated + nogate + badfloor, strays and duplicate gates, and the verdict LAST. exit 0 REACHES | 1 SHORT or BADTARGET | 2 usage | 3 abstain (NOGATES, NOBOARD, no climbboard row, no plan) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 2

dependencies 5 imports · 0 importers

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

imports: nx_syscalls.nxnx_barfresh_lib.nxnx_ladder_lib.nxnx_leaderboard_lib.nxnx_lbclimb_lib.nx

imported by: nobody (leaf or entry point)

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

main lcc_w sys_write bf_slen 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 ↻ bf_read_plan sys_mmap ↻ ct_build_path ct_cat sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ct_first_published ct_second_published lcc_read_lb sys_mmap ↻ ct_build_path ↻ ct_first_published ↻ sys_read_file ↻ ct_second_published ↻ lbc_boards sys_mmap ↻

structs

none

consts

18const LCC_ARG_DOMAIN: i64 = 1
19const LCC_ARG_BOARD: i64 = 2
20const LCC_EXIT_USAGE: i64 = 2
21const LCC_STDOUT: i64 = 1
22const LCC_NUM_CAP: i64 = 24
23const LCC_BOARD_CAP: i64 = 16
24const LCC_TEN: i64 = 10
25const LCC_LB_SUFFIX: *u8 = ".leaderboard"
26const LCC_TITLE_MAX: i64 = 96
27const LCC_JRNL_PFX: *u8 = "journal="
28const LCC_JRNL_PFX_LEN: i64 = 8
29const LCC_ROW_CAP: i64 = 768
30const LCC_MODE_644: i64 = 420
31const LCC_CLOCK_WORDS: i64 = 2
32const LCC_NOFD: i64 = 0 - 1

functions

34func lcc_w(s: *u8) -> i64 { return sys_write(LCC_STDOUT, s, bf_slen(s)) }
35func lcc_wn(v: i64) -> i64
48func lcc_wspan(buf: *u8, off: i64, len: i64) -> i64
called by 2: lcc_gate_linelcc_board calls 1: sys_write
53func lcc_wscore(v: i64) -> i64
called by 2: lcc_gate_linelcc_board calls 2: lcc_wlcc_wn
60func lcc_bcat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { if p < LCC_ROW_CAP - 2 { d[p] = s[i]; p = p + 1 } i = i + 1 } return p }
61func lcc_bspan(d: *u8, o: i64, buf: *u8, off: i64, len: i64) -> i64 { var i: i64 = 0; var p: i64 = o; while i < len { if p < LCC_ROW_CAP - 2 { d[p] = buf[off + i]; p = p + 1 } i = i + 1 } return p }
called by 1: lcc_board
62func lcc_bnum(d: *u8, o: i64, v: i64) -> i64
73func lcc_bscore(d: *u8, o: i64, v: i64) -> i64
called by 1: lcc_board calls 2: lcc_bcatlcc_bnum
81func lcc_read_lb(dom: *u8, lenp: *i64) -> *u8
92func lcc_gate_line(pbuf: *u8, pn: i64, k: *i64, q: i64, erank: i64, leader: i64) -> i64
128func lcc_board(dom: *u8, pbuf: *u8, pn: i64, lbuf: *u8, ln: i64, b: *i64, bi: i64, jfd: i64) -> i64
217func main(argc: i64, argv: *i64) -> i64