code wiki / _hdl_build / nx_gamesave_gate.nx

nx_gamesave_gate.nx

buildroot/runtime/_hdl_build/nx_gamesave_gate.nx

8510 B196 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gamesave.nx nx_gamesave_gate.nx

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

main tw sys_write sys_unlinkat sys_mmap gs_save sys_mmap ↻ put64 gsc_put64 gs_cksum gsc_fold_bytes joinsuf slen sys_mmap ↻ sys_openat_wr sys_write ↻ sys_fsync sys_close sys_unlinkat ↻ gs_exists sys_openat_rd sys_close ↻ sys_renameat gs_load sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_close ↻ get64 gsc_get64 gs_cksum ↻ tn sys_write ↻ sys_mmap ↻ filebytes sys_read_file ↻ samebytes

structs

none

consts

none

functions

18func tw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
19func tn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
29func rawwrite(path: *u8, b: *u8, n: i64) -> i64
36func filebytes(path: *u8, outlen: *i64) -> *u8
called by 1: main calls 1: sys_read_file
40func samebytes(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
47func main() -> i64