code wiki / (root) / nx_twinfit_gate.nx

nx_twinfit_gate.nx

buildroot/runtime/nx_twinfit_gate.nx

23505 B322 linesdepth 12pulls 65 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_twinfit_lib.nx nx_twinfit_gate.nx

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

main gv_head gv_puts sys_write 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 ↻ sys_mkdir sys_mmap ↻ gv_need gv_puts ↻ tg_write sys_openat_wr sys_write ↻ sys_close gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap tw_load_target tw_target_clear sys_mmap ↻ ri_load

structs

none

consts

17const TG_DIR: *u8 = "/tmp/twinfit_gate"
18const TG_TARGET_PATH: *u8 = "/tmp/twinfit_gate/target.axes"
19const TG_ABSENT_PATH: *u8 = "/tmp/twinfit_gate/absent/none.axes"
20const TG_PNG_PATH: *u8 = "/tmp/twinfit_gate/seed42.png"
21const 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"
22const TG_MODE755: i64 = 493
23const TG_MODE644: i64 = 420
24const TG_I64: i64 = 8
25const TG_PLANTED_AXES: i64 = 5
26const TG_TILT_R: i64 = 76
27const TG_TILT_R_ERR: i64 = 33
28const TG_TILT_L: i64 = 91
29const TG_ICI: i64 = 354
30const TG_ICF: i64 = 1087
31const TG_LIP: i64 = 607
32const TG_LIP_ERR: i64 = 130
33const TG_ENV_MIN: i64 = 90
34const TG_ENV_MAX: i64 = 110
35const TG_IN: i64 = 100
36const TG_TOUCH: i64 = 120
37const TG_TOUCH_ERR: i64 = 10
38const TG_ABOVE: i64 = 150
39const TG_BELOW: i64 = 50
40const TG_GENE_WIDTH: i64 = 0
41const TG_WIDTH_FLOOR: i64 = 85
42const TG_WIDTH_MID: i64 = 101
43const TG_WIDTH_CEIL: i64 = 118
44const TG_SEED: i64 = 42
45const TG_YAW: i64 = 0
47const TG_G_W: i64 = 89
48const TG_G_L: i64 = 96
49const TG_G_J: i64 = 100
50const TG_G_E: i64 = 108
51const TG_G_P: i64 = 109
52const TG_G_N: i64 = 105
53const TG_G_C: i64 = 106
54const TG_SKIN_R: i64 = 130
55const TG_SKIN_G: i64 = 98
56const TG_SKIN_B: i64 = 70
57const TG_ID_EYES: i64 = 3
73const TG_DECODE_SLOTS: i64 = 2
98const TG40_KNOWN_WIDTH: i64 = 108 // a planted genome the fit must recover the AXES of (not the genes: several genomes share axes)
99const TG40_KNOWN_EYES: i64 = 94
100const TG40_KNOWN_TILT: i64 = 70
101const TG40_GENE_WIDTH: i64 = 0
102const TG40_GENE_JAW: i64 = 2
103const TG40_GENE_EYES: i64 = 3
104const TG40_GENE_LIPS: i64 = 4
105const TG40_GENE_NOSE: i64 = 5
106const TG40_TILT_ERR: i64 = 4
107const TG40_RATIO_ERR: i64 = 6
111const TG40_ICF_LATTICE_ERR: i64 = 24
112const TG40_FAR_TILT: i64 = 300 // thirty degrees: outside anything the tilt gene's declared range can state
113const TG40_FAR_ERR: i64 = 5
114const TG40_LIP_TARGET: i64 = 607
115const TG40_LIP_ERR: i64 = 130
117const TG40_C_TILT_R: i64 = 80
118const TG40_C_TILT_L_IN: i64 = 80
119const TG40_C_TILT_L_OUT: i64 = 60
120const TG40_C_ICI: i64 = 350
121const TG40_C_ICF: i64 = 1100
122const TG40_T_TILT_R: i64 = 76
123const TG40_T_TILT_L: i64 = 91
124const TG40_T_ICI: i64 = 354
125const TG40_T_ICF: i64 = 1087
126const TG40_E_TILT_R: i64 = 33
127const TG40_E_TILT_L: i64 = 18
128const TG40_E_ICI: i64 = 11
129const TG40_E_ICF: i64 = 46
130const TG40_COST_IN: i64 = 32 // 4 + 11 + 4 + 13, every axis inside its band
131const 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
132const TG40_OUTSIDE_X: i64 = 5000 // a point far outside any lid shell's silhouette
133const 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

59func tg_write(path: *u8, text: *u8) -> i64
66func tg_same(a: *u8, b: *u8, n: i64) -> i64
called by 1: tg_same_or_absent
74func tg_png_rgb(path: *u8, dw: *i64) -> *u8
93func tg_same_or_absent(a: *u8, b: *u8, n: i64) -> i64
called by 1: main calls 1: tg_same
135func tg_at40(ctr: *i64, vals: *i64) -> i64
188func main(argc: i64, argv: *i64) -> i64