code wiki / _hdl_build / nx_leaderboard_gate.nx
nx_leaderboard_gate.nx
buildroot/runtime/_hdl_build/nx_leaderboard_gate.nx
about
nx_leaderboard_gate.nx -- referee for nx_leaderboard_lib (ecosystem EC44, 2026-09-15): the leaderboard ruler on a
PLANTED file with hand-worked answers -- the score parser (one fractional digit, held x10), the board list, the
counts partition, the leader, the rank arithmetic (a tie ranks with the tied), the estate's latest row by date and
its leap, plus the neg-controls: an absent board, a malformed row, a row whose score does not parse, a foreign
board's row. Fixture dir /tmp/nx_leaderboard_gate/, rewritten at SETUP. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_leaderboard_lib.nxnx_syscalls.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 10 | const G_DIR: *u8 = "/tmp/nx_leaderboard_gate/" |
| 11 | const G_DOM: *u8 = "lbgate" |
| 12 | const G_MODE_644: i64 = 420 |
| 13 | const G_DIR_MODE: i64 = 493 |
| 14 | const G_BOARD: *u8 = "bright" |
| 15 | const G_ABSENT_BOARD: *u8 = "nosuchboard" |
| 16 | const G_BOARDS_CAP: i64 = 8 |
| 17 | const G_FIXTURE: *u8 = "# planted leaderboard\nhead|bright|https://example.test/board|knowledge/fetched/cmp_x_board.html|h00|2026-09-14|average nDCG at 10\nlb|bright|1|Alpha|A org|66.9|2026-04-22|https://a.test\nlb|bright|2|Beta|B org|63.4|2025-12-20|https://b.test\nlb|bright|3|Gamma|G org|52.4|2026-03-20|https://g.test\nlb|bright|4|Delta|D org|50|2026-03-13|https://d.test\nlb|bright|5|Epsilon|E org|46.8|2025-11-13|https://e.test\nlb|bright|99|nishi-search|Nishi|14.5|2026-09-14|https://n.test\nlb|bright|99|nishi-search|Nishi|16.1|2026-09-15|https://n.test\nhead|other|https://example.test/other|knowledge/fetched/cmp_x_other.html|h01|2026-09-01|accuracy\nlb|other|1|Zeta|Z org|99.9|2026-01-01|https://z.test\nmalformed|bright|x\nlb|bright|3|Broken|B org|abc|2026-01-01|https://broken.test\n" |
functions
| 19 | func g_write(path: *u8, body: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, G_MODE_644); if fd < 0 { return 0 } sys_write(fd, body, lb_slen(body)); sys_close(fd); return 1 } |
| 21 | func main() -> i64 |