nx_autorig_creature_gate.nx
buildroot/runtime/nx_autorig_creature_gate.nx
about
nx_autorig_creature_gate.nx -- THE ARCHETYPE-FREE PROOF: the SAME one-call auto-rig, with NO hint, rigs a dragon-
like quadruped (body + 4 legs + tail + neck) AND a biped (torso + 2 legs + 2 arms + head) and finds each one's
limb topology from the VOLUME alone. This is the Infinigen-style everything-is-math requirement (operator
2026-09-05: "quickly auto rig a dragon vs a human vs whatever"): no humanoid template, no archetype flag, no
learned model -- a medial-radius field and farthest-point peeling read the creature's own geometry.
FIXTURES are watertight CSG unions of boxes through nx_csg_scene (N-ary fold, marching tetrahedra), because
two overlapping CLOSED meshes carry internal walls that split the interior (banked lesson from the T fixture);
an SDF union has none. Every expected number below is DERIVED from the fixture's own construction (a body
built with six appendages must peel six limbs; a leg built to z=-36 mm must be reached below -30 mm), never
a magic bar. The anti-vacuity tooth is that the two counts DIFFER: a skeletoniser returning a constant
would pass every per-fixture tooth and fail that one.
MEASURED (2026-09-05/06): the dragon peeled exactly 6 on every run. The first biped peeled 7, not 5, and TWO stories
were refuted by instruments before the third was read off one: not the shoulder ledges (a flush head also gave 7), not
the torso corners (the peel arithmetic puts them 1-3 cells inside the claimed cubes) -- the LEAF readout showed the
left leg peeled three times down one corner column while the right leg peeled once, and the only asymmetry between
two mirrored legs was the plane x=0 they shared (see BP_LEG_X below). A derived count must be derived from the union's
real geometry, and a fixture must carry no degenerate shared plane; the shouldered variant stays as a MONOTONE tooth.
license_tier: ORIGINAL expect_exit: 0
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_nxa.nxnx_csg_scene.nxnx_autorig_mesh.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
| 25 | const CT_DIR: *u8 = "/tmp/nx_autorig_creature_gate" |
| 26 | const CT_MODE_DIR: i64 = 493 |
| 27 | const CT_MM_Q14: i64 = 16384 // SDF unit: 1 mm = 16384 (Q14) |
| 28 | const CT_NXA_PER_MM: i64 = 100 // NXA unit: 0.01 mm |
| 29 | const CT_RES: i64 = 56 // marching grid per axis; ~2 mm cells over the fixture boxes |
| 30 | const CT_CELLS: i64 = 96 // bone-heat/curveskel voxel grid along the longest axis (the conf default) |
| 31 | const CT_SCENE_CAP: i64 = 8 |
| 32 | const CT_SKIN_SUM: i64 = 4096 |
| 34 | const CT_W_PARENT: i64 = 0 |
| 35 | const CT_W_X: i64 = 1 |
| 36 | const CT_W_Y: i64 = 2 |
| 37 | const CT_W_Z: i64 = 3 |
| 38 | const CT_ABOVE: i64 = 1 // ct_reach2 direction: the joint must lie ABOVE the bar |
| 39 | const CT_BELOW: i64 = 0 - 1 // ...or BELOW it |
| 40 | const CT_NO_BAR: i64 = 0 - 10000 // a bar below every coordinate in these fixtures: the paired condition always holds |
| 41 | const CT_QUAD_X_ONLY: i64 = 0 // ct_leg_quadrants: split by the sign of x only (a biped's two legs) |
| 42 | const CT_QUAD_XY: i64 = 1 // ...or by the signs of x and y (a quadruped's four legs) |
| 43 | const CT_QUAD_X_BIT: i64 = 1 // the x sign contributes bit 0 of the quadrant index, the y sign bit 1 |
| 44 | const CT_QUAD_Y_BIT: i64 = 2 |
| 46 | const DR_BODY_HX: i64 = 30 |
| 47 | const DR_BODY_HY: i64 = 13 |
| 48 | const DR_BODY_HZ: i64 = 13 |
| 49 | const DR_LEG_H: i64 = 5 |
| 50 | const DR_LEG_HZ: i64 = 14 |
| 51 | const DR_LEG_X: i64 = 18 |
| 52 | const DR_LEG_Y: i64 = 8 |
| 53 | const DR_LEG_CZ: i64 = 0 - 22 // spans z -36..-8: overlaps the body bottom (z=-13) by 5 mm |
| 54 | const DR_TAIL_CX: i64 = 0 - 46 // spans x -64..-28: overlaps the body end (x=-30) by 2 mm |
| 55 | const DR_TAIL_HX: i64 = 18 |
| 56 | const DR_TAIL_H: i64 = 5 |
| 57 | const DR_TAIL_CZ: i64 = 4 |
| 58 | const DR_NECK_CX: i64 = 32 // spans x 27..37, z 6..30: overlaps the body corner region |
| 59 | const DR_NECK_H: i64 = 5 |
| 60 | const DR_NECK_CZ: i64 = 18 |
| 61 | const DR_NECK_HZ: i64 = 12 |
| 62 | const DR_LO_X: i64 = 0 - 70 |
| 63 | const DR_LO_Y: i64 = 0 - 20 |
| 64 | const DR_LO_Z: i64 = 0 - 42 |
| 65 | const DR_HI_X: i64 = 44 |
| 66 | const DR_HI_Y: i64 = 20 |
| 67 | const DR_HI_Z: i64 = 36 |
| 68 | const DR_LIMBS: i64 = 6 // DERIVED: four legs + tail + neck were built |
| 69 | const DR_LEGS: i64 = 4 // DERIVED: four legs were built, one per (x,y) sign-quadrant |
| 70 | const DR_LEG_REACH_Z: i64 = 0 - 3000 // a leg built to -36 mm must carry a joint below -30 mm (0.01 mm units) |
| 71 | const DR_TAIL_REACH_X: i64 = 0 - 5500 // a tail built to -64 mm must carry a joint beyond -55 mm |
| 72 | const DR_NECK_REACH_Z: i64 = 2400 // a neck built to +30 mm must carry a joint above +24 mm |
| 73 | const DR_NECK_MIN_X: i64 = 2000 // ...and only the neck lives at x > 20 mm above the body top |
| 75 | const BP_TORSO_HX: i64 = 9 |
| 76 | const BP_TORSO_HY: i64 = 7 |
| 77 | const BP_TORSO_HZ: i64 = 20 |
| 84 | const BP_LEG_H: i64 = 4 |
| 85 | const BP_LEG_HZ: i64 = 18 |
| 86 | const BP_LEG_X: i64 = 6 |
| 87 | const BP_LEG_CZ: i64 = 0 - 36 // spans z -54..-18: overlaps the torso bottom (z=-20) by 2 mm |
| 88 | const BP_ARM_CX: i64 = 20 // spans x 6..34: overlaps the torso side (x=9) by 3 mm |
| 89 | const BP_ARM_HX: i64 = 14 |
| 90 | const BP_ARM_H: i64 = 4 |
| 91 | const BP_ARM_CZ: i64 = 14 |
| 92 | const BP_HEAD_HX: i64 = 9 // FLUSH with the torso in x and y: the construction then has exactly five protrusions |
| 93 | const BP_HEAD_HY: i64 = 7 |
| 94 | const BP_HEAD_HZ: i64 = 6 |
| 95 | const BP_HEAD_CZ: i64 = 25 // spans z 19..31: overlaps the torso top (z=20) by 1 mm |
| 100 | const BS_HEAD_H: i64 = 6 |
| 101 | const BP_LO_X: i64 = 0 - 40 |
| 102 | const BP_LO_Y: i64 = 0 - 14 |
| 103 | const BP_LO_Z: i64 = 0 - 60 |
| 104 | const BP_HI_X: i64 = 40 |
| 105 | const BP_HI_Y: i64 = 14 |
| 106 | const BP_HI_Z: i64 = 37 |
| 107 | const BP_LIMBS: i64 = 5 // DERIVED: two legs + two arms + a flush head column were built |
| 108 | const BP_SIDES: i64 = 2 // DERIVED: one leg and one arm per side |
| 109 | const BP_LEG_REACH_Z: i64 = 0 - 4500 // legs built to -54 mm must carry a joint below -45 mm |
| 110 | const BP_ARM_REACH_X: i64 = 2800 // arms built to |x|=34 mm must carry a joint beyond |x|=28 mm |
| 111 | const BP_ARM_MIN_Z: i64 = 500 // ...above z=5 mm, which excludes the legs |
| 112 | const BP_HEAD_REACH_Z: i64 = 2500 // a head built to +31 mm must carry a joint above +25 mm |
| 184 | const BT_LEG_H: i64 = 5 |
| 185 | const BT_LEG_X: i64 = 5 |
functions
| 114 | func ctw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 115 | func ct_box(s: *NxCsgScene, cx: i64, cy: i64, cz: i64, hx: i64, hy: i64, hz: i64) -> i64 |
| 120 | func ct_write_scene(s: *NxCsgScene, lox: i64, loy: i64, loz: i64, hix: i64, hiy: i64, hiz: i64, path: *u8, out: *i64) -> i64 |
| 149 | func ct_dragon(path: *u8, out: *i64) -> i64 |
| 161 | func ct_biped_body(s: *NxCsgScene) -> i64 |
| 169 | func ct_biped(path: *u8, out: *i64) -> i64 |
| 175 | func ct_biped_shouldered(path: *u8, out: *i64) -> i64 |
| 186 | func ct_biped_touching(path: *u8, out: *i64) -> i64 |
| 196 | func ct_open(path: *u8, lp: *i64) -> i64 |
| 201 | func ct_nj(b: *u8, flen: i64) -> i64 |
| 207 | func ct_jw(b: *u8, flen: i64, j: i64, word: i64) -> i64 |
| 213 | func ct_leg_quadrants(b: *u8, flen: i64, zbar: i64, use_y: i64) -> i64 |
| 230 | func ct_reach2(b: *u8, flen: i64, wa: i64, bara: i64, dira: i64, wb: i64, barb: i64, dirb: i64) -> i64 |
| 246 | func ct_arm_sides(b: *u8, flen: i64, xbar: i64, zmin: i64) -> i64 |
| 262 | func ct_skin_badsum(b: *u8, flen: i64) -> i64 |
| 282 | func ct_leaves(b: *u8, flen: i64, tag: *u8) -> i64 |
| 304 | func main() -> i64 |