code wiki / (root) / nx_sdfprim_gate.nx

nx_sdfprim_gate.nx

buildroot/runtime/nx_sdfprim_gate.nx

7079 B74 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_sdfprim_gate.nx -- KNOWN-ANSWER TEETH FOR THE IMPLICIT PRIMITIVE FAMILY nx_sdfprim_lib (anatomy AN17, 2026-09-19). Every tooth is a distance a hand can check: a sphere is where the first-order ellipsoid estimator is EXACT, so its values are asserted to the unit; the walled cylinder and the swept arch are asserted at points that lie on a primitive's own construction (a polyline vertex, an axis crossing) where the answer is closed-form. The pitched ellipsoid is held to the plain one at zero tilt (an identity) and to the axis swap at a quarter turn. NEG-CONTROL: the detector "a point off the surface reads non-zero" must fire on a planted 5 mm shift and stay silent on the surface point (gv_bite): a primitive that read zero everywhere would pass every equality tooth by accident. license_tier: ORIGINAL. No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_sdfprim_lib.nx nx_sdfprim_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_sdfprim_lib.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap sp_ellipsoid_q sp_isqrt sp_min gv_check_near gv_check ↻ gv_puts ↻ gv_num ↻ sp_capsule_q sp_isqrt ↻ sp_smin sp_min ↻ sp_abs

structs

none

consts

13const SG_R: i64 = 40 // the sphere every exact tooth uses, mm
14const SG_IN: i64 = 20 // a point this far inside the sphere (from the centre)
15const SG_OUT: i64 = 50 // a point this far from the centre, outside
16const SG_PLANT: i64 = 45 // the neg-control's planted off-surface radius
17const SG_TOL_Q: i64 = 1 // one output unit: the integer roots' own rounding

functions

19func main(argc: i64, argv: *i64) -> i64