nx_leaderboard_lib.nx
buildroot/runtime/nx_leaderboard_lib.nx
about
nx_leaderboard_lib.nx -- THE ONE reader of <dom>.leaderboard (ecosystem EC44, 2026-09-15): leaderboard rows AS DATA,
read from mirrored bytes, with the estate's own row placed by arithmetic, never by hand.
WHY. The operator's goal names a public leaderboard (BRIGHT) as the evidence surface, and the estate's measuring
organ (nx_beir_eval be_bright) already writes the estate's row into knowledge/compare/<dom>.leaderboard -- but no
compare page rendered the file, so the number lived in a file nobody published. A LEADERBOARD THE BOARD DOES NOT
RENDER IS A CLAIM THE BOARD CANNOT MAKE. This lib is the ruler the emitter's lb_pass projects:
head|<board>|<source url>|<mirror>|<pin>|<fetched YYYY-MM-DD>|<metric>
lb|<board>|<rank>|<system>|<org>|<score>|<date>|<entry url>
A score is decimal with at most one fractional digit (the published boards print nDCG x 100 to one decimal); it is
held as score x10 so 66.9 and 14.5 compare as integers. The ESTATE's rows are the ones whose system starts with
LB_ESTATE_PREFIX; every other row is a published rival. The estate's RANK is 1 + the number of rival rows whose
score is strictly higher (a tie ranks with the tied); its GAP is the leader's score minus its own; its LEAPS are
the score deltas between its own rows in date order (the harness appends one row per measurement, dated).
license_tier: ORIGINAL. No hw writes (Rule 26).
dependencies 1 imports · 5 importers
imports: nx_syscalls.nx
imported by: nx_lbclimb.nxnx_lbclimb_gate.nxnx_lbclimb_lib.nxnx_leaderboard_gate.nxnx_swcompare_lib.nx
structs
| none |
consts
| 18 | const LB_DIR: *u8 = "knowledge/compare/" |
| 19 | const LB_EXT: *u8 = ".leaderboard" |
| 20 | const LB_PATH_CAP: i64 = 600 |
| 21 | const LB_I64_BYTES: i64 = 8 |
| 22 | const LB_TAG_HEAD: *u8 = "head" |
| 23 | const LB_TAG_ROW: *u8 = "lb" |
| 24 | const LB_KIND_OTHER: i64 = 0 |
| 25 | const LB_KIND_HEAD: i64 = 1 |
| 26 | const LB_KIND_ROW: i64 = 2 |
| 27 | const LB_F_TAG: i64 = 0 |
| 28 | const LB_F_BOARD: i64 = 1 |
| 29 | const LB_H_URL: i64 = 2 |
| 30 | const LB_H_MIRROR: i64 = 3 |
| 31 | const LB_H_PIN: i64 = 4 |
| 32 | const LB_H_FETCHED: i64 = 5 |
| 33 | const LB_H_METRIC: i64 = 6 |
| 34 | const LB_H_NF: i64 = 7 |
| 35 | const LB_R_RANK: i64 = 2 |
| 36 | const LB_R_SYSTEM: i64 = 3 |
| 37 | const LB_R_ORG: i64 = 4 |
| 38 | const LB_R_SCORE: i64 = 5 |
| 39 | const LB_R_DATE: i64 = 6 |
| 40 | const LB_R_URL: i64 = 7 |
| 41 | const LB_R_NF: i64 = 8 |
| 42 | const LB_ESTATE_PREFIX: *u8 = "nishi" |
| 43 | const LB_SCORE_SCALE: i64 = 10 // scores held as x10: one fractional digit |
| 44 | const LB_CH_PIPE: i64 = 124 |
| 45 | const LB_CH_LF: i64 = 10 |
| 46 | const LB_CH_CR: i64 = 13 |
| 47 | const LB_CH_HASH: i64 = 35 |
| 48 | const LB_CH_DOT: i64 = 46 |
| 49 | const LB_CH_ZERO: i64 = 48 |
| 50 | const LB_CH_NINE: i64 = 57 |
| 51 | const LB_TEN: i64 = 10 |
| 52 | const LB_NONE: i64 = 0 - 1 |
functions
| 54 | func lb_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 55 | func lb_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o + i] = s[i]; i = i + 1 } return o + i } called by 1: lb_path |
| 56 | func lb_path(dir: *u8, dom: *u8, out: *u8) -> i64 calls 1: lb_cat |
| 64 | func lb_field(line: *u8, n: i64, k: i64, off: *i64, len: *i64) -> i64 |
| 84 | func lb_eq_n(a: *u8, s: *u8, n: i64) -> i64 |
| 90 | func lb_prefix_n(pfx: *u8, s: *u8, n: i64) -> i64 |
| 98 | func lb_nfields(line: *u8, n: i64) -> i64 called by 1: lb_row_kind |
| 105 | func lb_row_kind(line: *u8, n: i64, board: *u8) -> i64 |
| 126 | func lb_score_x10(s: *u8, n: i64) -> i64 |
| 151 | func lb_row_score(line: *u8, n: i64) -> i64 called by 5: lb_row_kindlb_leaderlb_rank_oflb_estate_latestlb_estate_leap calls 3: sys_mmaplb_fieldlb_score_x10 |
| 157 | func lb_row_is_estate(line: *u8, n: i64) -> i64 called by 5: lb_countlb_leaderlb_rank_oflb_estate_latestlb_estate_leap calls 3: sys_mmaplb_fieldlb_prefix_n |
| 164 | func lb_line(buf: *u8, n: i64, from: i64, off: *i64, len: *i64) -> i64 |
| 174 | func lb_count(buf: *u8, n: i64, board: *u8, out_heads: *i64, out_rivals: *i64, out_estate: *i64) -> i64 |
| 195 | func lb_leader(buf: *u8, n: i64, board: *u8) -> i64 |
| 212 | func lb_rank_of(buf: *u8, n: i64, board: *u8, score_x10: i64) -> i64 |
| 230 | func lb_estate_latest(buf: *u8, n: i64, board: *u8, roff: *i64, rlen: *i64) -> i64 called by 2: lbc_climblb_estate_leap calls 7: sys_mmaplb_linelb_row_kindlb_row_is_estatelb_fieldlb_date_ge+1 |
| 254 | func lb_date_ge(a: *u8, an: i64, b: *u8, bn: i64) -> i64 |
| 261 | func lb_estate_leap(buf: *u8, n: i64, board: *u8) -> i64 |
| 291 | func lb_boards(buf: *u8, n: i64, boff: *i64, blen: *i64, cap: i64) -> i64 |