code wiki / _hdl_build / nx_gamesave_gate.nx
nx_gamesave_gate.nx
buildroot/runtime/_hdl_build/nx_gamesave_gate.nx
about
nx_gamesave_gate.nx -- CERTIFICATION of the nx_gamesave part (gamebench gap-queue rank 1).
A save/load part is only worth composing if the ugly cases are PROVEN, so the teeth are the failure
modes that actually ruin players' runs:
T1 round-trip fidelity -- every field returns exactly, metadata intact
T2 BIT-EXACT re-save -- save->load->save is byte-identical (the determinism exceed, persisted)
T3 corruption REFUSED -- one flipped payload byte -> CHECKSUM-CORRUPT, never partial state
T4 truncation REFUSED -- a chopped file -> SHORT-TRUNCATED, not a misparse
T5 future-version REFUSED -- a newer format is rejected, not silently misread
T6 additive-only (rule 13) -- saving over a slot banks the PRIOR BYTES as .prev, verified by content
T7 atomic -- no .tmp residue survives a save
T8 ANTI-VACUITY -- after all those refusals, a clean save/load must STILL SUCCEED.
Without T8 a loader that simply refused everything would score 7/7. This is the tooth that makes
the refusal teeth mean something.
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_gamesave.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
| none |
functions
| 18 | func tw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func tn(v: i64) -> i64 |
| 29 | func rawwrite(path: *u8, b: *u8, n: i64) -> i64 |
| 36 | func filebytes(path: *u8, outlen: *i64) -> *u8 |
| 40 | func samebytes(a: *u8, an: i64, b: *u8, bn: i64) -> i64 called by 1: main |
| 47 | func main() -> i64 |