code wiki / _hdl_build / nx_sqprim_gate.nx

nx_sqprim_gate.nx

buildroot/runtime/_hdl_build/nx_sqprim_gate.nx

6140 B123 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_sqprim_gate.nx -- teeth for the SUPERQUADRIC primitive in nx_bodyatlas (2026-07-27). ★WHY: every part in the atlas was an axis-aligned ELLIPSOID. The literature calls that the EARLY formulation for anatomy; the modern primitive is the GENERALIZED CYLINDER, of which superquadrics are the superelliptical-cross-section subset (6 pose + 3 size + 2 SHAPE parameters). An ellipsoid cannot express a vertebral body (boxy) or a tapering muscle belly (pinched) -- not badly, AT ALL, because it has no shape degree of freedom. This gate proves the exponent is a real DOF and not a relabel. ★THE ORDERING IS THE POINT AND IT IS MEASURED, NOT ASSERTED: for a fixed radius the enclosed volume must be strictly increasing in the exponent -- a diamond is inside an ellipsoid is inside a rounded box -- because higher exponents push the surface out toward the corners of the bounding box. expect_exit: 0 license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_bodyatlas.nx nx_gate_verdict.nx nx_sqprim_gate.nx

imports: nx_bodyatlas.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap gv_head gv_puts sys_write ba_isqrt gv_check gv_puts ↻ ba_iabs sq_volume ba_iabs ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap atlas_build ba_add sys_mmap ↻ ba_axis_x ba_ax_defaults ba_is_arm ba_is_leg ba_axis_y ba_ax_defaults ↻ ba_is_arm ↻ ba_knee_y ba_ax_defaults ↻ ba_max it_sin4096 it_cos4096 it_sin4096 ↻ ba_rig_setup sys_mmap ↻ ba_ax_defaults ↻ ba_nin atlas_sync_pose it_sin4096 ↻ it_cos4096 ↻

structs

none

consts

16const SQ_ONE: i64 = 1024
17const SQ_G: i64 = 24 // grid half-extent for the volume count
18const SQ_R: i64 = 1000 // part radius used by the fixtures

functions

21func sq_volume(e: i64) -> i64
called by 1: main calls 1: ba_iabs
42func main() -> i64