nx_twinfit.nx
buildroot/runtime/nx_twinfit.nx
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
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
structs
| none |
consts
| 21 | const TWC_EXIT_USAGE: i64 = 2 |
| 22 | const TWC_EXIT_PARTIAL: i64 = 1 |
| 23 | const TWC_EXIT_NOCASCADE: i64 = 3 |
| 24 | const TWC_ARGC_ENVELOPE: i64 = 2 |
| 25 | const TWC_ARGC_ENVELOPE_TARGET: i64 = 3 |
| 26 | const TWC_ARGC_ENVELOPE_SKIN: i64 = 6 |
| 27 | const TWC_ARGC_AXES: i64 = 9 |
| 28 | const TWC_ARGC_AXES_SKIN: i64 = 12 |
| 29 | const TWC_ARGC_TRUTHSEED: i64 = 3 |
| 30 | const TWC_ARGC_FIT: i64 = 3 |
| 41 | const TWC_TR_SEEDS_DEFAULT: i64 = 8 |
| 42 | const TWC_ARGC_TRUTHREF_SEEDS: i64 = 3 |
| 43 | const TWC_ARGC_TRUTHREF_LO: i64 = 4 |
| 44 | const TWC_ARGC_TRUTHREF_SWEEP: i64 = 5 |
| 45 | const TWC_ACC_FIELDS: i64 = 2 // per landmark: the summed signed dx and dy |
| 47 | const TWC_TAL_FOUND: i64 = 0 |
| 48 | const TWC_TAL_OFF: i64 = 1 |
| 49 | const TWC_TAL_UNMEASURED: i64 = 2 |
| 50 | const TWC_TAL_NOTRUTH: i64 = 3 |
| 51 | const TWC_TAL_NMAX_SUM: i64 = 4 |
| 52 | const TWC_TAL_TILT_ERR_SUM: i64 = 5 |
| 55 | const TWC_TAL_LIP_FOUND: i64 = 8 |
| 56 | const TWC_TAL_LIP_OFF: i64 = 9 |
| 57 | const TWC_TAL_LIP_UNMEASURED: i64 = 10 |
| 58 | const TWC_TAL_LIP_NOTRUTH: i64 = 11 |
| 59 | const TWC_TAL_LIP_NMEAN_SUM: i64 = 12 |
| 60 | const TWC_TAL_LIP_RATIO_ERR_SUM: i64 = 13 |
| 61 | const TWC_TAL_LIP_NMAX_SUM: i64 = 14 |
| 62 | const TWC_TAL_NME_LM: i64 = 16 // + k for canthus k |
| 64 | const TWC_TAL_ALIP_FOUND: i64 = 20 |
| 65 | const TWC_TAL_ALIP_OFF: i64 = 21 |
| 66 | const TWC_TAL_ALIP_UNMEASURED: i64 = 22 |
| 67 | const TWC_TAL_ALIP_NMEAN_SUM: i64 = 23 |
| 68 | const TWC_TAL_ALIP_RATIO_ERR_SUM: i64 = 24 |
| 69 | const TWC_TAL_N: i64 = 28 |
| 70 | const TWC_LACC_FIELDS: i64 = 3 // per lip landmark: the summed signed dx, dy and the summed NME |
functions
| 32 | func twc_usage() -> i64 called by 1: main |
| 36 | func twc_print_skin(skin: *i64) -> i64 |
| 71 | func twc_truth_row(base: i64, rc: i64, res: *i64, t: *i64, j: *i64, acc: *i64, tal: *i64) -> i64 |
| 110 | func twc_lip_anchored(base: i64, rgb: *u8, lt: *i64, lj: *i64, tal: *i64) -> i64 called by 1: twc_truthref calls 7: sys_mmaptw_stated_landmarkspm_mouth_anchoredpm_mouth_why_nametw_lip_judgetw_kv+1 |
| 135 | func twc_lip_row(base: i64, rc: i64, res: *i64, lt: *i64, lj: *i64, lacc: *i64, tal: *i64) -> i64 called by 1: twc_truthref calls 7: tw_lip_truthtw_print_lip_truthtw_kvpm_mouth_why_nametw_lip_landmark_nametw_lip_judge+1 |
| 175 | func 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 |
| 246 | func main(argc: i64, argv: **u8) -> i64 |