code wiki / _hdl_build / nx_collide2d_gate.nx
nx_collide2d_gate.nx
buildroot/runtime/_hdl_build/nx_collide2d_gate.nx
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
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
structs
| none |
consts
| 20 | const CG_BOXW: i64 = 20000 // closed test box edge |
| 21 | const CG_GRAV: i64 = 4 // gravity impulse per tick |
| 22 | const CG_DROPH: i64 = 18000 // restitution drop height |
| 23 | const CG_BIG: i64 = 100000 // "infinite" wall extent |
| 24 | const CG_LCGA: i64 = 1103515245 // LCG multiplier (glibc constants -- reproducible kicks) |
| 25 | const CG_LCGC: i64 = 12345 |
| 26 | const CG_LCGM: i64 = 2147483648 |
| 27 | const CG_STAMP: i64 = 20260729 // caller-supplied save stamp (no hidden clock) |
| 28 | const CG_SCHEMA: i64 = 77 |
functions
| 30 | func gw2(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 31 | func gn2(v: i64) -> i64 |
| 42 | func mkbox(walls: *i64) -> i64 called by 1: main |
| 49 | func st_init(st: *i64, px: i64, py: i64, vx: i64, vy: i64, r: i64) -> i64 called by 1: main |
| 54 | func main() -> i64 |