code wiki / _hdl_build / nx_myotable.nx

nx_myotable.nx

buildroot/runtime/_hdl_build/nx_myotable.nx

9318 B167 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_myotable.nx -- ★THE MUSCLE SET AS ONE TABLE, fail-closed, so the count can actually grow. ★THE DEFECT. nx_myoset describes each muscle across FOUR PARALLEL IF-CHAINS -- ms_origin, ms_insert, ms_peak, ms_name -- so adding one muscle means editing four functions and keeping them aligned by hand. nx_skelgen documented this exact shape for its joints: "the same 13 joints are described across sg_jparent, sg_jdx, sg_jdy, sg_jdz and the constraint pair, so adding a joint means editing six places." It is the third instance in this codebase and the cure has not changed: ONE TABLE. ★★AND A REAL FAIL-OPEN BUG, not just an ergonomic one: every chain ENDS IN AN UNGUARDED DEFAULT (`return 250`, `return "gastrocnemius"`). So ms_origin(999) answers 250 and ms_name(999) answers "gastrocnemius" -- ★A PHANTOM MUSCLE THAT LOOKS COMPLETELY REAL. Nothing anywhere says how many muscles exist, so no caller can even know it asked out of range. This table REFUSES instead. ⚠★★WHAT THIS DELIBERATELY DOES **NOT** DO: pad the count. The measured gap is ~18 modelled against ~700 named skeletal muscles, and it would be easy to type another twenty rows of plausible-looking attachment stations right here. This session convicted exactly that habit -- the shoulder width was half its true value because someone typed a number that looked reasonable -- so the mechanism ships with the EXISTING eight re-derived byte-exactly, and every future row must arrive SOURCED. ★The right source is already in hand: attachments should be DERIVED FROM BONE LANDMARKS that nx_skelgen emits, not typed -- the "attach relative to the parent" law this lane learned on the brow. nx_myotable selftest license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_gate_verdict.nx nx_myotable.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_ctr sys_mmap gv_head gv_puts sys_write mt_table mt_origin mt_ok mt_insert mt_ok ↻ mt_peak mt_ok ↻ gv_check gv_puts ↻ mt_nameid mt_ok ↻ mt_weight mt_ok ↻ mt_origin ↻ mt_insert ↻ mt_peak ↻ mt_count mt_ok ↻ mt_span mt_ok ↻ mt_origin ↻ mt_insert ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_verdict gv_puts ↻ gv_num ↻ gv_journal sys_openat_append sys_mmap ↻ gv_catn

structs

none

consts

26const MT_NM: i64 = 8 // muscles presently modelled -- the honest count, and it is QUERYABLE
27const MT_S: i64 = 4 // row stride: origin, insertion, peak, name-id
28const MT_BAD: i64 = 0 - 1 // the refusal value; distinct from every legitimate station

functions

32func mt_table(T: *i64) -> i64
called by 1: main
45func mt_count() -> i64 { return MT_NM }
called by 1: main
48func mt_ok(m: i64) -> i64 { if m < 0 { return 0 } if m >= MT_NM { return 0 } return 1 }
49func mt_origin(T: *i64, m: i64) -> i64 { if mt_ok(m)==0 { return MT_BAD } return T[m*MT_S] }
called by 3: mt_spanmt_weightmain calls 1: mt_ok
50func mt_insert(T: *i64, m: i64) -> i64 { if mt_ok(m)==0 { return MT_BAD } return T[m*MT_S+1] }
called by 3: mt_spanmt_weightmain calls 1: mt_ok
51func mt_peak(T: *i64, m: i64) -> i64 { if mt_ok(m)==0 { return MT_BAD } return T[m*MT_S+2] }
called by 2: mt_weightmain calls 1: mt_ok
52func mt_nameid(T: *i64, m: i64) -> i64 { if mt_ok(m)==0 { return MT_BAD } return T[m*MT_S+3] }
called by 1: main calls 1: mt_ok
54func mt_span(T: *i64, m: i64) -> i64
called by 1: main calls 3: mt_okmt_originmt_insert
62func mt_weight(T: *i64, m: i64, station: i64) -> i64
called by 1: main calls 4: mt_okmt_originmt_insertmt_peak
79func main(argc: i64, argv: *i64) -> i64