code wiki / _hdl_build / nx_anat_consistency_gate.nx

nx_anat_consistency_gate.nx

buildroot/runtime/_hdl_build/nx_anat_consistency_gate.nx

9391 B206 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic anat
docsdependenciesstructsconstsfunctions

about

nx_anat_consistency_gate.nx -- ★CROSS-ARTIFACT ANATOMY CHECK (2026-07-27). Two organs in this codebase independently describe where a human's joints are: nx_skelgen -- generates a rest skeleton from anthropometric rules, emits J rows in millimetres nx_bodyatlas -- a ZygoteBody-style peelable being with its OWN skeleton pivots, authored months earlier for an unrelated purpose ★★NOBODY HAD EVER COMPARED THEM, and on 2026-07-27 that cost was measured: nx_skelgen's acromion sat at 120 per-mille of stature while this atlas's own shoulder pivot sits at 206 -- a disagreement of about 150mm on a 1750mm body, shipped and green in both organs for as long as both existed. ★THE PRINCIPLE THIS ENFORCES is the one nx_skelgen already states about its own internals: two tables cannot disagree when there is only one table -- and where a second table is legitimate (a different representation for a different job), it must be CHECKED rather than trusted. Both sides are converted to PER-MILLE OF THEIR OWN STATURE first, so the comparison is scale-free and neither organ's unit system is privileged. ⚠WHAT THIS DOES **NOT** ASSERT: that the two must be identical. A shoulder JOINT CENTRE is legitimately inboard of an ACROMION, so the girdle check is a BRACKET (joint <= acromion <= bony outer edge), not an equality. Asserting equality there would force one of two correct numbers to become wrong. nx_anat_consistency_gate <skel.dat> (the file nx_skelgen writes) license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_bodyatlas.nx nx_gate_verdict.nx nx_anat_consistency_gate.nx

imports: nx_bodyatlas.nxnx_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 gv_puts ↻ ac_load_skel sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ac_tok ac_isdig ac_nextline 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 ↻ atlas_build ba_add

structs

none

consts

26const AC_MM: i64 = 1000
29const AC_TOL: i64 = 10
31const AC_BSHL: i64 = 1
32const AC_BSHR: i64 = 3
33const AC_BHIPL: i64 = 5
34const AC_BHIPR: i64 = 7
35const AC_BKNEEL: i64 = 6
36const AC_BKNEER: i64 = 8
38const AC_JACR: i64 = 5
39const AC_JHIP: i64 = 9
40const AC_JKNEE: i64 = 10
41const AC_MAXJ: i64 = 64

functions

43func ac_iabs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
44func ac_isdig(c: i64) -> i64 { if c >= 48 { if c <= 57 { return 1 } } return 0 }
called by 1: ac_tok
45func ac_tok(b: *u8, n: i64, p: *i64, out: *i64) -> i64
called by 1: ac_load_skel calls 1: ac_isdig
72func ac_nextline(b: *u8, n: i64, p: *i64) -> i64
called by 1: ac_load_skel
82func ac_load_skel(path: *u8, JX: *i64, JY: *i64, JZ: *i64) -> i64
called by 1: main calls 3: sys_read_fileac_tokac_nextline
121func ac_skel_stature(JY: *i64, nj: i64) -> i64
called by 1: main
128func main(argc: i64, argv: *i64) -> i64