nx_twinfit_gate.nx
buildroot/runtime/nx_twinfit_gate.nx
about
nx_twinfit_gate.nx -- the referee for nx_twinfit_lib (aesthetictwin AT34 / AT35 / AT40, 2026-09-17). The target reader is held
to a planted file (five axes, a bogus axis row that must be ignored, an absent file that must read zero); the reach predicate
to both sides of its band; the level arithmetic to the declared ranges; the fit from stated landmarks; then the render lane on
the seed-42 identity whose render the outside oracle also judged: the in-process measurement places both eyes, the lip unit's
surface ratio agrees with its statement, and the same identity through the PNG door (nx_twinface's path) decodes to the
in-process render byte for byte and reproduces the in-process tilts and ratios exactly. The eye unit's landmark truth (AT39)
has its own gate, nx_twintruth_gate, since 2026-09-18: its fixed-step surface scans were 58% of this gate's runtime and the
whole no longer fitted the roster's per-gate deadline. AT44 (2026-09-18) holds the photo ruler on the same in-process render (no
new render) to the construction: its mouth landmarks against the lip unit's projected statement, its lip ratio (4909 permil before
AT44 against a constructed 612) within a pixel per line of the projected ratio, its canthi against the stated corners with neither
lateral canthus on its band's edge. Every phase prints its wall time. Values are printed with gv_kv.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.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
| 17 | const TG_DIR: *u8 = "/tmp/twinfit_gate" |
| 18 | const TG_TARGET_PATH: *u8 = "/tmp/twinfit_gate/target.axes" |
| 19 | const TG_ABSENT_PATH: *u8 = "/tmp/twinfit_gate/absent/none.axes" |
| 20 | const TG_PNG_PATH: *u8 = "/tmp/twinfit_gate/seed42.png" |
| 21 | const TG_TARGET_TEXT: *u8 = "# planted target: five axes and one bogus axis row the reader must ignore\naxis|canthal_tilt_R|76|33\naxis|canthal_tilt_L|91|18\naxis|nose_width|500|10\naxis|intercanthal_index|354|11\naxis|intercanthal_eq_fissure|1087|46\naxis|upper_over_lower_lip|607|130\n" |
| 22 | const TG_MODE755: i64 = 493 |
| 23 | const TG_MODE644: i64 = 420 |
| 24 | const TG_I64: i64 = 8 |
| 25 | const TG_PLANTED_AXES: i64 = 5 |
| 26 | const TG_TILT_R: i64 = 76 |
| 27 | const TG_TILT_R_ERR: i64 = 33 |
| 28 | const TG_TILT_L: i64 = 91 |
| 29 | const TG_ICI: i64 = 354 |
| 30 | const TG_ICF: i64 = 1087 |
| 31 | const TG_LIP: i64 = 607 |
| 32 | const TG_LIP_ERR: i64 = 130 |
| 33 | const TG_ENV_MIN: i64 = 90 |
| 34 | const TG_ENV_MAX: i64 = 110 |
| 35 | const TG_IN: i64 = 100 |
| 36 | const TG_TOUCH: i64 = 120 |
| 37 | const TG_TOUCH_ERR: i64 = 10 |
| 38 | const TG_ABOVE: i64 = 150 |
| 39 | const TG_BELOW: i64 = 50 |
| 40 | const TG_GENE_WIDTH: i64 = 0 |
| 41 | const TG_WIDTH_FLOOR: i64 = 85 |
| 42 | const TG_WIDTH_MID: i64 = 101 |
| 43 | const TG_WIDTH_CEIL: i64 = 118 |
| 44 | const TG_SEED: i64 = 42 |
| 45 | const TG_YAW: i64 = 0 |
| 47 | const TG_G_W: i64 = 89 |
| 48 | const TG_G_L: i64 = 96 |
| 49 | const TG_G_J: i64 = 100 |
| 50 | const TG_G_E: i64 = 108 |
| 51 | const TG_G_P: i64 = 109 |
| 52 | const TG_G_N: i64 = 105 |
| 53 | const TG_G_C: i64 = 106 |
| 54 | const TG_SKIN_R: i64 = 130 |
| 55 | const TG_SKIN_G: i64 = 98 |
| 56 | const TG_SKIN_B: i64 = 70 |
| 57 | const TG_ID_EYES: i64 = 3 |
| 73 | const TG_DECODE_SLOTS: i64 = 2 |
| 98 | const TG40_KNOWN_WIDTH: i64 = 108 // a planted genome the fit must recover the AXES of (not the genes: several genomes share axes) |
| 99 | const TG40_KNOWN_EYES: i64 = 94 |
| 100 | const TG40_KNOWN_TILT: i64 = 70 |
| 101 | const TG40_GENE_WIDTH: i64 = 0 |
| 102 | const TG40_GENE_JAW: i64 = 2 |
| 103 | const TG40_GENE_EYES: i64 = 3 |
| 104 | const TG40_GENE_LIPS: i64 = 4 |
| 105 | const TG40_GENE_NOSE: i64 = 5 |
| 106 | const TG40_TILT_ERR: i64 = 4 |
| 107 | const TG40_RATIO_ERR: i64 = 6 |
| 111 | const TG40_ICF_LATTICE_ERR: i64 = 24 |
| 112 | const TG40_FAR_TILT: i64 = 300 // thirty degrees: outside anything the tilt gene's declared range can state |
| 113 | const TG40_FAR_ERR: i64 = 5 |
| 114 | const TG40_LIP_TARGET: i64 = 607 |
| 115 | const TG40_LIP_ERR: i64 = 130 |
| 117 | const TG40_C_TILT_R: i64 = 80 |
| 118 | const TG40_C_TILT_L_IN: i64 = 80 |
| 119 | const TG40_C_TILT_L_OUT: i64 = 60 |
| 120 | const TG40_C_ICI: i64 = 350 |
| 121 | const TG40_C_ICF: i64 = 1100 |
| 122 | const TG40_T_TILT_R: i64 = 76 |
| 123 | const TG40_T_TILT_L: i64 = 91 |
| 124 | const TG40_T_ICI: i64 = 354 |
| 125 | const TG40_T_ICF: i64 = 1087 |
| 126 | const TG40_E_TILT_R: i64 = 33 |
| 127 | const TG40_E_TILT_L: i64 = 18 |
| 128 | const TG40_E_ICI: i64 = 11 |
| 129 | const TG40_E_ICF: i64 = 46 |
| 130 | const TG40_COST_IN: i64 = 32 // 4 + 11 + 4 + 13, every axis inside its band |
| 131 | const TG40_COST_OUT: i64 = 260 // the left tilt at 60 is 31 off, 13 beyond its band: 13 * 16 + 31 = 239, plus 4 + 4 + 13 |
| 132 | const TG40_OUTSIDE_X: i64 = 5000 // a point far outside any lid shell's silhouette |
| 133 | const TG44_LINES_PER_HEIGHT: i64 = 2 // a vermilion height runs between two lines (its outer border and the seam's edge), a pixel each |
functions
| 59 | func tg_write(path: *u8, text: *u8) -> i64 |
| 66 | func tg_same(a: *u8, b: *u8, n: i64) -> i64 called by 1: tg_same_or_absent |
| 74 | func tg_png_rgb(path: *u8, dw: *i64) -> *u8 |
| 93 | func tg_same_or_absent(a: *u8, b: *u8, n: i64) -> i64 |
| 135 | func tg_at40(ctr: *i64, vals: *i64) -> i64 called by 1: main calls 12: sys_mmapgv_check_eqtw_fit_costtw_axis_statetw_all_canon_filltw_build_all+6 |
| 188 | func main(argc: i64, argv: *i64) -> i64 |