nx_mmdev_gate.nx
buildroot/runtime/nx_mmdev_gate.nx
about
nx_mmdev_gate.nx -- GATE for the millimetre surface-deviation ruler (PG4, procgen.plan, 2026-08-24).
A ruler is proven by geometry whose true answer is known BEFORE the ruler runs. The fixtures here are
NXMSH2 meshes written through the same nx_nxmesh_lib the ruler reads, so the codec round-trip is under
test too, in caller-owned mmap -- never a production plane.
KNOWN ANSWERS: a unit square (two triangles, 100 mm on a side) against a copy of itself lifted 5.0 mm
along its normal. Every vertex of one sits exactly 5.0 mm from the other's surface, so mean, p95 and
max must ALL read 50 in tenths of a millimetre. A wrong point-triangle case (edge or corner region
taken instead of the face) would read larger; a wrong sign or a dropped axis would read 0 or ~70.
That is the anti-vacuity property: the trivial wrong implementations cannot pass it.
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_vecmath.nxnx_nxmesh_lib.nxnx_mmdev_lib.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 MG_SIDE: i64 = 1000 |
| 21 | const MG_LIFT: i64 = 50 |
| 22 | const MG_LIFT2: i64 = 2500 |
| 25 | const MG_SLACK: i64 = 1 |
functions
| 28 | func mg_square(buf: *u8, lift: i64) -> i64 |
| 40 | func mg_near(a: i64, b: i64) -> i64 { var d: i64 = a - b; if d < 0 { d = 0 - d } if d <= MG_SLACK { return 1 } return 0 } called by 1: main |
| 42 | func main() -> i64 |