code wiki / (root) / nx_endgame_gate.nx

nx_endgame_gate.nx

buildroot/runtime/nx_endgame_gate.nx

5704 B104 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_endgame_gate.nx -- KAT + negative controls for endgame last-piece racing. Native sovereign lane; exit 0 = all pass, N = assertion N failed. Prints measured values. T1 in-flight refcount: eg_mark/eg_clear are exact and floor at 0 T2 NORMAL pick avoids an in-flight piece (no duplicate work) -> next-rarest T3 NEG-CONTROL: NOT endgame (many pieces outstanding) -> never duplicate (-1), don't waste bw T4 ENDGAME (few obtainable left, all in-flight) -> RACE the rarest in-flight needed piece T5 NEG-CONTROL: in endgame, still only race a piece THIS peer HAS (peer-filter holds) T6 NEG-CONTROL: a piece NO peer has (avail 0) is NEVER raced (honest 99.x% boundary) -> -1

dependencies 2 imports · 0 importers

nx_endgame.nx nx_assert.nx nx_endgame_gate.nx

imports: nx_endgame.nxnx_assert.nx

imported by: nobody (leaf or entry point)

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

main eg_init eg_open eg_mark eg_open ↻ sys_flock sys_read am_load am_open sys_read ↻ nx_puts_err sys_write nx_puti_err sys_mmap sys_write ↻ eg_clear eg_open ↻ sys_flock ↻ sys_read ↻ setbytes am_open ↻ gset eg_pick am_load ↻ nx_pw_bitfield_has nx_pm_rarest eg_obtainable_remaining nx_sp_in_endgame

structs

none

consts

none

functions

14func gset(bits: *u8, p: i64) -> i64
called by 1: main
22func setbytes(path: *u8, vals: *i64, n: i64) -> i64
called by 1: main calls 1: am_open
28func main() -> i64