nx_race_referee.nx
buildroot/runtime/nx_race_referee.nx
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
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
structs
| none |
consts
| 18 | const K_MAGIC_8192: i64 = 8192 |
functions
| 20 | func rh_puts(fd: i64, s: *u8) -> i64 |
| 31 | func rh_putn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 34 | func rh_tok(buf: *u8, ls: i64, le: i64, idx: i64, se: *i64) -> i64 called by 1: main |
| 63 | func rh_tok_is(buf: *u8, s: i64, e: i64, lit: *u8) -> i64 called by 1: main |
| 76 | func rh_copy_tok(buf: *u8, s: i64, e: i64, pool: *u8, poolp: *i64) -> *u8 called by 1: main |
| 86 | func rh_int(buf: *u8, s: i64, e: i64) -> i64 |
| 104 | func rh_stage(src: *u8) -> i64 |
| 116 | func rh_run(elf: *u8) -> i64 |
| 134 | func rh_parse(buf: *u8, blen: i64, key: *u8) -> i64 |
| 168 | func rh_row(logfd: i64, lane: *u8, casen: *u8, key: *u8, got: i64, want: i64) -> i64 |
| 193 | func main() -> i64 |