code wiki / (root) / nx_nxa_retarget_gate.nx

nx_nxa_retarget_gate.nx

buildroot/runtime/nx_nxa_retarget_gate.nx

18208 B252 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic nxa
docsdependenciesstructsconstsfunctions

about

nx_nxa_retarget_gate.nx -- THE DONOR RETARGET GATE: handedness is DERIVED, limb length is preserved BY CONSTRUCTION, and a witness that cannot testify ABSTAINS BY NAME. WHY ITS NEGATIVE CONTROLS ARE STRONGER THAN ANY MUTANT I COULD CONSTRUCT: every RED below is a REAL DEFECT THIS ORGAN ACTUALLY SHIPPED AND THIS LANE ACTUALLY CAUGHT, on the real corpus, within hours. Nothing here is synthetic. - CHIRALITY. Before the mesh-derived anterior cue, frame_det came out +1 / +1 / -1 / -1 across four ordinary humanoids -- i.e. TWO OF FOUR DONORS WERE POSED MIRRORED, left and right swapped, and NO LIMB-LENGTH TOOTH COULD CATCH IT because a mirror preserves every length it checks. The cause: handedness was resolved by argmin over mapping distance, and a bilaterally symmetric point set (every rig here scores sym_permil=1000) is near-ISOMETRIC UNDER MIRRORING, so both options tie and the argmin picks arbitrarily. - VACUOUS BANDS. The anterior cue takes two witnesses, a foot band and a head band, and requires them to agree. With the band height derived from GLOBAL mean joint spacing, paladin measured foot=head=2184 and dark_knight foot=head=-140 -- BYTE-IDENTICAL, because both bands covered the entire mesh. TWO WITNESSES THAT ARE SECRETLY THE SAME WITNESS AGREE ONE HUNDRED PERCENT OF THE TIME. dark_knight's whole verdict rested on -140 units of whole-mesh noise. - UNPOPULATED BANDS. Disjointness turned out to be NECESSARY BUT NOT SUFFICIENT: toon3d8's toe-tip bone is 1 unit long, so its foot band held exactly 2 VERTICES and an entire handedness verdict rested on them. A band must also be POPULATED, and the floor comes from the asset -- a region holding fewer points than the rig has joints is stray vertices, not a shape. The three donors that now REFUSE are therefore the gate's own neg-controls: they prove the teeth can fail, on real assets, for three DISTINCT named reasons. usage: nx_nxa_retarget_gate (no args -- reads the real corpus) license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_tool_run.nx nx_nxa_retarget_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_tool_run.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 nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ gk_run_capture gk_run_cap2 gk_run_cap3 sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_setpgid sys_openat_rd sys_dup3 sys_execve sys_exit ↻ sys_sleep_ms sys_mmap ↻ sys_munmap nx_kill sys_now_realtime_ms sys_mmap ↻ sys_clock_gettime_real

structs

none

consts

33const RG_ELF: *u8 = "./nx_nxa_retarget.elf"
34const RG_SRC: *u8 = "sites/nishifamily/world/ref9d.nxa"
35const RG_WITCH: *u8 = "knowledge/rigcorpus/dark_witch_rigged.nxa"
36const RG_KNIGHT: *u8 = "knowledge/rigcorpus/dark_knight_rigged.nxa"
37const RG_TOON: *u8 = "knowledge/rigcorpus/toon3d8_rigged.nxa"
38const RG_PAL: *u8 = "knowledge/rigcorpus/paladin_rigged.nxa"
39const RG_POSE: *u8 = "0"
40const RG_CAP: i64 = 65536
42const RG_EXIT_REFUSE: i64 = 3
44const RG_PLAY: *u8 = "./nx_nxa_play.elf"
45const RG_TMP: *u8 = "/tmp/nx_nxa_retarget_gate"
46const RG_TMP_MODE: i64 = 493 // 0755: gate scratch under /tmp/<gate>/, never a production path
47const RG_POSE_OUT: *u8 = "/tmp/nx_nxa_retarget_gate/witch_pose.nxa"
48const RG_POSE_OUT2: *u8 = "/tmp/nx_nxa_retarget_gate/witch_pose_again.nxa"
49const RG_BAKE_OUT: *u8 = "/tmp/nx_nxa_retarget_gate/witch_bake.nxa"
50const RG_EMIT: *u8 = "emit=pose"
51const RG_NOPOSE: *u8 = "777" // a pose id the emitted library does not hold: identity replay
52const RG_ARGVN: i64 = 8
53const RG_TMO_MS: i64 = 600000 // a hang guard, not a budget: a witch retarget measures in seconds
54const RG_PERMIL: i64 = 1000
55const RG_SQRT3_PERMIL: i64 = 1733 // player = MAX-AXIS displacement, retarget = EUCLIDEAN norm: axis <= norm <= sqrt(3)*axis, a geometric identity
56const RG_TOC_BYTES: i64 = 32 // one TOC entry (nx_nxa.nx: 4 words)
57const RG_POSE_HDR_W: i64 = 3 // POSE payload over an EMPTY library: [count, pose_id, nentries] then 8 words per entry
58const RG_WPE: i64 = 8

functions

61func rg_call(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, buf: *u8, cap: i64, bl: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture_to
68func rg_num_after(buf: *u8, n: i64, key: *u8) -> i64
called by 1: main calls 2: gk_out_posgk_len
86func rg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
88func main(argc: i64, argv: *i64) -> i64