code wiki / _hdl_build / nx_myoattach.nx

nx_myoattach.nx

buildroot/runtime/_hdl_build/nx_myoattach.nx

21920 B405 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_myoattach.nx -- ★MUSCLE ATTACHMENTS DERIVED FROM BONE LANDMARKS, never typed. ★THE LAW THIS APPLIES, learned in this lane on the brow ridge: "NEVER TYPE A PLACEMENT COORDINATE THAT THE PARENT ALREADY KNOWS." A muscle does not have a height; it has ATTACHMENTS -- an origin on one bone and an insertion on another -- and its height is a CONSEQUENCE of where those bones are. nx_myotable still carries typed per-mille stations, which means every future muscle is another opportunity to type a plausible-looking number. This session already measured what that costs: the biacromial breadth sat at 52% of its true value for the life of the organ because it was typed. ★★THE MECHANISM THAT MAKES ~700 MUSCLES REACHABLE WITHOUT 700 GUESSES: an attachment is (joint_a, joint_b, t) -- a point t per-mille of the way along the bone spanning two joints that nx_skelgen ALREADY EMITS. So an attachment is specified ANATOMICALLY ("the proximal third of the humerus") and its coordinate is derived, at any stature, any sex, scale-free, forever. Typing stops being possible for the quantity that was being got wrong. ⚠AND IT IS A CROSS-ARTIFACT CHECK, which is why it earns its place now rather than later: the derived station and nx_myoset's typed station are two independent statements about the same muscle. This organ REPORTS the disagreement per muscle. Per the lane's law, a disagreement NAMES A NUMBER TO GO LOOK UP -- it does not tell you which side is wrong -- so the teeth here are on the MECHANISM and the disagreements are emitted as EVIDENCE, never silently "corrected". nx_myoattach report <skel.dat> nx_myoattach selftest <skel.dat> license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_gate_verdict.nx nx_myoattach.nx

imports: nx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_puts sys_write ma_load sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close ma_tok ma_isdig ma_nextline ma_table gv_ctr sys_mmap ↻ gv_head gv_puts ↻ gv_check gv_puts ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close ↻ sys_munmap ↻ ma_point

structs

none

consts

26const MA_MAGIC_2100: i64 = 2100
27const MA_MAGIC_1750: i64 = 1750
29const MA_MAXJ: i64 = 64
30const MA_MM: i64 = 1000
31const MA_NM: i64 = 21
32const MA_TYPED: i64 = 8 // the first 8 have typed counterparts in nx_myoset; the rest are new
33const MA_S: i64 = 8 // muscle row: o_ja, o_jb, o_t, i_ja, i_jb, i_t, peak, ACTUATED JOINT
42const MA_INVALID: i64 = 0 - 1
44const J_HIP: i64 = 0
45const J_L5: i64 = 1
46const J_C7: i64 = 2
47const J_ACR: i64 = 5
48const J_ELB: i64 = 6
49const J_WRI: i64 = 7
50const J_HIPJ: i64 = 9
51const J_KNEE: i64 = 10
52const J_ANK: i64 = 11
53const J_TOE: i64 = 12
54const J_HEEL: i64 = 13
55const J_ATLAS: i64 = 3
56const J_VTX: i64 = 4
57const J_HAND: i64 = 8

functions

59func ma_iabs(v: i64) -> i64 { if v < 0 { return 0-v } return v }
called by 2: ma_reportmain
60func ma_isdig(c: i64) -> i64 { if c >= 48 { if c <= 57 { return 1 } } return 0 }
called by 1: ma_tok
61func ma_tok(b: *u8, n: i64, p: *i64, out: *i64) -> i64
called by 1: ma_load calls 1: ma_isdig
88func ma_nextline(b: *u8, n: i64, p: *i64) -> i64
called by 1: ma_load
96func ma_load(path: *u8, JY: *i64, JP: *i64) -> i64
called by 1: main calls 3: sys_read_filema_tokma_nextline
130func ma_table(M: *i64) -> i64
called by 1: main
166func ma_depth(JP: *i64, j: i64) -> i64
called by 1: ma_valid
185func ma_valid(JP: *i64, M: *i64, m: i64) -> i64
called by 1: main calls 1: ma_depth
199func ma_point(JY: *i64, ja: i64, jb: i64, t: i64) -> i64
204func ma_origin(JY: *i64, M: *i64, m: i64) -> i64 { return ma_point(JY, M[m*MA_S], M[m*MA_S+1], M[m*MA_S+2]) }
called by 2: ma_reportmain calls 1: ma_point
205func ma_insert(JY: *i64, M: *i64, m: i64) -> i64 { return ma_point(JY, M[m*MA_S+3], M[m*MA_S+4], M[m*MA_S+5]) }
called by 2: ma_reportmain calls 1: ma_point
207func ma_permil(v: i64, stature: i64) -> i64 { if stature <= 0 { return 0 } return v * MA_MM / stature }
called by 2: ma_reportmain
209func ma_typed_o(m: i64) -> i64
called by 2: ma_reportmain
214func ma_typed_i(m: i64) -> i64
called by 1: ma_report
219func ma_name(m: i64) -> *u8
called by 1: ma_report
243func ma_report(JY: *i64, M: *i64, stature: i64) -> i64
275func main(argc: i64, argv: *i64) -> i64