code wiki / (root) / nx_nxa_pect.nx

nx_nxa_pect.nx

buildroot/runtime/nx_nxa_pect.nx

25530 B546 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind tooltopic nxa
docsdependenciesstructsconstsfunctions

about

nx_nxa_pect.nx -- GIVE THE SOFT TISSUE ITS BONES: append the lateral pectoral pair to an NXA and re-bind the bust vertices to it. WHY THIS EXISTS. The reference-figure rig carries lPectoral/rPectoral as first-class bones (measured 2026-08-03 from morph formula targets across three independent packages); our rig has 104 joints and ZERO off-midline at chest height, which is the root cause behind the vertex-band soft-tissue workaround (debt 1785798366). The DYNA section already declares MEASURED lateral anchors (nx_nxa_dyna derives them from the mesh's own bust-band centroids); this organ promotes those declared anchors into actual SKEL bones with skinning weights, so the engine can drive a bone instead of faking one at the vertices. ★THE TRAP THIS DESIGN AVOIDS (found by reading the consumer BEFORE building): the page runtime has NO joint hierarchy -- every joint poses from its OWN absolute ANIM track, and a joint with no track renders the IDENTITY transform. Bones appended naively would leave a FROZEN CHEST PATCH on an animating body. So each new bone receives a byte-copy of its donor chest joint's track(s) with the header jointIdx rewritten: copied (R, dt) applied at the new bone's OWN bind position is exactly rigid attachment under the consumer's dual-quat T = b + dt - D*b. FAIL-CLOSED MEASUREMENTS, NEVER ASSUMPTIONS: - the SKIN weight layout (planar [i,i,i,i,w,w,w,w] vs interleaved [i,w,i,w..]) and the weight basis (the constant per-vertex sum) are DETECTED from the data and REFUSED if ambiguous; - every ANIM track must be chn==2 (the one layout the consumer parses) or we refuse; - a rig that already carries an off-midline bust-band joint is REFUSED (idempotence: run twice and the second run tells you it is done rather than doubling bones); - all checksums are RECOMPUTED, never copied (nx_nxa_dyna's law: a copied checksum would validate its own copy bug). nx_nxa_pect <in.nxa> <out.nxa> (input never modified) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_nxa.nx nx_nxa_pect.nx

imports: nx_syscalls.nxnx_nxa.nx

imported by: nobody (leaf or entry point)

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

main pt_werr sys_write pt_slen sys_exit sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close pt_die pt_werr ↻ sys_exit ↻ pt_rd64 nxa_magic pt_tageq pt_out sys_write ↻ pt_slen ↻ pt_num sys_write ↻ sys_mmap ↻ pt_wr64 pt_isqrt nxa_check2 sys_openat_wr sys_write ↻ sys_close ↻

structs

none

consts

33const PT_MAGIC_4096: i64 = 4096
35const PT_HDR: i64 = 32
36const PT_TOCE: i64 = 32
37const PT_MAXSEC: i64 = 64
38const PT_MODE: i64 = 0x1a4
39const PT_EXIT_USAGE: i64 = 2
40const PT_EXIT_BAD: i64 = 3
41const PT_EXIT_IO: i64 = 1
42const PT_EXIT_DONE: i64 = 4
45const PT_MIDLINE: i64 = 3000
50const PT_FRONT_Y: i64 = 0 - 1200
53const PT_NIP_PERMIL: i64 = 744
54const PT_BAND_PERMIL: i64 = 40
58const PT_FMAX_PERMIL: i64 = 400
59const PT_SKELREC: i64 = 64
60const PT_SKIN_WPV: i64 = 8

functions

62func pt_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: pt_werrpt_out
63func pt_werr(s: *u8) -> i64 { sys_write(2, s, pt_slen(s)); return 0 }
called by 2: pt_diemain calls 2: sys_writept_slen
64func pt_out(s: *u8) -> i64 { sys_write(1, s, pt_slen(s)); return 0 }
called by 1: main calls 2: sys_writept_slen
65func pt_num(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
78func pt_rd64(b: *u8, off: i64) -> i64
called by 1: main
84func pt_wr64(b: *u8, off: i64, v: i64) -> i64
called by 1: main
90func pt_tageq(b: *u8, off: i64, t: *u8) -> i64
called by 1: main
95func pt_isqrt(v: i64) -> i64
called by 1: main
102func pt_die(msg: *u8, code: i64) -> i64
called by 1: main calls 2: pt_werrsys_exit
108func main(argc: i64, argv: *i64) -> i64