code wiki / _hdl_build / nx_gx9_saveload_gate.nx

nx_gx9_saveload_gate.nx

buildroot/runtime/_hdl_build/nx_gx9_saveload_gate.nx

12912 B247 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_gx9_saveload_gate.nx -- Gx-9: SAVE / LOAD, the capability the gamebench ruler ranks #1 across the ingested corpus (it blocks 11 of 12 real titles). Demand-ranked by measurement, not chosen by taste. ★THE TEST THAT ONLY WE CAN RUN. Most engines can only check that a save round-trips its fields. Because our pipeline is bit-deterministic, we can assert the far stronger property: SAVING AND RELOADING MUST BE INDISTINGUISHABLE FROM NEVER HAVING SAVED. Play 14 ticks straight and keep the final frame. Then play 7, save, load into a FRESH state, play the remaining 7 -- and require the final frame to be BYTE-IDENTICAL and the final state to match field for field. That catches the entire class of "the save forgot something" bugs, which field round-trip tests structurally cannot see. The other half is refusal: a damaged save must FAIL WITH A REASON, never half-load. A corrupted save that partially applies strands the player in an impossible world and reads as a game bug forever. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_game_world.nx nx_game_save.nx nx_png_write.nx nx_gx9_saveload_gate.nx

imports: nx_game_world.nxnx_game_save.nxnx_png_write.nx

imported by: nobody (leaf or entry point)

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

main sl_puts swgpu_bytes sl_init sl_sim sl_script it_sin4096 it_cos4096 it_sin4096 ↻ gw_dist2 sl_render gw_h it_sin4096 ↻ it_sin4096 ↻ it_cos4096 ↻ gw_ground gw_h ↻ gw_build_terrain sg_reset gw_h ↻ sg_isqrt gw_band gw_h ↻ sg_project_clip_pitch it_cos4096 ↻ it_sin4096 ↻ sg_clip_vert sg_render sg_raster sg_fb sg_zb sg_imax sg_imin sg_isqrt ↻ sg_tonemap sg_render_pass sg_raster ↻ gw_build_entities sg_reset ↻ gw_ground ↻

structs

none

consts

18const SL_STEP: i64 = 8192
19const SL_TURN: i64 = 3217
20const SL_TICKS: i64 = 14
21const SL_N: i64 = 5
22const SL_PICKR: i64 = 4915
23const SL_EYE: i64 = 6600
24const SL_WORDS: i64 = 6 + SL_N // ppx ppz yaw tick collected won + alive[SL_N]

functions

26func sl_puts(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
27func sl_pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 1: main
29func sl_script(t: i64) -> i64
called by 1: sl_sim
37func sl_init(st: *i64) -> i64
called by 1: main
50func sl_sim(base: i64, st: *i64, from: i64, to: i64, cap: i64, dst: *u8) -> i64
82func sl_render(base: i64, st: *i64, ex: *i64, ez: *i64, dst: *u8) -> i64
115func main() -> i64