nx_vecmath_gate.nx
buildroot/runtime/nx_vecmath_gate.nx
about
nx_vecmath_gate.nx -- THE GATE for the shared integer linear-algebra foundation (PG2, procgen.plan).
GATE LAW APPLIED (CLAUDE.md "EVERY GATE YOU WRITE"):
1. returns gv_verdict so the EXIT CODE carries the verdict -- /api/gate_run derives GREEN/RED from it,
and a gate that returns a bare 0 after printing RED silently blesses every failure it finds.
2. two teeth are named neg-control-* so the L2 census can SEE them.
3. every tooth is a gv_check on the shared counter, so DECLARED == EXECUTED by construction. A hand-rolled
tally can print "passed 22/20"; this cannot.
4. every sweep is bound to its denominator via gv_subjects. A tooth that passes on the empty set is not a
tooth, and these sweeps are the whole representable population, never a sample.
5. every tooth PRINTS ITS MEASURED VALUE. A boolean cannot say why, and both vacuous teeth this estate has
caught were found in the diagnostic dump, never in the verdict vector.
6. the verdict note does NOT recite the teeth. Each gv_check name states its own strength, so adding a
tooth can never make a summary sentence lie.
ERROR BARS ARE DERIVED AND THE MEASUREMENT IS PRINTED BESIDE THEM. nx_itrig declares ~0.6 percent amplitude
error, which at fx4096 is about 25 units of value and therefore about 25 units of ANGLE once a point is
perturbed off the unit circle. The single-term atan form contributes about 20 units. The bars below sit at
roughly twice their sum so a tooth fails on a REGRESSION rather than on the known approximation, and the
printed maximum makes the bar ratchetable on evidence instead of by taste.
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_vecmath.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
| 26 | const VG_I64: i64 = 8 |
| 27 | const VG_V3B: i64 = 24 // 3 * VG_I64 |
| 28 | const VG_V4B: i64 = 32 // 4 * VG_I64 |
| 29 | const VG_M3B: i64 = 72 // 9 * VG_I64 |
| 32 | const VG_ANG_BAR: i64 = 96 // composite sin-cos-atan2 round-trip, units of rad*4096 |
| 33 | const VG_ACOS_BAR: i64 = 96 // acos(cos(a)) round-trip, same basis |
| 34 | const VG_UNIT_BAR: i64 = 24 // |normalise(v)| vs VM_ONE: pure fixed-point quantisation, no trig involved |
| 35 | const VG_ORTH_BAR: i64 = 24 // dot(cross(a,b), a) vs zero |
| 36 | const VG_M3_BAR: i64 = 48 // matrix round-trip and rotation-path agreement |
| 40 | const VG_POLE_AMP: i64 = 16 |
| 44 | const VG_ISQRT_N: i64 = 3000 |
| 45 | const VG_FLOOR_N: i64 = 20000 |
| 46 | const VG_ACOS_N: i64 = 4096 // every representable cosine in [0, VM_ONE] |
functions
| 48 | func vg_dev(a: i64, b: i64) -> i64 { if a > b { return a - b } return b - a } called by 1: main |
| 51 | func vg_angdev(a: i64, b: i64) -> i64 |
| 58 | func main() -> i64 |