code wiki / (root) / nx_targetfit_gate.nx

nx_targetfit_gate.nx

buildroot/runtime/nx_targetfit_gate.nx

10072 B141 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_targetfit_gate.nx -- proves the target-conformance ruler: bands, normalisation, abstention, drift. EVERY EXPECTED VALUE BELOW IS HAND arithmetic OVER THE PUBLISHED pg_bound TABLE, so a tooth that fails is either a ruler bug or a DELIBERATE bounds change -- and going RED on a bounds change is a feature, not brittleness: the plausible envelopes are supposed to move only by measurement, and a conformance ruler whose normalisation base moved deserves a red until someone re-adjudicates it. THE ONE TOOTH THAT JUSTIFIES THE WHOLE ORGAN IS T4: the SAME 55 mm miss reads 100 permil on total height and 647 permil on breast projection -- a shrug on one axis, a different body on the other. A percent-of-target ruler calls those equal. That is the commensurability the envelope normalisation buys, proven in one line of arithmetic.

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_canon_proportions.nx nx_proportion_guard.nx nx_targetfit.nx nx_gate_verdict.nx nx_targetfit_gate.nx

imports: nx_syscalls.nxnx_canon_proportions.nxnx_proportion_guard.nxnx_targetfit.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 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 ↻ gv_check gv_puts ↻ tg_eq2 tf_envelope pg_bound tg_eq tf_variance_permil tf_envelope ↻ tf_abs tg_eq3 tf_grade tg_arr sys_mmap ↻ tf_fit sys_mmap ↻ tf_axis_fit tf_variance_permil ↻ tf_grade ↻ sys_munmap gv_subjects

structs

none

consts

21const TG_ENV_HEIGHT: i64 = 550
22const TG_ENV_BPROJ: i64 = 85
23const TG_ENV_HIP: i64 = 180
24const TG_ENV_SHOULDER: i64 = 170
25const TG_TGT_HEIGHT: i64 = 1700
26const TG_TGT_HIP: i64 = 370
27const TG_TGT_SHOULDER: i64 = 380
28const TG_TGT_BPROJ: i64 = 60
30const TG_MISS_TIGHT: i64 = 11 // 11*1000/550 = 20 -> TIGHT
31const TG_MISS_SLIGHT: i64 = 55 // 55*1000/550 = 100 -> SLIGHT
32const TG_MISS_HIP_EDGE: i64 = 27 // 27*1000/180 = 150 -> SLIGHT, exactly on the edge
33const TG_MISS_SH_EDGE: i64 = 51 // 51*1000/170 = 300 -> MODERATE, exactly on the edge
34const TG_MISS_SH_OUT: i64 = 120 // 120*1000/170 = 705 -> OUTSIDE
35const TG_AXIS_UNKNOWN: i64 = 999 // no pg_bound row exists for this id
36const TG_N4: i64 = 4

functions

38func tg_arr(n: i64) -> *i64 { return sys_mmap(n * 8) as *i64 }
called by 1: main calls 1: sys_mmap
39func tg_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
40func tg_zero(a: i64) -> i64 { if a == 0 { return 1 } return 0 }
called by 1: main
41func tg_pos(a: i64) -> i64 { if a > 0 { return 1 } return 0 }
called by 1: main
42func tg_eq2(a: i64, b: i64, c: i64, d: i64) -> i64 { if a == b { if c == d { return 1 } } return 0 }
called by 1: main
43func tg_eq3(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64) -> i64
called by 1: main
47func main() -> i64