nx_twintruth_gate.nx source
↩ module page · 270 lines · 19846 B
1// nx_twintruth_gate.nx -- the referee for the eye unit's landmark truth in nx_twinfit_lib (aesthetictwin AT39, 2026-09-17; split
2// out of nx_twinfit_gate 2026-09-18). The projection is held to the renderer's own ray set-up; the canon face has truth on both
3// eyes, mirrored about the frame centre, tilted as the canon gene says and confirmed on the surface inside the corner window; the
4// eye genes leave the canon untouched, move the truth with the tilt gene and break the mirror with the difference gene; a face
5// without lid shells has no truth and says why by name; seed 42 keeps its identity and its eye genes; the judge scores a planted
6// ruler against planted truth. WHY A GATE OF ITS OWN: the truth scans march the surface at a fixed two-unit step because the
7// lid-shell field is steep and discontinuous at the canthus (a distance-stepped march could skip the thin lid), so these teeth
8// cost more than the rest of the twin loop together -- measured 13.3 s of a 22.8 s laptop run, 178 s on the NAS against the
9// roster's 180 s per-gate deadline. One subject per gate lets each fit the roster. AT44 (2026-09-18) adds the MOUTH's truth and
10// judge, which cost a few surface marches and no render (17 ms on the laptop): the lip judge exact on a planted case with a decoy
11// in the stated-ratio slot, and the canon face's five lip points in anatomical order, the stomion on the lip sweep's front (the seam
12// is seen at its opening, not its slit floor) and the vermilion lines on the marched surface. Values are printed with gv_kv.
13// license_tier: ORIGINAL No hw writes (Rule 26).
14import "nx_syscalls.nx"
15import "nx_gate_verdict.nx"
16import "nx_twinfit_lib.nx"
17
18const TG_I64: i64 = 8
19// seed 42's identity as persongen_build derives it (the render the outside oracle judged): the width and cheek morphs bracket the
20// seven, and the tone; the eye genes are drawn after them, so seed 42 must still be seed 42
21const TG_G_W: i64 = 89
22const TG_G_C: i64 = 106
23const TG_SKIN_R: i64 = 130
24const TG_SKIN_G: i64 = 98
25const TG_SKIN_B: i64 = 70
26// ---- AT39: the eye unit, its genes, the render's own landmark truth, the judge -------------------------------------------------
27const TG39_CANON_PCT: i64 = 100
28const TG39_PAGE: i64 = 4096
29const TG39_PROJ_PX: i64 = 1000 // a planted model point right of and above the axis, at the origin plane
30const TG39_PROJ_PY: i64 = 500
31const TG39_PROJ_X_DECI: i64 = 3985 // 10*HW + 10*FOCAL*1000/4096 - 5 = 2560 + 1430 - 5
32const TG39_PROJ_Y_DECI: i64 = 1200 // 10*HH - 10*FOCAL*500/4096 - 5 = 1920 - 715 - 5
33const TG39_BEHIND_Z: i64 = 0 - 5000 // behind a camera that stands 4096 in front of the origin
34const TG39_TILT_TOL: i64 = 10 // one degree: the scan step and the perspective of a corner that sits back from the apex
35const TG39_TILT_HIGH: i64 = 90
36const TG39_DTILT: i64 = 10
37const TG39_PRE_LID_PARTS: i64 = 27
38const TG39_SEED: i64 = 42
39const TG39_SEED_TILT: i64 = 97 // seed 42's eye genes as the stream draws them after the seven morphs and the tone
40const TG39_SEED_OPEN: i64 = 104
41const TG39_SEED_WIDTH: i64 = 98
42const TG39_SEED_UPSHARE: i64 = 597
43const TG39_SEED_DTILT: i64 = 0 - 5
44const TG39_SEED_DOPEN: i64 = 0 - 4
45// the judge's planted case: round truth, a ruler that is exact on three canthi and off by (+3, -2) px on the right medial one
46const TG39_J_EXO: i64 = 1500
47// the planted truth (deci-pixels, one shared row) and the planted ruler reading (pixels): exact on three canthi, off on the right medial
48const TG39_J_T_RLAT_X: i64 = 1000
49const TG39_J_T_RMED_X: i64 = 1500
50const TG39_J_T_LMED_X: i64 = 2000
51const TG39_J_T_LLAT_X: i64 = 2500
52const TG39_J_T_ROW_Y: i64 = 1000
53const TG39_J_R_RLAT_X: i64 = 100
54const TG39_J_R_RMED_X: i64 = 153
55const TG39_J_R_LMED_X: i64 = 200
56const TG39_J_R_LLAT_X: i64 = 250
57const TG39_J_R_ROW_Y: i64 = 100
58const TG39_J_R_RMED_Y: i64 = 98
59const TG39_J_DX: i64 = 30
60const TG39_J_DY: i64 = 0 - 20
61const TG39_J_NME: i64 = 24 // isqrt(30*30 + 20*20) = 36 deci-px; 36 * 1000 / 1500
62const TG39_J_NMEAN: i64 = 6 // 24 / 4
63
64// ---- AT44: the mouth's truth and its judge -------------------------------------------------------------------------------------
65// the lip judge's planted case: a round truth (deci-pixels) and a ruler (pixels) exact on three landmarks, labrale inferius 3 px low
66// and the image-right cheilion 4 px wide; a DECOY 9999 sits in the stated-ratio slot, which no NME may be normalised by
67const TG44_T_MID_X: i64 = 1000
68const TG44_T_LS_Y: i64 = 900
69const TG44_T_STO_Y: i64 = 1000
70const TG44_T_LI_Y: i64 = 1150
71const TG44_T_CHR_X: i64 = 800
72const TG44_T_CHL_X: i64 = 1200
73const TG44_T_EXO: i64 = 1500
74const TG44_T_RATIO_PIXEL: i64 = 667 // (1000 - 900) over (1150 - 1000)
75const TG44_DECOY: i64 = 9999
76const TG44_R_MID_X: i64 = 100
77const TG44_R_LS_Y: i64 = 90
78const TG44_R_STO_Y: i64 = 100
79const TG44_R_LI_Y: i64 = 118
80const TG44_R_CHR_X: i64 = 80
81const TG44_R_CHL_X: i64 = 124
82const TG44_R_LIP: i64 = 555
83const TG44_J_LI_DY: i64 = 30 // 118 px is 1180 deci against 1150
84const TG44_J_LI_NME: i64 = 20 // 30 * 1000 / 1500
85const TG44_J_CHL_DX: i64 = 40
86const TG44_J_CHL_NME: i64 = 26 // 40 * 1000 / 1500
87const TG44_J_NMEAN: i64 = 9 // (0 + 0 + 20 + 0 + 26) / 5
88const TG44_LI_SLOT: i64 = 2 // labrale inferius is the third landmark of the judge's record
89const TG44_CHL_SLOT: i64 = 4
90func tg44_judge(ctr: *i64, vals: *i64) -> i64 {
91 let lt: *i64 = sys_mmap(TW_LT_N * TG_I64) as *i64
92 let lj: *i64 = sys_mmap(TW_LJ_N * TG_I64) as *i64
93 let res: *i64 = sys_mmap(PM_R_N * TG_I64) as *i64
94 lt[TW_LT_LS_X] = TG44_T_MID_X; lt[TW_LT_LS_X + 1] = TG44_T_LS_Y
95 lt[TW_LT_STO_X] = TG44_T_MID_X; lt[TW_LT_STO_X + 1] = TG44_T_STO_Y
96 lt[TW_LT_LI_X] = TG44_T_MID_X; lt[TW_LT_LI_X + 1] = TG44_T_LI_Y
97 lt[TW_LT_CHR_X] = TG44_T_CHR_X; lt[TW_LT_CHR_X + 1] = TG44_T_STO_Y
98 lt[TW_LT_CHL_X] = TG44_T_CHL_X; lt[TW_LT_CHL_X + 1] = TG44_T_STO_Y
99 lt[TW_LT_EXO] = TG44_T_EXO
100 lt[TW_LT_RATIO_PIXEL] = TG44_T_RATIO_PIXEL
101 lt[TW_LT_RATIO_STATED] = TG44_DECOY
102 res[PM_R_LS_X] = TG44_R_MID_X; res[PM_R_LS_Y] = TG44_R_LS_Y
103 res[PM_R_STO_X] = TG44_R_MID_X; res[PM_R_STO_Y] = TG44_R_STO_Y
104 res[PM_R_LI_X] = TG44_R_MID_X; res[PM_R_LI_Y] = TG44_R_LI_Y
105 res[PM_R_CHR_X] = TG44_R_CHR_X; res[PM_R_CHR_Y] = TG44_R_STO_Y
106 res[PM_R_CHL_X] = TG44_R_CHL_X; res[PM_R_CHL_Y] = TG44_R_STO_Y
107 res[PM_R_LIP] = TG44_R_LIP
108 gv_check_eq("lip-judge-worst-nme-is-the-wide-cheilion" as *u8, tw_lip_judge(res, lt, lj), TG44_J_CHL_NME, ctr)
109 gv_check_eq("lip-judge-signed-dy-of-a-low-labrale-inferius" as *u8, lj[TG44_LI_SLOT * TW_J_FIELDS + TW_J_DY], TG44_J_LI_DY, ctr)
110 gv_check_eq("lip-judge-nme-of-labrale-inferius-over-the-truth-span-not-the-decoy" as *u8, lj[TG44_LI_SLOT * TW_J_FIELDS + TW_J_NME], TG44_J_LI_NME, ctr)
111 gv_check_eq("lip-judge-signed-dx-of-a-wide-cheilion" as *u8, lj[TG44_CHL_SLOT * TW_J_FIELDS + TW_J_DX], TG44_J_CHL_DX, ctr)
112 gv_check_eq("lip-judge-mean-nme" as *u8, lj[TW_LJ_NMEAN], TG44_J_NMEAN, ctr)
113 gv_check_eq("lip-judge-carries-the-ruler-ratio" as *u8, lj[TW_LJ_RATIO_RULER], TG44_R_LIP, ctr)
114 gv_check_eq("lip-judge-holds-it-to-the-projected-ratio-not-the-stated" as *u8, lj[TW_LJ_RATIO_TRUTH], TG44_T_RATIO_PIXEL, ctr)
115 gv_check_eq("neg-control-lip-judge-exact-stomion-reads-zero" as *u8, lj[TW_J_FIELDS + TW_J_NME], 0, ctr)
116 vals[0] = lj[TW_LJ_NMAX]
117 return 0
118}
119// the canon face's lip truth: five points in their anatomical order, the stated ratio carried unchanged, the stomion and commissures
120// on the lip sweep's own front (the seam is seen at its opening), the vermilion lines on the surface the march finds
121func tg44_truth(ctr: *i64, vals: *i64) -> i64 {
122 let base: i64 = sys_mmap(sdf_bytes()) as i64
123 let g: *i64 = sys_mmap(TW_SLOTS * TG_I64) as *i64
124 let lt: *i64 = sys_mmap(TW_LT_N * TG_I64) as *i64
125 let ls: *i64 = sys_mmap(FA_LS_O_FIELDS * TG_I64 + FA_LIP_SLACK) as *i64
126 var k: i64 = 0
127 while k < TW_GENES { g[k] = TG39_CANON_PCT; k = k + 1 }
128 tw_build(base, g)
129 gv_check_eq("canon-face-has-lip-truth" as *u8, tw_lip_truth(base, TW_YAW_FRONTAL, lt), 1, ctr)
130 gv_check("canon-labrale-superius-above-the-stomion-above-labrale-inferius" as *u8, ((lt[TW_LT_LS_X + 1] < lt[TW_LT_STO_X + 1]) as i64) * ((lt[TW_LT_STO_X + 1] < lt[TW_LT_LI_X + 1]) as i64), ctr)
131 gv_check("canon-cheilions-either-side-of-the-stomion" as *u8, ((lt[TW_LT_CHR_X] < lt[TW_LT_STO_X]) as i64) * ((lt[TW_LT_STO_X] < lt[TW_LT_CHL_X]) as i64), ctr)
132 gv_check_eq("canon-midline-landmarks-share-a-column" as *u8, lt[TW_LT_LS_X] + lt[TW_LT_LI_X], 2 * lt[TW_LT_STO_X], ctr)
133 gv_check_eq("canon-cheilions-share-a-row" as *u8, lt[TW_LT_CHR_X + 1], lt[TW_LT_CHL_X + 1], ctr)
134 gv_check_eq("canon-cheilions-mirror-about-the-stomion" as *u8, lt[TW_LT_CHR_X] + lt[TW_LT_CHL_X], 2 * lt[TW_LT_STO_X], ctr)
135 fa_lip_stated(base, ls)
136 gv_check_eq("canon-stated-ratio-is-the-lip-units-own" as *u8, lt[TW_LT_RATIO_STATED], ls[FA_LS_O_RATIO], ctr)
137 let mst: i64 = TW_LT_MODEL + (TW_LT_STO_X / TW_XY) * TW_LT_MODEL_FIELDS
138 let mls: i64 = TW_LT_MODEL + (TW_LT_LS_X / TW_XY) * TW_LT_MODEL_FIELDS
139 gv_check_eq("canon-stomion-on-the-lip-sweeps-front-not-the-slit-floor" as *u8, lt[mst + 2], tw_lip_seam_z(base, 0), ctr)
140 gv_check("neg-control-the-slit-floor-lies-behind-that-front" as *u8, (fa_surface_z(base, lt[mst], lt[mst + 1]) > lt[mst + 2]) as i64, ctr)
141 gv_check_eq("canon-labrale-superius-on-the-marched-surface" as *u8, lt[mls + 2], fa_surface_z(base, lt[mls], lt[mls + 1]), ctr)
142 gv_check("canon-projected-ratio-positive" as *u8, (lt[TW_LT_RATIO_PIXEL] > 0) as i64, ctr)
143 vals[0] = lt[TW_LT_RATIO_STATED]; vals[1] = lt[TW_LT_RATIO_PIXEL]; vals[2] = lt[mst + 2]; vals[3] = fa_surface_z(base, lt[mst], lt[mst + 1])
144 return 0
145}
146func tg39_canon_genes(g: *i64) -> i64 { var k: i64 = 0; while k < TW_GENES { g[k] = TG39_CANON_PCT; k = k + 1 } return 0 }
147func tg39_canon_eye(eg: *i64) -> i64 { var k: i64 = 0; while k < FA_EG_N { eg[k] = fa_eye_gene_canon(k); k = k + 1 } return 0 }
148func tg_at39(ctr: *i64, vals: *i64) -> i64 {
149 let base: i64 = sys_mmap(sdf_bytes()) as i64
150 let g: *i64 = sys_mmap(TW_SLOTS * TG_I64) as *i64
151 let t: *i64 = sys_mmap(TW_T_N * TG_I64) as *i64
152 let t2: *i64 = sys_mmap(TW_T_N * TG_I64) as *i64
153 let j: *i64 = sys_mmap(TW_J_N * TG_I64) as *i64
154 let p2: *i64 = sys_mmap(TW_XY * TG_I64) as *i64
155 let eg: *i64 = sys_mmap(FA_EG_N * TG_I64) as *i64
156 let centre_x: i64 = TW_DECI * HW - TW_PIX_CENTRE_DECI
157 // the projection is the inverse of the renderer's ray set-up
158 gv_check_eq("project-the-origin-is-in-front-of-the-camera" as *u8, tw_project(0, 0, 0, TW_YAW_FRONTAL, p2), 1, ctr)
159 gv_check_eq("project-the-origin-lands-on-the-frame-centre-x" as *u8, p2[0], centre_x, ctr)
160 gv_check_eq("project-the-origin-lands-on-the-frame-centre-y" as *u8, p2[1], TW_DECI * HH - TW_PIX_CENTRE_DECI, ctr)
161 tw_project(TG39_PROJ_PX, TG39_PROJ_PY, 0, TW_YAW_FRONTAL, p2)
162 gv_check_eq("project-planted-point-x-deci" as *u8, p2[0], TG39_PROJ_X_DECI, ctr)
163 gv_check_eq("project-planted-point-y-deci-up-is-a-smaller-row" as *u8, p2[1], TG39_PROJ_Y_DECI, ctr)
164 gv_check_eq("neg-control-a-point-behind-the-camera-does-not-project" as *u8, tw_project(0, 0, TG39_BEHIND_Z, TW_YAW_FRONTAL, p2), 0, ctr)
165 // the arena grew by one table and still fits the page count its old size rounded up to
166 gv_check_eq("arena-with-the-primitive-table-fits-the-old-page-count" as *u8, (sdf_bytes() + TG39_PAGE - 1) / TG39_PAGE, (O_PRIM + TG39_PAGE - 1) / TG39_PAGE, ctr)
167 // the canon face: both eyes have truth, mirrored about the frame centre, tilted as the canon gene says, surface-confirmed
168 tg39_canon_genes(g)
169 tw_build(base, g)
170 gv_check_eq("canon-face-has-landmark-truth-on-both-eyes" as *u8, tw_truth_landmarks(base, TW_YAW_FRONTAL, t), 1, ctr)
171 gv_check_eq("canon-lateral-canthi-mirror-about-the-frame-centre" as *u8, t[TW_T_RLAT_X] + t[TW_T_LLAT_X], 2 * centre_x, ctr)
172 gv_check_eq("canon-medial-canthi-mirror-about-the-frame-centre" as *u8, t[TW_T_RMED_X] + t[TW_T_LMED_X], 2 * centre_x, ctr)
173 gv_check_eq("canon-lateral-canthi-share-a-row" as *u8, t[TW_T_RLAT_Y], t[TW_T_LLAT_Y], ctr)
174 gv_check_near("canon-right-tilt-is-the-canon-gene" as *u8, t[TW_T_TILT_R], FA_EG_TILT_CANON, TG39_TILT_TOL, ctr)
175 gv_check_near("canon-left-tilt-is-the-canon-gene" as *u8, t[TW_T_TILT_L], FA_EG_TILT_CANON, TG39_TILT_TOL, ctr)
176 gv_check("canon-surface-confirms-the-stated-corners-within-the-window" as *u8, ((t[TW_T_MODEL_R + TW_TM_GAP] <= FA_PF_CORNER_WINDOW) as i64) * ((t[TW_T_MODEL_L + TW_TM_GAP] <= FA_PF_CORNER_WINDOW) as i64), ctr)
177 gv_check_eq("canon-face-is-mirrored-asymmetry-zero" as *u8, t[TW_T_ASYM_PERMIL], 0, ctr)
178 let canon_tilt: i64 = t[TW_T_TILT_R]
179 let canon_gap_r: i64 = t[TW_T_MODEL_R + TW_TM_GAP]
180 // the eye genes: the canon vector changes nothing, the tilt gene moves the truth, the difference gene breaks the mirror
181 let halfw0: i64 = sdf_get_prim(base, FA_LID_R, SDF_PR_HALFW)
182 let up0: i64 = sdf_get_prim(base, FA_LID_R, SDF_PR_UP)
183 let low0: i64 = sdf_get_prim(base, FA_LID_R, SDF_PR_LOW)
184 tg39_canon_eye(eg)
185 faceanat_eye_genes(base, eg)
186 gv_check_eq("canon-eye-genes-leave-the-opening-half-width" as *u8, sdf_get_prim(base, FA_LID_R, SDF_PR_HALFW), halfw0, ctr)
187 gv_check_eq("canon-eye-genes-leave-the-upper-rise" as *u8, sdf_get_prim(base, FA_LID_R, SDF_PR_UP), up0, ctr)
188 gv_check_eq("canon-eye-genes-leave-the-lower-drop" as *u8, sdf_get_prim(base, FA_LID_R, SDF_PR_LOW), low0, ctr)
189 tw_truth_landmarks(base, TW_YAW_FRONTAL, t2)
190 gv_check_eq("canon-eye-genes-leave-the-truth-tilt" as *u8, t2[TW_T_TILT_R], canon_tilt, ctr)
191 tw_build(base, g)
192 tg39_canon_eye(eg)
193 eg[FA_EG_TILT] = TG39_TILT_HIGH
194 faceanat_eye_genes(base, eg)
195 gv_check_eq("tilted-face-still-has-truth" as *u8, tw_truth_landmarks(base, TW_YAW_FRONTAL, t2), 1, ctr)
196 gv_check_near("tilt-gene-moves-the-truth-to-the-gene" as *u8, t2[TW_T_TILT_R], TG39_TILT_HIGH, TG39_TILT_TOL, ctr)
197 gv_check("tilt-gene-raises-the-truth-above-the-canon" as *u8, (t2[TW_T_TILT_R] > canon_tilt) as i64, ctr)
198 let high_tilt: i64 = t2[TW_T_TILT_R]
199 tw_build(base, g)
200 tg39_canon_eye(eg)
201 eg[FA_EG_DTILT] = TG39_DTILT
202 faceanat_eye_genes(base, eg)
203 tw_truth_landmarks(base, TW_YAW_FRONTAL, t2)
204 gv_check("difference-gene-breaks-the-mirror-asymmetry-above-zero" as *u8, (t2[TW_T_ASYM_PERMIL] > 0) as i64, ctr)
205 gv_check("difference-gene-tilts-the-two-eyes-apart" as *u8, (t2[TW_T_TILT_R] != t2[TW_T_TILT_L]) as i64, ctr)
206 let asym: i64 = t2[TW_T_ASYM_PERMIL]
207 // neg-control: the face without its lid shells has no lid margin, so it has no canthus and says so by name
208 tw_build(base, g)
209 let nb: *i64 = (base + O_NPART) as *i64
210 nb[0] = TG39_PRE_LID_PARTS
211 gv_check_eq("neg-control-a-face-without-lid-shells-has-no-truth" as *u8, tw_truth_landmarks(base, TW_YAW_FRONTAL, t2), 0, ctr)
212 gv_check_eq("neg-control-and-the-reason-is-no-aperture-by-name" as *u8, t2[TW_T_REASON_R], FA_PF_R_NO_APERTURE, ctr)
213 // the identity stream: the new genes are drawn AFTER every earlier draw, so seed 42 is still seed 42
214 let skin: *i64 = sys_mmap(TW_SLOTS * TG_I64) as *i64
215 let idv: *i64 = sys_mmap(TW_SLOTS * TG_I64) as *i64
216 persongen_build_eye(base, TG39_SEED, skin, idv, eg)
217 gv_check_eq("seed42-keeps-its-width-morph" as *u8, idv[0], TG_G_W, ctr)
218 gv_check_eq("seed42-keeps-its-cheek-morph" as *u8, idv[TW_GENES - 1], TG_G_C, ctr)
219 gv_check_eq("seed42-keeps-its-tone" as *u8, skin[TW_SKIN_SLOT_R] + skin[TW_SKIN_SLOT_G] + skin[TW_SKIN_SLOT_B], TG_SKIN_R + TG_SKIN_G + TG_SKIN_B, ctr)
220 gv_check_eq("seed42-eye-tilt-gene" as *u8, eg[FA_EG_TILT], TG39_SEED_TILT, ctr)
221 gv_check_eq("seed42-eye-open-gene" as *u8, eg[FA_EG_OPEN], TG39_SEED_OPEN, ctr)
222 gv_check_eq("seed42-eye-width-gene" as *u8, eg[FA_EG_WIDTH], TG39_SEED_WIDTH, ctr)
223 gv_check_eq("seed42-eye-upshare-gene" as *u8, eg[FA_EG_UPSHARE], TG39_SEED_UPSHARE, ctr)
224 gv_check_eq("seed42-eye-dtilt-gene" as *u8, eg[FA_EG_DTILT], TG39_SEED_DTILT, ctr)
225 gv_check_eq("seed42-eye-dopen-gene" as *u8, eg[FA_EG_DOPEN], TG39_SEED_DOPEN, ctr)
226 var inrange: i64 = 1
227 var k: i64 = 0
228 while k < FA_EG_N { if eg[k] < fa_eye_gene_lo(k) { inrange = 0 } if eg[k] > fa_eye_gene_hi(k) { inrange = 0 } k = k + 1 }
229 gv_check("seed42-every-eye-gene-inside-its-declared-range" as *u8, inrange, ctr)
230 gv_check_eq("seed42-identity-has-truth" as *u8, tw_truth_landmarks(base, TW_YAW_FRONTAL, t2), 1, ctr)
231 let seed_tilt: i64 = t2[TW_T_TILT_R]
232 // the judge: a planted ruler that is exact on three canthi and off by (+3, -2) px on one
233 let res: *i64 = sys_mmap(PM_R_N * TG_I64) as *i64
234 k = 0
235 while k < TW_T_N { t2[k] = 0; k = k + 1 }
236 t2[TW_T_RLAT_X] = TG39_J_T_RLAT_X; t2[TW_T_RLAT_Y] = TG39_J_T_ROW_Y; t2[TW_T_RMED_X] = TG39_J_T_RMED_X; t2[TW_T_RMED_Y] = TG39_J_T_ROW_Y
237 t2[TW_T_LMED_X] = TG39_J_T_LMED_X; t2[TW_T_LMED_Y] = TG39_J_T_ROW_Y; t2[TW_T_LLAT_X] = TG39_J_T_LLAT_X; t2[TW_T_LLAT_Y] = TG39_J_T_ROW_Y
238 t2[TW_T_EXO] = TG39_J_EXO
239 res[PM_R_RLAT_X] = TG39_J_R_RLAT_X; res[PM_R_RLAT_Y] = TG39_J_R_ROW_Y; res[PM_R_RMED_X] = TG39_J_R_RMED_X; res[PM_R_RMED_Y] = TG39_J_R_RMED_Y
240 res[PM_R_LMED_X] = TG39_J_R_LMED_X; res[PM_R_LMED_Y] = TG39_J_R_ROW_Y; res[PM_R_LLAT_X] = TG39_J_R_LLAT_X; res[PM_R_LLAT_Y] = TG39_J_R_ROW_Y
241 gv_check_eq("judge-worst-nme-on-the-planted-offset" as *u8, tw_judge(res, t2, j), TG39_J_NME, ctr)
242 gv_check_eq("judge-signed-dx-is-ruler-minus-truth" as *u8, j[TW_J_FIELDS + TW_J_DX], TG39_J_DX, ctr)
243 gv_check_eq("judge-signed-dy-up-is-negative" as *u8, j[TW_J_FIELDS + TW_J_DY], TG39_J_DY, ctr)
244 gv_check_eq("judge-mean-nme" as *u8, j[TW_J_NMEAN], TG39_J_NMEAN, ctr)
245 gv_check_eq("neg-control-judge-exact-canthus-reads-zero" as *u8, j[TW_J_NME], 0, ctr)
246 vals[0] = canon_tilt; vals[1] = canon_gap_r; vals[2] = high_tilt; vals[3] = asym; vals[4] = seed_tilt
247 return 0
248}
249func main(argc: i64, argv: *i64) -> i64 {
250 gv_head("nx_twintruth_gate -- the eye unit's landmark truth: projection, canon truth, eye genes, the no-lid refusal, seed 42, the judge" as *u8)
251 let ctr: *i64 = gv_ctr()
252 // the phase stamps its wall time, printed with the values: the roster admits a gate by its runtime, so the gate says what it costs
253 let ms_start: i64 = sys_now_ms()
254 let v39: *i64 = sys_mmap(TW_SLOTS * TG_I64) as *i64
255 tg_at39(ctr, v39)
256 let ms_end: i64 = sys_now_ms()
257 // AT44: the mouth's truth and its judge (a few surface marches, no render)
258 let v44j: *i64 = sys_mmap(TW_SLOTS * TG_I64) as *i64
259 let v44t: *i64 = sys_mmap(TW_SLOTS * TG_I64) as *i64
260 tg44_judge(ctr, v44j)
261 tg44_truth(ctr, v44t)
262 let ms_lip: i64 = sys_now_ms()
263 gv_values_head()
264 gv_kv("canon_truth_tilt_deg10" as *u8, v39[0]); gv_kv("canon_surface_gap_units" as *u8, v39[1]); gv_kv("tilt_gene_90_truth_deg10" as *u8, v39[2])
265 gv_kv("dtilt_10_asym_permil" as *u8, v39[3]); gv_kv("seed42_truth_tilt_deg10" as *u8, v39[4])
266 gv_kv("ms_eye_unit" as *u8, ms_end - ms_start)
267 gv_kv("lip_judge_planted_nmax" as *u8, v44j[0]); gv_kv("canon_lip_ratio_stated" as *u8, v44t[0]); gv_kv("canon_lip_ratio_pixel" as *u8, v44t[1])
268 gv_kv("canon_stomion_front_z" as *u8, v44t[2]); gv_kv("canon_stomion_slit_floor_z" as *u8, v44t[3]); gv_kv("ms_lip_unit" as *u8, ms_lip - ms_end)
269 return gv_verdict("nx_twintruth_gate" as *u8, ctr, "the eye unit's landmark truth: the projection held to the renderer's ray set-up, the canon face mirrored and surface-confirmed, the eye genes neutral at the canon and moving the truth when set, the no-lid face refused by name, seed 42 unchanged, and the judge exact on a planted ruler" as *u8)
270}