code wiki / (root) / nx_twinfit.nx

nx_twinfit.nx

buildroot/runtime/nx_twinfit.nx

29863 B480 linesdepth 12pulls 64 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_twinfit.nx -- aesthetictwin AT34 (2026-09-17): THE TWIN LOOP'S FIRST RUNG, the reachable axis envelope. The photo ruler (nx_photomark_lib) reads a reference still and the estate's own face render through one instrument; this organ asks the question the fit loop stands on: over the morph basis the generator exposes today (nx_faceanat canon face + the seven persongen morphs), which of the card's scale-free axes can a render REACH at all? Each gene is swept to its declared floor, middle and ceiling with the others at middle (nx_twinfit_lib does the build, render and in-process measurement); per axis the min and max over the sweep is the envelope, and a target read from a file (rows axis|<name>|<value>|<err>) is REACHABLE when its error band meets the envelope, else UNREACHABLE -- which names the morph the generator is missing (the build order for AT29), never a fit that quietly stops short. nx_twinfit envelope [target-file] [skin_r skin_g skin_b] -> one row per render, one row per axis, a summary whose partition sums nx_twinfit axes <w> <l> <j> <e> <p> <n> <c> [skin_r skin_g skin_b] -> one render at those seven percents, its axes nx_twinfit truthref [seed_hi] [seed_lo] [sweep 1|0] -> AT39: the ruler judged per canthus against the render's own landmark truth (the 21-cell gene sweep, then persongen seeds 1..n), signed bias per landmark, a partition that sums; AT44: a TRUTHLIP line per render judging the ruler's five mouth landmarks against the lip unit's stated truth, with the mouth's own partition nx_twinfit fit <target-file> -> AT40: solve the seven morphs and six eye genes against a card's axes from the STATED landmarks (no render), name genes at a range limit, confirm on the surface nx_twinfit truth <w> <l> <j> <e> <p> <n> <c> -> AT39: no render; the built face is asked where its canthi are (reasons by name, model units, projected deci-pixels, asymmetry) The skin tone defaults to persongen's fair-medium family; passing one moves the render's albedo while the geometry stays, which is how the ruler's tone sensitivity on renders is measured rather than guessed. exit: 0 every render measured | 1 some render UNMEASURED (envelope partial, said so) | 2 usage | 3 cascades not loaded license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_twinfit_lib.nx nx_twinfit.nx

imports: nx_syscalls.nxnx_twinfit_lib.nx

imported by: nobody (leaf or entry point)

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

main twc_usage 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 ↻ tw_load_cascades sys_mmap ↻ ff_load_face hx_load sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close hx_parse hx_find hx_slen hx_skip_ws hx_is_ws hx_slen ↻ sys_mmap ↻ hx_tag_int hx_find ↻ hx_int hx_slen ↻

structs

none

consts

21const TWC_EXIT_USAGE: i64 = 2
22const TWC_EXIT_PARTIAL: i64 = 1
23const TWC_EXIT_NOCASCADE: i64 = 3
24const TWC_ARGC_ENVELOPE: i64 = 2
25const TWC_ARGC_ENVELOPE_TARGET: i64 = 3
26const TWC_ARGC_ENVELOPE_SKIN: i64 = 6
27const TWC_ARGC_AXES: i64 = 9
28const TWC_ARGC_AXES_SKIN: i64 = 12
29const TWC_ARGC_TRUTHSEED: i64 = 3
30const TWC_ARGC_FIT: i64 = 3
41const TWC_TR_SEEDS_DEFAULT: i64 = 8
42const TWC_ARGC_TRUTHREF_SEEDS: i64 = 3
43const TWC_ARGC_TRUTHREF_LO: i64 = 4
44const TWC_ARGC_TRUTHREF_SWEEP: i64 = 5
45const TWC_ACC_FIELDS: i64 = 2 // per landmark: the summed signed dx and dy
47const TWC_TAL_FOUND: i64 = 0
48const TWC_TAL_OFF: i64 = 1
49const TWC_TAL_UNMEASURED: i64 = 2
50const TWC_TAL_NOTRUTH: i64 = 3
51const TWC_TAL_NMAX_SUM: i64 = 4
52const TWC_TAL_TILT_ERR_SUM: i64 = 5
55const TWC_TAL_LIP_FOUND: i64 = 8
56const TWC_TAL_LIP_OFF: i64 = 9
57const TWC_TAL_LIP_UNMEASURED: i64 = 10
58const TWC_TAL_LIP_NOTRUTH: i64 = 11
59const TWC_TAL_LIP_NMEAN_SUM: i64 = 12
60const TWC_TAL_LIP_RATIO_ERR_SUM: i64 = 13
61const TWC_TAL_LIP_NMAX_SUM: i64 = 14
62const TWC_TAL_NME_LM: i64 = 16 // + k for canthus k
64const TWC_TAL_ALIP_FOUND: i64 = 20
65const TWC_TAL_ALIP_OFF: i64 = 21
66const TWC_TAL_ALIP_UNMEASURED: i64 = 22
67const TWC_TAL_ALIP_NMEAN_SUM: i64 = 23
68const TWC_TAL_ALIP_RATIO_ERR_SUM: i64 = 24
69const TWC_TAL_N: i64 = 28
70const TWC_LACC_FIELDS: i64 = 3 // per lip landmark: the summed signed dx, dy and the summed NME

functions

32func twc_usage() -> i64
called by 1: main
36func twc_print_skin(skin: *i64) -> i64
called by 1: main calls 1: tw_kv
71func twc_truth_row(base: i64, rc: i64, res: *i64, t: *i64, j: *i64, acc: *i64, tal: *i64) -> i64
110func twc_lip_anchored(base: i64, rgb: *u8, lt: *i64, lj: *i64, tal: *i64) -> i64
135func twc_lip_row(base: i64, rc: i64, res: *i64, lt: *i64, lj: *i64, lacc: *i64, tal: *i64) -> i64
175func twc_truthref(seed_lo: i64, seeds: i64, sweep: i64, base: i64, rgb: *u8, res: *i64, g: *i64, skin: *i64, face_c: *HaarCascade, eye_c: *HaarCascade) -> i64
246func main(argc: i64, argv: **u8) -> i64