code wiki / (root) / nx_race_referee.nx

nx_race_referee.nx

buildroot/runtime/nx_race_referee.nx

12747 B340 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic race
docsdependenciesstructsconstsfunctions

about

nx_race_referee.nx -- the GENERIC AUTONOMY-RACE REFEREE (race-1's third growth rung, RACE_HARNESS). Everything assignment-specific is DATA in a manifest (rule 11) -- running a NEW race needs no new referee code, only a manifest + an oracle stager: /tmp/race_manifest.txt lines: lane <name> <elfpath> up to 4 lanes (lane 0 = the team by convention) case <name> <inputfile> up to 8 staged input cases row <case> <key> <want> up to 64 scoring rows (key matched in lane stdout, e.g. SNI=) For each lane x case: stage the case file to /tmp/race_input.bin (the lane contract), run the lane ELF with stdout captured, parse each row's <key><int>, compare to <want>. Output: RACE-H row= lines + per-lane permil + a lane0-vs-lane1 verdict -> stdout + knowledge/status/race_harness.log (Archivist rule). Malformed manifest = LOUD exit 2, never a silent partial race. RACI: Referee=SCORE -- mechanical, no self-grade, no lane authorship. LAWS: struct-free, integer-only, flat ifs, no &&/||, <=6 args, no shell. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_race_referee.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close rh_puts sys_write rh_tok rh_tok_is rh_copy_tok rh_int sys_openat_append rh_putn nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real rh_stage sys_mmap ↻ sys_read_file ↻ sys_openat_wr sys_write ↻ sys_close ↻ rh_run sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 rh_parse rh_int ↻

structs

none

consts

18const K_MAGIC_8192: i64 = 8192

functions

20func rh_puts(fd: i64, s: *u8) -> i64
called by 2: rh_rowmain calls 1: sys_write
31func rh_putn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 2: rh_rowmain calls 1: nxi_fd
34func rh_tok(buf: *u8, ls: i64, le: i64, idx: i64, se: *i64) -> i64
called by 1: main
63func rh_tok_is(buf: *u8, s: i64, e: i64, lit: *u8) -> i64
called by 1: main
76func rh_copy_tok(buf: *u8, s: i64, e: i64, pool: *u8, poolp: *i64) -> *u8
called by 1: main
86func rh_int(buf: *u8, s: i64, e: i64) -> i64
called by 2: rh_parsemain
104func rh_stage(src: *u8) -> i64
116func rh_run(elf: *u8) -> i64
134func rh_parse(buf: *u8, blen: i64, key: *u8) -> i64
called by 1: main calls 1: rh_int
168func rh_row(logfd: i64, lane: *u8, casen: *u8, key: *u8, got: i64, want: i64) -> i64
called by 1: main calls 2: rh_putsrh_putn
193func main() -> i64