nx_pose_naturalness.nx
buildroot/runtime/nx_pose_naturalness.nx
about
nx_pose_naturalness.nx -- Tier 6 biomechanical pose validation.
CAPABILITY_COMPLETENESS: FULL
User feedback 2026-05-16 (image #3 thread): "her pose was odd
with her touching a wall." AI-generated poses often violate
biomechanics:
- Joint angles outside anatomical comfort range (wrist
hyperextended, elbow inverted, etc.)
- Center of mass outside support polygon (would fall over
in real life)
- Limb proportions wrong (one arm twice as long as other)
This primitive checks two layers:
Layer 1: Joint-angle comfort ranges (caller-supplied
joint angles in Q10 degrees; substrate checks against
named ranges).
Layer 2: Center-of-mass-over-support (caller-supplied
COM_x + support-point positions; substrate checks COM_x
is within the support polygon's x-extent).
References:
- Whittle 2007 "Gait Analysis: An Introduction" (open
excerpts) for joint comfort ranges
- Winter 2009 "Biomechanics and Motor Control of Human
Movement" (open excerpts) for COM analysis
Joint comfort ranges (degrees; from American Academy of
Orthopaedic Surgeons published joint motion guides):
shoulder flexion: 0 to 180
shoulder extension: 0 to 60
shoulder abduction: 0 to 180
elbow flexion: 0 to 145
elbow hyperextension: 0 to 10
wrist flexion: 0 to 80
wrist extension: 0 to 70
hip flexion: 0 to 125
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 138 | struct NxJointAngle |
| 147 | struct NxPoseNaturalnessResult |
consts
| 57 | const NX_MAGIC_1024: i64 = 1024 |
| 59 | const NX_PN_Q10: nx_int = 1024 |
| 63 | const NX_JOINT_SHOULDER_L: nx_int = 0 |
| 64 | const NX_JOINT_SHOULDER_R: nx_int = 1 |
| 65 | const NX_JOINT_ELBOW_L: nx_int = 2 |
| 66 | const NX_JOINT_ELBOW_R: nx_int = 3 |
| 67 | const NX_JOINT_WRIST_L: nx_int = 4 |
| 68 | const NX_JOINT_WRIST_R: nx_int = 5 |
| 69 | const NX_JOINT_HIP_L: nx_int = 6 |
| 70 | const NX_JOINT_HIP_R: nx_int = 7 |
| 71 | const NX_JOINT_KNEE_L: nx_int = 8 |
| 72 | const NX_JOINT_KNEE_R: nx_int = 9 |
| 73 | const NX_JOINT_ANKLE_L: nx_int = 10 |
| 74 | const NX_JOINT_ANKLE_R: nx_int = 11 |
| 75 | const NX_JOINT_NECK: nx_int = 12 |
| 76 | const NX_JOINT_N_KINDS: nx_int = 13 |
| 80 | const NX_PN_JOINT_NATURAL: nx_int = 0 |
| 81 | const NX_PN_JOINT_STRAINED: nx_int = 1 |
| 82 | const NX_PN_JOINT_IMPOSSIBLE: nx_int = 2 |
| 86 | const NX_PN_VERDICT_NATURAL: nx_int = 0 |
| 87 | const NX_PN_VERDICT_STRAINED: nx_int = 1 // 1-2 strained joints |
| 88 | const NX_PN_VERDICT_IMPOSSIBLE: nx_int = 2 // any impossible joint OR 3+ strained |
| 89 | const NX_PN_VERDICT_OFF_BALANCE: nx_int = 3 // COM outside support polygon |
| 90 | const NX_PN_VERDICT_BOTH_FAIL: nx_int = 4 // joint-impossible AND off-balance |
| 143 | const NX_JOINT_ANGLE_BYTES: nx_size = 16 |
| 158 | const NX_PN_RESULT_BYTES: nx_size = 64 |
functions
| 102 | func _pn_max_comfort_q10(joint_id: nx_int) -> nx_int called by 1: nx_pose_joint_classify |
| 124 | func nx_pose_joint_classify(joint_id: nx_int, angle_q10: nx_int) -> nx_int |
| 169 | func nx_pose_naturalness_check( |
| 247 | func _pn_set_joint(arr: *NxJointAngle, idx: nx_int, called by 1: main |
| 256 | func main() -> nx_int |