nx_clipcheck.nx
buildroot/runtime/nx_clipcheck.nx
about
nx_clipcheck.nx -- THE ANIMATION CLIPPING RULER (debt 1786578438; operator 2026-08-12: evaluate
art/realism/quality/CLIPPING). Measures, per ANIM key of a chn-2 NXA clip, how deep tracked
limb joints penetrate (a) the TORSO CAPSULE and (b) the FLOOR plane -- the two gross clipping
classes the eye reports as "arm through chest" and "foot through ground". Joint world position
per key = bind + dt (the wire's dt lanes ARE world displacement, mm -> 0.01mm x100), exactly the
player's apply contract -- no quat math needed for JOINT CENTERS.
DECLARED IMPRECISION (imprecision named or the next reader trusts it as exact):
- torso = ONE vertical capsule at the spine-band centroid, radius CC_TORSO_R (data below), span
40..80 permil of stature; limbs = points with radius CC_LIMB_R. Real flesh is neither.
- ELIGIBILITY: only joints whose BIND already sits OUTSIDE torso_r+limb_r+grace are measured
(wrists/elbows/fingertips/ankles) -- hips/shoulders bind INSIDE the capsule and would be
permanent false positives (the bind pose is the clean control by construction).
- v1 measures limb-vs-TORSO and vs-FLOOR only, NOT limb-vs-limb.
THE BVH LANE (2026-08-13, debt 1786598036) -- the MOCAP-SELF-CLEARANCE CONTROL, the
two-instruments law applied to the retarget: the SAME capsule measure over the mocap SOURCE
skeleton (FK via nx_bvhfk_lib -- the proven incumbent, never a re-implementation). If the
source clips the same capsule at the same keys, the retarget is faithful and the residual is
ruler coarseness; if the source is clean, the gap belongs to the emitter. DECLARED:
- the reference NXA supplies the STATURE BRIDGE (BVH declares no unit; source positions are
scaled so both skeletons share a stature) -- proportions are the subject, not absolute size.
- axes are MEASURED from the rest pose: up = bone-length-weighted alignment (a T-pose span
exceeds its height, so extent misdetects up); side = widest remaining extent; ambiguous
alignment REFUSES rather than guessing gravity.
- root POSITIONAL channels are ZEROED per frame: the nxa emitter lane is rotations-only /
in-place BY DESIGN, so the control mirrors its subject. Rest pose (all channels zero) is the
bind analog for eligibility. Keys were emitted 1:1 from frames, so key == frame.
- measures every parser-exposed joint whose rest pose sits outside capsule+grace (the NXA lane
measures tracked joints; both predicates are "rest/bind outside").
usage: nx_clipcheck <clip.nxa> [detail <key> <joint>] | bvh <clip.bvh> <ref.nxa> [up=x|y|z]
exit: 0 CLEAN (worst <= CC_TOL_MM) | 1 CLIP (worst key+joint NAMED) | 4 refuse (parse)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 5 imports · 1 importers
imports: nx_syscalls.nxnx_nxa.nxnx_clipcap_lib.nxnx_bvh_lib.nxnx_bvhfk_lib.nx
imported by: nx_clipcheck_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 39 | const CC_MAGIC_1000000: i64 = 1000000 |
| 40 | const CC_MAGIC_32767: i64 = 32767 |
| 41 | const CC_MAGIC_65536: i64 = 65536 |
| 42 | const CC_TOL_MM: i64 = 10 // verdict tolerance, mm; capsule GEOMETRY lives in nx_clipcap_lib |
functions
| 44 | func cc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: cc_puts |
| 45 | func cc_puts(s: *u8) -> i64 { sys_write(1, s, cc_slen(s)); return 0 } |
| 46 | func cc_pn(v: i64) -> i64 |
| 59 | func cc_atoi(s: *u8) -> i64 called by 1: main |
| 69 | func cc_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 78 | func cc_sgn16(w: i64) -> i64 |
| 88 | func cc_meas(px: i64, py: i64, pz: i64, j: i64, key: i64, AX: *i64, R: *i64) -> i64 |
| 104 | func cc_scan_nxa(path: *u8, R: *i64) -> i64 |
| 158 | func cc_scan_bvh(bpath: *u8, npath: *u8, upHint: i64, R: *i64) -> i64 |
| 355 | func cc_probe(path: *u8, pkey: i64, pjoint: i64) -> i64 |
| 417 | func main(argc: i64, argv: *i64) -> i64 |