code wiki / _hdl_build / nx_collide2d_gate.nx

nx_collide2d_gate.nx

buildroot/runtime/_hdl_build/nx_collide2d_gate.nx

11193 B260 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_collide2d_gate.nx -- liar-kill gate for the swept-collision part. Teeth map 1:1 onto the board's named bar for a physics-collision HAVE (nx_gamebench.nx bit-5 comment): T1 TUNNELING KILLED (swept/continuous): a mover faster than a thin wall per tick must STOP AT the wall, never appear beyond it. A discrete endpoint test passes straight through -- the mutation. T2 SLIDE: an oblique hit with rest=0 kills ONLY the normal component; motion continues along the surface (not stopped dead, not bounced). T3 RESTITUTION: a drop onto the floor with e=1/2 rebounds to ~e^2 of the drop height. T4 DETERMINISM: two identical 500-tick runs produce the identical independent position checksum. T5 BOUNDED: 10000 ticks of LCG-kicked flight inside a closed box NEVER escape it. T6 SAVE TRANSPARENCY: gs_save mid-flight -> ZEROED state -> gs_load -> resume; every later tick's independent ck identical to the uninterrupted run (GX-9 law: the walker is independent of the save path, so a save that forgets a field cannot vouch for itself). T7 ANTI-VACUITY: the mover actually moved and actually hit things (a frozen world passes the invariants above while simulating nothing). T8 CORNER: a diagonal shot into a corner resolves BOTH walls in ONE step (iterative TOI). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_collide2d.nx nx_gamesave.nx nx_collide2d_gate.nx

imports: nx_syscalls.nxnx_collide2d.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 gw2 sys_write sys_mmap st_init c2_step c2_sweep gn2 sys_mmap ↻ sys_write ↻ mkbox c2_ck 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

structs

none

consts

20const CG_BOXW: i64 = 20000 // closed test box edge
21const CG_GRAV: i64 = 4 // gravity impulse per tick
22const CG_DROPH: i64 = 18000 // restitution drop height
23const CG_BIG: i64 = 100000 // "infinite" wall extent
24const CG_LCGA: i64 = 1103515245 // LCG multiplier (glibc constants -- reproducible kicks)
25const CG_LCGC: i64 = 12345
26const CG_LCGM: i64 = 2147483648
27const CG_STAMP: i64 = 20260729 // caller-supplied save stamp (no hidden clock)
28const CG_SCHEMA: i64 = 77

functions

30func gw2(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
31func gn2(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
42func mkbox(walls: *i64) -> i64
called by 1: main
49func st_init(st: *i64, px: i64, py: i64, vx: i64, vy: i64, r: i64) -> i64
called by 1: main
54func main() -> i64