nx_photomark_gate.nx source
↩ module page · 519 lines · 35532 B
1// nx_photomark_gate.nx -- the referee for nx_photomark_lib (aesthetictwin AT4 / AT23, 2026-09-16). In-process on a synthetic
2// frontal face (no network, no decoder, no real card): a skin ellipse on a non-skin non-dark field, two dark lens-shaped eyes
3// whose canthi are PLANTED with ASYMMETRIC tilts (right 85, left 57 deg10), a red mouth with a dark stomion line splitting it
4// 10 over 14. The ruler must find the face box, both eye pairs of canthi within pixels, both tilts within tolerance with the
5// asymmetry preserved, the two canon ratios the planted geometry implies, the stomion row and the lip ratio; a field with no
6// face is UNMEASURED, a face without eyes is UNMEASURED, and a MIRRORED fixture swaps the sides while each tilt keeps its
7// sign. The card write appends five measured rows once and refuses the second time. The file door (AT33): the same fixture
8// encoded through the sovereign PNG writer and read back through pm_landmarks_file_auto must reproduce the in-process
9// numbers exactly and announce the PNG codec; a non-image file is a named decode refusal and an absent file is unreadable.
10// AT44 (2026-09-18): the mouth's five landmarks on the planted lines; DECOYS that must not move them (a black chin fold wider and
11// darker than the seam, a shadow redder than the lip between them); a mouth with no seam and a seam shorter than a lip refused by
12// name; a one-pixel lash wing followed to its tip past the blob with a decoy dot one pixel beyond the fissure's bridge left alone;
13// a fissure run onto its window's side refused as PINNED; the referee scoring the planted mouth (ruler and anchored) FOUND and a
14// mouth shifted 40 px PLACED-OFF. Each of these teeth was bitten by a mutant of the lib (see the board's AT44 log).
15// Values are printed with gv_kv.
16// license_tier: ORIGINAL No hw writes (Rule 26).
17import "nx_syscalls.nx"
18import "nx_gate_verdict.nx"
19import "nx_photomark_lib.nx"
20import "nx_png.nx"
21
22const PG_W: i64 = 240
23const PG_H: i64 = 300
24const PG_BG_R: i64 = 120
25const PG_BG_G: i64 = 140
26const PG_BG_B: i64 = 200
27const PG_SKIN_R: i64 = 200
28const PG_SKIN_G: i64 = 150
29const PG_SKIN_B: i64 = 120
30const PG_FACE_CX: i64 = 120
31const PG_FACE_CY: i64 = 150
32const PG_FACE_RX: i64 = 80
33const PG_FACE_RY: i64 = 110
34const PG_EYE_DARK: i64 = 20
35const PG_RLAT_X: i64 = 65
36const PG_RLAT_Y: i64 = 116
37const PG_RMED_X: i64 = 105
38const PG_RMED_Y: i64 = 122
39const PG_LMED_X: i64 = 135
40const PG_LMED_Y: i64 = 122
41const PG_LLAT_X: i64 = 175
42const PG_LLAT_Y: i64 = 118
43const PG_EYE_HALF_H: i64 = 7
44const PG_EXP_TILT_R: i64 = 85
45const PG_EXP_TILT_L: i64 = 57
46const PG_TOL_TILT: i64 = 20
47const PG_TOL_PX: i64 = 4
48const PG_TOL_BOX: i64 = 6
49const PG_MOUTH_CX: i64 = 120
50const PG_MOUTH_CY: i64 = 205
51const PG_MOUTH_RX: i64 = 28
52const PG_MOUTH_RY: i64 = 12
53const PG_LIP_R: i64 = 190
54const PG_LIP_G: i64 = 80
55const PG_LIP_B: i64 = 90
56const PG_STOMION_Y: i64 = 203
57const PG_STOMION_ROWS: i64 = 2
58const PG_TOL_STOMION: i64 = 2
59const PG_EXP_LIP: i64 = 714 // 10 over 14 to the stomion row; since AT44 each lip runs to its own inner edge (10 over 13 = 769, within tolerance)
60const PG_TOL_LIP: i64 = 120
61const PG_EXP_ICI: i64 = 272
62const PG_TOL_ICI: i64 = 40
63const PG_EXP_ICF: i64 = 744
64const PG_TOL_ICF: i64 = 70
65const PG_BPP: i64 = 3
66const PG_I64: i64 = 8
67const PG_PERMIL: i64 = 1000
68const PG_CARD_ROWS: i64 = 5
69const PG_DIR: *u8 = "/tmp/photomark_gate"
70const PG_KDIR: *u8 = "/tmp/photomark_gate/knowledge"
71const PG_CARD_DIR: *u8 = "/tmp/photomark_gate/knowledge/twincard"
72const PG_CARD_BARE: *u8 = "/tmp/photomark_gate/knowledge/twincard/fy.card"
73const PG_PNG_PATH: *u8 = "/tmp/photomark_gate/fixture_face.png"
74const PG_JUNK_PATH: *u8 = "/tmp/photomark_gate/not_an_image.txt"
75const PG_JUNK_TEXT: *u8 = "this is prose, not a still: neither the PNG signature nor a JPEG marker opens it\n"
76const PG_ABSENT_PATH: *u8 = "/tmp/photomark_gate/absent/nothing.png"
77const PG_SHIFT_G: i64 = 8
78const PG_SHIFT_B: i64 = 16
79// the referee held to a planted oracle row over the PNG fixture (AT31): the row's span column carries the planted
80// outer-canthal distance and its lip column a DECOY three times that, so a referee reading the wrong column cannot pass
81const PG_DIR_SLASH: *u8 = "/tmp/photomark_gate/"
82const PG_ORACLE_PATH: *u8 = "/tmp/photomark_gate/fixture.oracle"
83const PG_ORACLE_SHIFT_PATH: *u8 = "/tmp/photomark_gate/fixture_shifted.oracle"
84const PG_ORACLE_ABSENT_PATH: *u8 = "/tmp/photomark_gate/absent/none.oracle"
85const PG_ROW_CAP: i64 = 512
86const PG_X10: i64 = 10
87const PG_ORACLE_ZERO_XY: i64 = 11
88const PG_LIP_DECOY_X: i64 = 3
89const PG_ORACLE_SHIFT_PX: i64 = 30
90const PG_DIAG_PERMIL_OF_TOL: i64 = 1500
91const PG_CARD_BARE_TEXT: *u8 = "card|fy|Fixture Bare|2026-09-16|fixture\n"
92const PG_MODE644: i64 = 420
93const PG_MODE755: i64 = 493
94// ---- AT44 (2026-09-18): the mouth as five landmarks, the fissure walked from its interior, the named refusals --------------------
95// the planted mouth's own geometry: the ellipse's top and bottom rows are the two vermilion lines, the dark band's ends the commissures
96const PG_LS_Y: i64 = 193 // PG_MOUTH_CY - PG_MOUTH_RY
97const PG_LI_Y: i64 = 217 // PG_MOUTH_CY + PG_MOUTH_RY
98const PG_CHR_X: i64 = 94 // PG_MOUTH_CX - PG_MOUTH_RX + 2: where the planted seam band starts
99const PG_CHL_X: i64 = 146 // PG_MOUTH_CX + PG_MOUTH_RX - 2
100const PG_TOL_LIPLINE: i64 = 2
101// DECOYS AROUND THE MOUTH: a chin fold (a black line under the lower lip, darker and wider than the seam) that the vermilion test must
102// reject, and a shadow between the lower lip and the fold REDDER than the lip, which the first-border rule must not count as lip
103const PG_FOLD_Y: i64 = 224
104const PG_FOLD_ROWS: i64 = 2
105const PG_FOLD_X0: i64 = 90 // wider than the seam (94..146), narrower than half the mouth window (1.8 eye spans), as a real fold
106const PG_FOLD_X1: i64 = 150
107const PG_SHADOW_Y: i64 = 218
108const PG_SHADOW_ROWS: i64 = 4
109const PG_SHADOW_R: i64 = 150
110const PG_SHADOW_G: i64 = 40
111const PG_SHADOW_B: i64 = 60
112const PG_DARKEST: i64 = 0
113// a seam shorter than a lip reach: a dash in an otherwise seamless mouth
114const PG_DASH_HALF: i64 = 5
115// THE FISSURE WALKED PAST ITS BLOB: a one-pixel lash wing continues the image-left fissure outward from its lateral tip; the coarse blob
116// cannot see a line one pixel high, so the old padded blob box (6 px) stopped short of its end. A dark DECOY dot sits three pixels
117// beyond the wing's end -- one more than the fissure's bridge -- and must not be reached
118const PG_WING_LEN: i64 = 14
119const PG_WING_TIP_X: i64 = 51 // PG_RLAT_X - PG_WING_LEN
120const PG_DOT_GAP: i64 = 3
121const PG_DOT_HALF: i64 = 1
122const PG_TOL_WING: i64 = 1
123// the wing is a LASH line, lighter than the pupil: at luma 60 it is locally dark (skin 163 around it) yet its two-pixel coarse cells
124// average above the blob stage's dark level, so only the fissure can follow it -- a pupil-dark line makes the blob a brow and no pair
125const PG_WING_DARK: i64 = 60
126// A FISSURE RUN ONTO ITS WINDOW'S SIDE: a dark bar from the image-left fissure's tip to the frame's left edge
127const PG_BAR_X0: i64 = 0
128const PG_REF_LIP_ORACLE_PATH: *u8 = "/tmp/photomark_gate/fixture_lips.oracle"
129const PG_REF_LIP_SHIFT_PATH: *u8 = "/tmp/photomark_gate/fixture_lips_shifted.oracle"
130const PG_LIP_SHIFT_PX: i64 = 40
131const PG_EXP_LIP_ORACLE: i64 = 769 // the planted mouth to each lip's own inner edge: (203 - 193) over (217 - 204)
132const PG_ORACLE_LIP_XY: i64 = 6 // the lip points an oracle row carries before its iris, nose, chin and brow points
133// one pixel on each lip's outer line: 769 x (1/10 + 1/13). The ellipse's own outline is a pixel lower at the band's side columns (the
134// centre column's top row 193 is not inside the ellipse two columns off), so a band-averaged border may land one row inside
135const PG_TOL_LIP_BORDERS: i64 = 136
136
137func pg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
138func pg_set(rgb: *u8, w: i64, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64 {
139 let o: i64 = (y * w + x) * PG_BPP
140 rgb[o] = r as u8
141 rgb[o + 1] = g as u8
142 rgb[o + 2] = b as u8
143 return 0
144}
145func pg_fill(rgb: *u8, w: i64, h: i64, r: i64, g: i64, b: i64) -> i64 {
146 var y: i64 = 0
147 while y < h { var x: i64 = 0; while x < w { pg_set(rgb, w, x, y, r, g, b); x = x + 1 } y = y + 1 }
148 return 0
149}
150func pg_ellipse(rgb: *u8, w: i64, h: i64, cx: i64, cy: i64, rx: i64, ry: i64, r: i64, g: i64, b: i64) -> i64 {
151 var y: i64 = cy - ry
152 while y <= cy + ry {
153 var x: i64 = cx - rx
154 while x <= cx + rx {
155 if x >= 0 { if y >= 0 { if x < w { if y < h {
156 let dx: i64 = x - cx
157 let dy: i64 = y - cy
158 if dx * dx * ry * ry + dy * dy * rx * rx <= rx * rx * ry * ry { pg_set(rgb, w, x, y, r, g, b) }
159 } } } }
160 x = x + 1
161 }
162 y = y + 1
163 }
164 return 0
165}
166// a lens between two tips: every pixel whose distance to the segment is within halfh scaled down to zero at either tip
167func pg_lens(rgb: *u8, w: i64, h: i64, x0: i64, y0: i64, x1: i64, y1: i64, halfh: i64, r: i64, g: i64, b: i64) -> i64 {
168 let ddx: i64 = x1 - x0
169 let ddy: i64 = y1 - y0
170 let l2: i64 = ddx * ddx + ddy * ddy
171 var y: i64 = y0 - halfh - 1
172 if y1 - halfh - 1 < y { y = y1 - halfh - 1 }
173 let yend: i64 = y0 + halfh + 1
174 var yend2: i64 = yend
175 if y1 + halfh + 1 > yend2 { yend2 = y1 + halfh + 1 }
176 while y <= yend2 {
177 var x: i64 = x0
178 if x1 < x { x = x1 }
179 var xend: i64 = x0
180 if x1 > xend { xend = x1 }
181 while x <= xend {
182 let t: i64 = ((x - x0) * ddx + (y - y0) * ddy) * PG_PERMIL / l2
183 if t >= 0 { if t <= PG_PERMIL {
184 let px: i64 = x0 * PG_PERMIL + ddx * t
185 let py: i64 = y0 * PG_PERMIL + ddy * t
186 let ex: i64 = x * PG_PERMIL - px
187 let ey: i64 = y * PG_PERMIL - py
188 let hh: i64 = halfh * (PG_PERMIL - pg_abs(2 * t - PG_PERMIL))
189 if ex * ex + ey * ey <= hh * hh { pg_set(rgb, w, x, y, r, g, b) }
190 } }
191 x = x + 1
192 }
193 y = y + 1
194 }
195 return 0
196}
197func pg_hband(rgb: *u8, w: i64, x0: i64, x1: i64, y0: i64, rows: i64, r: i64, g: i64, b: i64) -> i64 {
198 var y: i64 = y0
199 while y < y0 + rows { var x: i64 = x0; while x <= x1 { pg_set(rgb, w, x, y, r, g, b); x = x + 1 } y = y + 1 }
200 return 0
201}
202func pg_mirror(src: *u8, dst: *u8, w: i64, h: i64) -> i64 {
203 var y: i64 = 0
204 while y < h {
205 var x: i64 = 0
206 while x < w {
207 let s: i64 = (y * w + (w - 1 - x)) * PG_BPP
208 let d: i64 = (y * w + x) * PG_BPP
209 dst[d] = src[s]; dst[d + 1] = src[s + 1]; dst[d + 2] = src[s + 2]
210 x = x + 1
211 }
212 y = y + 1
213 }
214 return 0
215}
216func pg_face(rgb: *u8, eyes: i64, mouth: i64) -> i64 {
217 pg_fill(rgb, PG_W, PG_H, PG_BG_R, PG_BG_G, PG_BG_B)
218 pg_ellipse(rgb, PG_W, PG_H, PG_FACE_CX, PG_FACE_CY, PG_FACE_RX, PG_FACE_RY, PG_SKIN_R, PG_SKIN_G, PG_SKIN_B)
219 if eyes == 1 {
220 pg_lens(rgb, PG_W, PG_H, PG_RLAT_X, PG_RLAT_Y, PG_RMED_X, PG_RMED_Y, PG_EYE_HALF_H, PG_EYE_DARK, PG_EYE_DARK, PG_EYE_DARK)
221 pg_lens(rgb, PG_W, PG_H, PG_LMED_X, PG_LMED_Y, PG_LLAT_X, PG_LLAT_Y, PG_EYE_HALF_H, PG_EYE_DARK, PG_EYE_DARK, PG_EYE_DARK)
222 }
223 if mouth == 1 {
224 pg_ellipse(rgb, PG_W, PG_H, PG_MOUTH_CX, PG_MOUTH_CY, PG_MOUTH_RX, PG_MOUTH_RY, PG_LIP_R, PG_LIP_G, PG_LIP_B)
225 pg_hband(rgb, PG_W, PG_MOUTH_CX - PG_MOUTH_RX + 2, PG_MOUTH_CX + PG_MOUTH_RX - 2, PG_STOMION_Y, PG_STOMION_ROWS, PG_EYE_DARK, PG_EYE_DARK, PG_EYE_DARK)
226 }
227 return 0
228}
229func pg_write(path: *u8, text: *u8) -> i64 {
230 let fd: i64 = sys_openat_wr(path, PG_MODE644)
231 if fd < 0 { return 0 - 1 }
232 let n: i64 = sys_write(fd, text, ri_slen(text))
233 sys_close(fd)
234 return n
235}
236func pg_near(a: i64, b: i64, tol: i64) -> i64 { if pg_abs(a - b) <= tol { return 1 } return 0 }
237// an "x10,y10|" oracle coordinate field
238func pg_xy10(out: *u8, o: i64, x: i64, y: i64) -> i64 {
239 var p: i64 = ri_catn(out, o, x * PG_X10)
240 p = ri_cat(out, p, "," as *u8)
241 p = ri_catn(out, p, y * PG_X10)
242 return ri_cat(out, p, "|" as *u8)
243}
244// one intake-layout oracle row for the PNG fixture, its four canthi shifted by <shift> px in x, span = exo, lip = the decoy
245func pg_oracle_row(out: *u8, shift: i64, exo: i64) -> i64 {
246 var o: i64 = ri_cat(out, 0, "oracle|fixture_face.png|-|" as *u8)
247 o = ri_catn(out, o, PG_W); o = ri_cat(out, o, "|" as *u8); o = ri_catn(out, o, PG_H); o = ri_cat(out, o, "|1|" as *u8)
248 o = pg_xy10(out, o, PG_RLAT_X + shift, PG_RLAT_Y); o = pg_xy10(out, o, PG_RMED_X + shift, PG_RMED_Y)
249 o = pg_xy10(out, o, PG_LMED_X + shift, PG_LMED_Y); o = pg_xy10(out, o, PG_LLAT_X + shift, PG_LLAT_Y)
250 var k: i64 = 0
251 while k < PG_ORACLE_ZERO_XY { o = ri_cat(out, o, "0,0|" as *u8); k = k + 1 }
252 o = ri_cat(out, o, "0|0|0|0|" as *u8)
253 o = ri_catn(out, o, exo * PG_LIP_DECOY_X); o = ri_cat(out, o, "|" as *u8)
254 o = ri_catn(out, o, exo); o = ri_cat(out, o, "|0,0,0,0\n" as *u8)
255 out[o] = 0 as u8
256 return o
257}
258// AT44 fixtures, each drawn over a fresh face (eyes, mouth ellipse and its seam)
259func pg_rect(rgb: *u8, x0: i64, x1: i64, y0: i64, y1: i64, r: i64, g: i64, b: i64) -> i64 {
260 var y: i64 = y0
261 while y <= y1 { var x: i64 = x0; while x <= x1 { if x >= 0 { if x < PG_W { if y >= 0 { if y < PG_H { pg_set(rgb, PG_W, x, y, r, g, b) } } } } x = x + 1 } y = y + 1 }
262 return 0
263}
264// the chin fold and the red shadow between it and the lower lip
265func pg_mouth_decoys(rgb: *u8) -> i64 {
266 pg_face(rgb, 1, 1)
267 pg_rect(rgb, PG_MOUTH_CX - PG_MOUTH_RX, PG_MOUTH_CX + PG_MOUTH_RX, PG_SHADOW_Y, PG_SHADOW_Y + PG_SHADOW_ROWS - 1, PG_SHADOW_R, PG_SHADOW_G, PG_SHADOW_B)
268 pg_rect(rgb, PG_FOLD_X0, PG_FOLD_X1, PG_FOLD_Y, PG_FOLD_Y + PG_FOLD_ROWS - 1, PG_DARKEST, PG_DARKEST, PG_DARKEST)
269 return 0
270}
271// the mouth ellipse with no seam; or no mouth but a dash of seam on the skin, shorter than a lip reach
272func pg_seamless(rgb: *u8, dash: i64) -> i64 {
273 pg_face(rgb, 1, 0)
274 if dash == 0 { pg_ellipse(rgb, PG_W, PG_H, PG_MOUTH_CX, PG_MOUTH_CY, PG_MOUTH_RX, PG_MOUTH_RY, PG_LIP_R, PG_LIP_G, PG_LIP_B) }
275 if dash == 1 { pg_hband(rgb, PG_W, PG_MOUTH_CX - PG_DASH_HALF, PG_MOUTH_CX + PG_DASH_HALF, PG_STOMION_Y, PG_STOMION_ROWS, PG_EYE_DARK, PG_EYE_DARK, PG_EYE_DARK) }
276 return 0
277}
278// the lash wing from the image-left fissure's lateral tip, and the decoy dot beyond its end
279func pg_wing(rgb: *u8) -> i64 {
280 pg_face(rgb, 1, 1)
281 pg_hband(rgb, PG_W, PG_WING_TIP_X, PG_RLAT_X, PG_RLAT_Y, 1, PG_WING_DARK, PG_WING_DARK, PG_WING_DARK)
282 let dcx: i64 = PG_WING_TIP_X - PG_DOT_GAP - 1 - PG_DOT_HALF
283 pg_rect(rgb, dcx - PG_DOT_HALF, dcx + PG_DOT_HALF, PG_RLAT_Y - PG_DOT_HALF, PG_RLAT_Y + PG_DOT_HALF, PG_WING_DARK, PG_WING_DARK, PG_WING_DARK)
284 return 0
285}
286// a one-pixel dark line from the image-left fissure's tip to the frame's edge: thin, so the coarse blob stage still pairs the eyes and
287// the refusal comes from the fissure itself
288func pg_bar(rgb: *u8) -> i64 {
289 pg_face(rgb, 1, 1)
290 pg_hband(rgb, PG_W, PG_BAR_X0, PG_RLAT_X, PG_RLAT_Y, 1, PG_WING_DARK, PG_WING_DARK, PG_WING_DARK)
291 return 0
292}
293// an oracle row for the PNG fixture carrying the planted MOUTH as well: its lip points shifted by lshift px in x, the lip ratio of the
294// planted mouth in the lip column (still a decoy for the span column beside it)
295func pg_oracle_row_lips(out: *u8, lshift: i64, exo: i64) -> i64 {
296 var o: i64 = ri_cat(out, 0, "oracle|fixture_face.png|-|" as *u8)
297 o = ri_catn(out, o, PG_W); o = ri_cat(out, o, "|" as *u8); o = ri_catn(out, o, PG_H); o = ri_cat(out, o, "|1|" as *u8)
298 o = pg_xy10(out, o, PG_RLAT_X, PG_RLAT_Y); o = pg_xy10(out, o, PG_RMED_X, PG_RMED_Y)
299 o = pg_xy10(out, o, PG_LMED_X, PG_LMED_Y); o = pg_xy10(out, o, PG_LLAT_X, PG_LLAT_Y)
300 o = pg_xy10(out, o, PG_MOUTH_CX + lshift, PG_LS_Y)
301 o = pg_xy10(out, o, PG_MOUTH_CX + lshift, PG_STOMION_Y)
302 o = pg_xy10(out, o, PG_MOUTH_CX + lshift, PG_STOMION_Y + PG_STOMION_ROWS - 1)
303 o = pg_xy10(out, o, PG_MOUTH_CX + lshift, PG_LI_Y)
304 o = pg_xy10(out, o, PG_CHR_X + lshift, PG_STOMION_Y)
305 o = pg_xy10(out, o, PG_CHL_X + lshift, PG_STOMION_Y)
306 var k: i64 = 0
307 while k < PG_ORACLE_ZERO_XY - PG_ORACLE_LIP_XY { o = ri_cat(out, o, "0,0|" as *u8); k = k + 1 }
308 o = ri_cat(out, o, "0|0|0|0|" as *u8)
309 o = ri_catn(out, o, PG_EXP_LIP_ORACLE); o = ri_cat(out, o, "|" as *u8)
310 o = ri_catn(out, o, exo); o = ri_cat(out, o, "|0,0,0,0\n" as *u8)
311 out[o] = 0 as u8
312 return o
313}
314// pack the interleaved fixture into the PNG writer's framebuffer (R | G<<8 | B<<16 per pixel, the writer's own unpack order)
315func pg_pack_fb(rgb: *u8, w: i64, h: i64, fb: *i64) -> i64 {
316 let n: i64 = w * h
317 var i: i64 = 0
318 while i < n {
319 let s: i64 = i * PG_BPP
320 fb[i] = (rgb[s] as i64) + ((rgb[s + 1] as i64) << PG_SHIFT_G) + ((rgb[s + 2] as i64) << PG_SHIFT_B)
321 i = i + 1
322 }
323 return 0
324}
325
326func main(argc: i64, argv: *i64) -> i64 {
327 gv_head("nx_photomark_gate -- 2D landmarker: face, canthi per side, tilt, canon ratios, mouth, mirror, card" as *u8)
328 let ctr: *i64 = gv_ctr()
329 let rgb: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
330 pg_face(rgb, 1, 1)
331 let res: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
332 let rc: i64 = pm_landmarks(rgb, PG_W, PG_H, res)
333 gv_check("fixture-reached-the-condition-landmarks-ok" as *u8, (rc == PM_OK) as i64, ctr)
334 gv_check("face-found" as *u8, (res[PM_R_FACE] == 1) as i64, ctr)
335 gv_check("face-box-left-edge" as *u8, pg_near(res[PM_R_FX0], PG_FACE_CX - PG_FACE_RX, PG_TOL_BOX), ctr)
336 gv_check("face-box-right-edge" as *u8, pg_near(res[PM_R_FX1], PG_FACE_CX + PG_FACE_RX, PG_TOL_BOX), ctr)
337 gv_check("face-box-top-edge" as *u8, pg_near(res[PM_R_FY0], PG_FACE_CY - PG_FACE_RY, PG_TOL_BOX), ctr)
338 gv_check("face-box-bottom-edge" as *u8, pg_near(res[PM_R_FY1], PG_FACE_CY + PG_FACE_RY, PG_TOL_BOX), ctr)
339 gv_check("two-eyes-found" as *u8, (res[PM_R_EYES] == 2) as i64, ctr)
340 gv_check("right-eye-lateral-canthus-placed" as *u8, pg_near(res[PM_R_RLAT_X], PG_RLAT_X, PG_TOL_PX) * pg_near(res[PM_R_RLAT_Y], PG_RLAT_Y, PG_TOL_PX), ctr)
341 gv_check("right-eye-medial-canthus-placed" as *u8, pg_near(res[PM_R_RMED_X], PG_RMED_X, PG_TOL_PX) * pg_near(res[PM_R_RMED_Y], PG_RMED_Y, PG_TOL_PX), ctr)
342 gv_check("left-eye-medial-canthus-placed" as *u8, pg_near(res[PM_R_LMED_X], PG_LMED_X, PG_TOL_PX) * pg_near(res[PM_R_LMED_Y], PG_LMED_Y, PG_TOL_PX), ctr)
343 gv_check("left-eye-lateral-canthus-placed" as *u8, pg_near(res[PM_R_LLAT_X], PG_LLAT_X, PG_TOL_PX) * pg_near(res[PM_R_LLAT_Y], PG_LLAT_Y, PG_TOL_PX), ctr)
344 gv_check("right-tilt-within-tolerance" as *u8, pg_near(res[PM_R_TILT_R], PG_EXP_TILT_R, PG_TOL_TILT), ctr)
345 gv_check("left-tilt-within-tolerance" as *u8, pg_near(res[PM_R_TILT_L], PG_EXP_TILT_L, PG_TOL_TILT), ctr)
346 gv_check("planted-asymmetry-preserved-right-above-left" as *u8, (res[PM_R_TILT_R] > res[PM_R_TILT_L]) as i64, ctr)
347 gv_check("tilts-positive-lateral-above-medial" as *u8, (res[PM_R_TILT_R] > 0) as i64 * (res[PM_R_TILT_L] > 0) as i64, ctr)
348 gv_check("intercanthal-index-within-tolerance" as *u8, pg_near(res[PM_R_ICI], PG_EXP_ICI, PG_TOL_ICI), ctr)
349 gv_check("intercanthal-over-fissure-within-tolerance" as *u8, pg_near(res[PM_R_ICF], PG_EXP_ICF, PG_TOL_ICF), ctr)
350 gv_check("mouth-found" as *u8, (res[PM_R_MOUTH] == 1) as i64, ctr)
351 gv_check("stomion-row-within-tolerance" as *u8, pg_near(res[PM_R_STOMION_Y], PG_STOMION_Y, PG_TOL_STOMION), ctr)
352 gv_check("lip-ratio-within-tolerance" as *u8, pg_near(res[PM_R_LIP], PG_EXP_LIP, PG_TOL_LIP), ctr)
353 // neg-controls: a field with no face, a face with no eyes
354 let bg: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
355 pg_fill(bg, PG_W, PG_H, PG_BG_R, PG_BG_G, PG_BG_B)
356 let r2: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
357 gv_check("neg-control-no-face-is-unmeasured" as *u8, (pm_landmarks(bg, PG_W, PG_H, r2) == PM_E_NOFACE) as i64, ctr)
358 let noeyes: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
359 pg_face(noeyes, 0, 1)
360 let r3: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
361 gv_check("neg-control-face-without-eyes-is-unmeasured" as *u8, (pm_landmarks(noeyes, PG_W, PG_H, r3) == PM_E_NOEYES) as i64, ctr)
362 // mirrored: sides swap, each tilt keeps its sign
363 let mir: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
364 pg_mirror(rgb, mir, PG_W, PG_H)
365 let r4: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
366 let rc4: i64 = pm_landmarks(mir, PG_W, PG_H, r4)
367 gv_check("mirrored-fixture-landmarks-ok" as *u8, (rc4 == PM_OK) as i64, ctr)
368 gv_check("mirrored-sides-swap-right-reads-the-planted-left" as *u8, pg_near(r4[PM_R_TILT_R], PG_EXP_TILT_L, PG_TOL_TILT), ctr)
369 gv_check("mirrored-sides-swap-left-reads-the-planted-right" as *u8, pg_near(r4[PM_R_TILT_L], PG_EXP_TILT_R, PG_TOL_TILT), ctr)
370 gv_check("mirrored-ratios-unchanged" as *u8, pg_near(r4[PM_R_ICI], res[PM_R_ICI], PG_TOL_ICI) * pg_near(r4[PM_R_LIP], res[PM_R_LIP], PG_TOL_LIP), ctr)
371 // card write on a fixture card
372 sys_mkdir(PG_DIR, PG_MODE755)
373 sys_mkdir(PG_KDIR, PG_MODE755)
374 sys_mkdir(PG_CARD_DIR, PG_MODE755)
375 // the file door (AT33): the fixture through the sovereign PNG writer and back through the file entry must reproduce the
376 // in-process numbers exactly (a lossless round trip) and announce the codec it took
377 let fbp: *i64 = sys_mmap(PG_W * PG_H * PG_I64) as *i64
378 pg_pack_fb(rgb, PG_W, PG_H, fbp)
379 let ondisk: i64 = png_publish(fbp, PG_W, PG_H, PG_PNG_PATH, 0)
380 gv_check("fixture-reached-the-condition-png-on-disk" as *u8, (ondisk > 0) as i64, ctr)
381 let r5: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
382 let rc5: i64 = pm_landmarks_file_auto(PG_PNG_PATH, r5, 0 as *HaarCascade, 0 as *HaarCascade)
383 gv_check("png-door-landmarks-ok" as *u8, (rc5 == PM_OK) as i64, ctr)
384 gv_check_eq("png-door-announces-png-codec" as *u8, r5[PM_R_CODEC], PM_CODEC_PNG, ctr)
385 gv_check_eq("png-door-width-is-the-fixture-width" as *u8, r5[PM_R_W], PG_W, ctr)
386 gv_check_eq("png-door-height-is-the-fixture-height" as *u8, r5[PM_R_H], PG_H, ctr)
387 gv_check_eq("png-door-right-tilt-equals-in-process" as *u8, r5[PM_R_TILT_R], res[PM_R_TILT_R], ctr)
388 gv_check_eq("png-door-left-tilt-equals-in-process" as *u8, r5[PM_R_TILT_L], res[PM_R_TILT_L], ctr)
389 gv_check_eq("png-door-intercanthal-index-equals-in-process" as *u8, r5[PM_R_ICI], res[PM_R_ICI], ctr)
390 gv_check_eq("png-door-lip-ratio-equals-in-process" as *u8, r5[PM_R_LIP], res[PM_R_LIP], ctr)
391 gv_check_eq("png-door-stomion-row-equals-in-process" as *u8, r5[PM_R_STOMION_Y], res[PM_R_STOMION_Y], ctr)
392 let wj: i64 = pg_write(PG_JUNK_PATH, PG_JUNK_TEXT)
393 gv_need("fixture-junk-file-written" as *u8, (wj > 0) as i64, ctr)
394 let r6: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
395 gv_check("neg-control-non-image-file-is-a-decode-refusal" as *u8, (pm_landmarks_file_auto(PG_JUNK_PATH, r6, 0 as *HaarCascade, 0 as *HaarCascade) == PM_E_DECODE) as i64, ctr)
396 gv_check("neg-control-absent-file-is-unreadable" as *u8, (pm_landmarks_file_auto(PG_ABSENT_PATH, r6, 0 as *HaarCascade, 0 as *HaarCascade) == PM_E_READ) as i64, ctr)
397 // the referee (AT31) held to a planted row: the fixture's own canthi as the oracle over the PNG the door just read
398 let exo: i64 = pm_dist(PG_RLAT_X, PG_RLAT_Y, PG_LLAT_X, PG_LLAT_Y)
399 let orow: *u8 = sys_mmap(PG_ROW_CAP)
400 pg_oracle_row(orow, 0, exo)
401 gv_need("fixture-oracle-row-written" as *u8, (pg_write(PG_ORACLE_PATH, orow) > 0) as i64, ctr)
402 let rsum: *i64 = sys_mmap(PM_RS_N * PG_I64) as *i64
403 let judged: i64 = pm_referee_sum(PG_ORACLE_PATH, PG_DIR_SLASH, 0 as *HaarCascade, 0 as *HaarCascade, rsum)
404 gv_check_eq("referee-judges-the-one-fixture-row" as *u8, judged, 1, ctr)
405 gv_check_eq("referee-planted-row-found" as *u8, rsum[PM_RS_FOUND], 1, ctr)
406 gv_check_eq("referee-partition-sums-to-judged" as *u8, rsum[PM_RS_FOUND] + rsum[PM_RS_PLACED_OFF] + rsum[PM_RS_UNMEASURED] + rsum[PM_RS_UNREADABLE], judged, ctr)
407 gv_check("referee-nme-max-within-placement-tolerance-of-the-planted-span" as *u8, (rsum[PM_RS_LAST_NME_MAX] <= PG_TOL_PX * PG_DIAG_PERMIL_OF_TOL / exo) as i64, ctr)
408 let orow2: *u8 = sys_mmap(PG_ROW_CAP)
409 pg_oracle_row(orow2, PG_ORACLE_SHIFT_PX, exo)
410 gv_need("fixture-shifted-oracle-row-written" as *u8, (pg_write(PG_ORACLE_SHIFT_PATH, orow2) > 0) as i64, ctr)
411 let rsum2: *i64 = sys_mmap(PM_RS_N * PG_I64) as *i64
412 let judged2: i64 = pm_referee_sum(PG_ORACLE_SHIFT_PATH, PG_DIR_SLASH, 0 as *HaarCascade, 0 as *HaarCascade, rsum2)
413 gv_check_eq("neg-control-referee-shifted-row-placed-off" as *u8, rsum2[PM_RS_PLACED_OFF], judged2, ctr)
414 gv_check_eq("neg-control-referee-shifted-row-not-found" as *u8, rsum2[PM_RS_FOUND], 0, ctr)
415 gv_check("neg-control-referee-shifted-nme-exceeds-the-found-bar-against-the-span-not-the-decoy" as *u8, (rsum2[PM_RS_LAST_NME_MAX] > PM_NME_FOUND_PERMIL) as i64, ctr)
416 let rsum3: *i64 = sys_mmap(PM_RS_N * PG_I64) as *i64
417 gv_check("neg-control-referee-absent-oracle-unreadable" as *u8, (pm_referee_sum(PG_ORACLE_ABSENT_PATH, PG_DIR_SLASH, 0 as *HaarCascade, 0 as *HaarCascade, rsum3) == PM_E_READ) as i64, ctr)
418 let w1: i64 = pg_write(PG_CARD_BARE, PG_CARD_BARE_TEXT)
419 gv_need("fixture-card-written" as *u8, (w1 > 0) as i64, ctr)
420 gv_need("fixture-chdir" as *u8, (sys_chdir(PG_DIR) == 0) as i64, ctr)
421 let appended: i64 = pm_card_write("fy" as *u8, "fy1" as *u8, "2026-09" as *u8, res)
422 gv_check("card-write-appends-five-measured-rows" as *u8, (appended == PG_CARD_ROWS) as i64, ctr)
423 let cl: *i64 = sys_mmap(PG_I64) as *i64
424 let card: *u8 = ri_load(PG_CARD_BARE, cl)
425 gv_check("card-carries-left-and-right-tilt-rows" as *u8, ri_contains(card, cl[0], "axis|eyes|canthal_tilt|L|" as *u8) * ri_contains(card, cl[0], "axis|eyes|canthal_tilt|R|" as *u8), ctr)
426 gv_check("card-carries-measured-lip-row" as *u8, ri_contains(card, cl[0], "axis|face|upper_over_lower_lip|C|" as *u8), ctr)
427 gv_check("neg-control-card-write-second-time-refused" as *u8, (pm_card_write("fy" as *u8, "fy1" as *u8, "2026-09" as *u8, res) == PM_E_EXISTS) as i64, ctr)
428 gv_check("neg-control-absent-card-unreadable" as *u8, (pm_card_write("nobody" as *u8, "x" as *u8, "2026-09" as *u8, res) == PM_E_READ) as i64, ctr)
429 // ---- AT44: the mouth as five landmarks, found from its seam and verified by its vermilion --------------------------------------
430 gv_check_eq("mouth-rests-on-a-verified-seam" as *u8, res[PM_R_MOUTH_WHY], PM_MW_OK, ctr)
431 gv_check_near("mouth-labrale-superius-is-the-planted-upper-line" as *u8, res[PM_R_LS_Y], PG_LS_Y, PG_TOL_LIPLINE, ctr)
432 gv_check_near("mouth-labrale-inferius-is-the-planted-lower-line" as *u8, res[PM_R_LI_Y], PG_LI_Y, PG_TOL_LIPLINE, ctr)
433 gv_check_near("mouth-stomion-x-is-the-planted-midline" as *u8, res[PM_R_STO_X], PG_MOUTH_CX, PG_TOL_LIPLINE, ctr)
434 gv_check_near("mouth-image-left-cheilion-is-the-seam-start" as *u8, res[PM_R_CHR_X], PG_CHR_X, PG_TOL_LIPLINE, ctr)
435 gv_check_near("mouth-image-right-cheilion-is-the-seam-end" as *u8, res[PM_R_CHL_X], PG_CHL_X, PG_TOL_LIPLINE, ctr)
436 gv_check_near("mouth-lip-ratio-is-each-lip-to-its-own-inner-edge" as *u8, res[PM_R_LIP], PG_EXP_LIP_ORACLE, PG_TOL_LIP_BORDERS, ctr)
437 // DECOYS: a black chin fold wider and darker than the seam (the strongest valley in the window) and, between it and the lower lip,
438 // a shadow redder than the lip -- the seam must still be the stomion, and the lip must still end where it does
439 let dec: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
440 pg_mouth_decoys(dec)
441 let rd: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
442 pm_landmarks(dec, PG_W, PG_H, rd)
443 gv_check_eq("decoy-fixture-reached-the-condition-mouth-measured" as *u8, rd[PM_R_MOUTH], 1, ctr)
444 gv_check_near("decoy-the-chin-fold-is-not-taken-for-the-stomion" as *u8, rd[PM_R_STO_Y], PG_STOMION_Y, PG_TOL_STOMION, ctr)
445 gv_check_near("decoy-the-red-shadow-is-not-counted-as-lower-lip" as *u8, rd[PM_R_LI_Y], PG_LI_Y, PG_TOL_LIPLINE, ctr)
446 gv_check_near("decoy-the-upper-line-is-unmoved" as *u8, rd[PM_R_LS_Y], PG_LS_Y, PG_TOL_LIPLINE, ctr)
447 // the named refusals: a mouth with no seam, a seam shorter than a lip
448 let sl: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
449 let rs: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
450 pg_seamless(sl, 0)
451 pm_landmarks(sl, PG_W, PG_H, rs)
452 gv_check_eq("neg-control-fixture-seamless-face-still-has-its-eyes" as *u8, rs[PM_R_EYES], 2, ctr)
453 gv_check("neg-control-a-mouth-with-no-seam-is-refused-by-name" as *u8, ((rs[PM_R_MOUTH] == 0) as i64) * ((rs[PM_R_MOUTH_WHY] != PM_MW_OK) as i64), ctr)
454 let seamless_why: i64 = rs[PM_R_MOUTH_WHY]
455 pg_seamless(sl, 1)
456 pm_landmarks(sl, PG_W, PG_H, rs)
457 gv_check_eq("neg-control-a-seam-shorter-than-a-lip-is-refused-as-such" as *u8, rs[PM_R_MOUTH_WHY], PM_MW_SEAM_SHORT, ctr)
458 // ---- AT44: the fissure walked from its interior -------------------------------------------------------------------------------
459 // a one-pixel lash wing continues the image-left fissure 14 px past its tip: the canthus is the wing's end, not the old padded box's
460 // edge, and the decoy dot three pixels beyond it (one more than the bridge) is not part of the eye
461 let wg: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
462 pg_wing(wg)
463 let rw: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
464 pm_landmarks(wg, PG_W, PG_H, rw)
465 gv_check_eq("wing-fixture-reached-the-condition-eyes-measured" as *u8, rw[PM_R_EYES], 2, ctr)
466 gv_check_near("wing-image-left-lateral-canthus-is-the-wing-tip" as *u8, rw[PM_R_RLAT_X], PG_WING_TIP_X, PG_TOL_WING, ctr)
467 gv_check("decoy-the-dot-past-the-bridge-is-not-part-of-the-eye" as *u8, (rw[PM_R_RLAT_X] > PG_WING_TIP_X - PG_DOT_GAP) as i64, ctr)
468 gv_check_near("wing-image-right-lateral-canthus-unmoved" as *u8, rw[PM_R_LLAT_X], PG_LLAT_X, PG_TOL_PX, ctr)
469 // a dark bar joins the image-left fissure to the frame's edge: its lateral end is the window, refused by name
470 let bw: *u8 = sys_mmap(PG_W * PG_H * PG_BPP)
471 pg_bar(bw)
472 let rb: *i64 = sys_mmap(PM_R_N * PG_I64) as *i64
473 gv_check_eq("neg-control-a-fissure-run-onto-its-window-side-is-refused" as *u8, pm_landmarks(bw, PG_W, PG_H, rb), PM_E_NOEYES, ctr)
474 gv_check_eq("neg-control-and-the-refusal-is-pinned-by-name" as *u8, rb[PM_R_PAIR_FAIL], PM_PF_PINNED, ctr)
475 gv_check_eq("neg-control-and-the-pinned-canthus-is-the-image-left-lateral" as *u8, rb[PM_R_PINNED], PM_PIN_RLAT, ctr)
476 // ---- AT44: the referee scores the mouth -- the ruler's own and one anchored on the oracle's canthi -------------------------------
477 let orow3: *u8 = sys_mmap(PG_ROW_CAP)
478 pg_oracle_row_lips(orow3, 0, exo)
479 gv_need("fixture-lip-oracle-row-written" as *u8, (pg_write(PG_REF_LIP_ORACLE_PATH, orow3) > 0) as i64, ctr)
480 let rsum4: *i64 = sys_mmap(PM_RS_N * PG_I64) as *i64
481 pm_referee_sum(PG_REF_LIP_ORACLE_PATH, PG_DIR_SLASH, 0 as *HaarCascade, 0 as *HaarCascade, rsum4)
482 gv_check_eq("referee-planted-mouth-found" as *u8, rsum4[PM_RS_LIP_FOUND], 1, ctr)
483 gv_check_eq("referee-anchored-planted-mouth-found" as *u8, rsum4[PM_RS_ANCH_FOUND], 1, ctr)
484 gv_check("referee-lip-ratio-agrees-with-the-planted-column" as *u8, (rsum4[PM_RS_LIP_RATIO_ERR_MEAN] <= PG_TOL_LIP_BORDERS) as i64, ctr)
485 gv_check_eq("referee-lip-partition-sums-to-judged" as *u8, rsum4[PM_RS_LIP_FOUND] + rsum4[PM_RS_LIP_PLACED_OFF] + rsum4[PM_RS_LIP_UNMEASURED] + rsum4[PM_RS_UNREADABLE], rsum4[PM_RS_JUDGED], ctr)
486 let orow4: *u8 = sys_mmap(PG_ROW_CAP)
487 pg_oracle_row_lips(orow4, PG_LIP_SHIFT_PX, exo)
488 gv_need("fixture-shifted-lip-oracle-row-written" as *u8, (pg_write(PG_REF_LIP_SHIFT_PATH, orow4) > 0) as i64, ctr)
489 let rsum5: *i64 = sys_mmap(PM_RS_N * PG_I64) as *i64
490 pm_referee_sum(PG_REF_LIP_SHIFT_PATH, PG_DIR_SLASH, 0 as *HaarCascade, 0 as *HaarCascade, rsum5)
491 gv_check_eq("neg-control-referee-shifted-mouth-placed-off" as *u8, rsum5[PM_RS_LIP_PLACED_OFF], 1, ctr)
492 gv_check_eq("neg-control-referee-shifted-anchored-mouth-placed-off" as *u8, rsum5[PM_RS_ANCH_OFF], 1, ctr)
493 gv_check_eq("neg-control-referee-shifted-lips-leave-the-canthi-found" as *u8, rsum5[PM_RS_FOUND], 1, ctr)
494 gv_values_head()
495 gv_kv("face_cells" as *u8, res[PM_R_FACE_CELLS])
496 gv_kv("dark_blobs" as *u8, res[PM_R_BLOBS])
497 gv_kv("tilt_R_deg10" as *u8, res[PM_R_TILT_R])
498 gv_kv("tilt_L_deg10" as *u8, res[PM_R_TILT_L])
499 gv_kv("intercanthal_index" as *u8, res[PM_R_ICI])
500 gv_kv("intercanthal_eq_fissure" as *u8, res[PM_R_ICF])
501 gv_kv("stomion_y" as *u8, res[PM_R_STOMION_Y])
502 gv_kv("lip_permil" as *u8, res[PM_R_LIP])
503 gv_kv("mirror_tilt_R_deg10" as *u8, r4[PM_R_TILT_R])
504 gv_kv("mirror_tilt_L_deg10" as *u8, r4[PM_R_TILT_L])
505 gv_kv("rlat_x" as *u8, res[PM_R_RLAT_X]); gv_kv("rlat_y" as *u8, res[PM_R_RLAT_Y]); gv_kv("rmed_x" as *u8, res[PM_R_RMED_X]); gv_kv("rmed_y" as *u8, res[PM_R_RMED_Y])
506 gv_kv("lmed_x" as *u8, res[PM_R_LMED_X]); gv_kv("lmed_y" as *u8, res[PM_R_LMED_Y]); gv_kv("llat_x" as *u8, res[PM_R_LLAT_X]); gv_kv("llat_y" as *u8, res[PM_R_LLAT_Y])
507 gv_kv("eye_pix_R" as *u8, res[PM_R_EYE_PIX_R]); gv_kv("eye_pix_L" as *u8, res[PM_R_EYE_PIX_L]); gv_kv("face_x0" as *u8, res[PM_R_FX0]); gv_kv("face_x1" as *u8, res[PM_R_FX1])
508 gv_kv("card_rows_appended" as *u8, appended)
509 gv_kv("png_ondisk_bytes" as *u8, ondisk); gv_kv("png_door_codec" as *u8, r5[PM_R_CODEC]); gv_kv("png_door_tilt_R_deg10" as *u8, r5[PM_R_TILT_R])
510 gv_kv("referee_planted_span_px" as *u8, exo); gv_kv("referee_planted_nme_max_permil" as *u8, rsum[PM_RS_LAST_NME_MAX]); gv_kv("referee_planted_nme_mean_permil" as *u8, rsum[PM_RS_LAST_NME_MEAN]); gv_kv("referee_shifted_nme_max_permil" as *u8, rsum2[PM_RS_LAST_NME_MAX])
511 gv_kv("ls_y" as *u8, res[PM_R_LS_Y]); gv_kv("sto_y" as *u8, res[PM_R_STO_Y]); gv_kv("li_y" as *u8, res[PM_R_LI_Y]); gv_kv("chr_x" as *u8, res[PM_R_CHR_X]); gv_kv("chl_x" as *u8, res[PM_R_CHL_X])
512 gv_kv("seam_probe_px" as *u8, res[PM_R_SEAM_PROBE]); gv_kv("seam_floor" as *u8, res[PM_R_SEAM_FLOOR]); gv_kv("seam_hyp" as *u8, res[PM_R_SEAM_HYP])
513 gv_kv("decoy_sto_y" as *u8, rd[PM_R_STO_Y]); gv_kv("decoy_li_y" as *u8, rd[PM_R_LI_Y]); gv_kv("decoy_ls_y" as *u8, rd[PM_R_LS_Y]); gv_kv("decoy_seam_hyp" as *u8, rd[PM_R_SEAM_HYP])
514 gv_kv("seamless_mouth_why" as *u8, seamless_why); gv_kv("dash_mouth_why" as *u8, rs[PM_R_MOUTH_WHY]); gv_kv("dash_seam_px" as *u8, rs[PM_R_CHL_X] - rs[PM_R_CHR_X]); gv_kv("dash_lip_reach_px" as *u8, rs[PM_R_LIP_REACH])
515 gv_kv("wing_rlat_x" as *u8, rw[PM_R_RLAT_X]); gv_kv("wing_rlat_y" as *u8, rw[PM_R_RLAT_Y]); gv_kv("wing_llat_x" as *u8, rw[PM_R_LLAT_X])
516 gv_kv("wing_pair_fail" as *u8, rw[PM_R_PAIR_FAIL]); gv_kv("wing_pinned_bits" as *u8, rw[PM_R_PINNED]); gv_kv("bar_pair_fail" as *u8, rb[PM_R_PAIR_FAIL]); gv_kv("bar_pinned_bits" as *u8, rb[PM_R_PINNED])
517 gv_kv("referee_lip_nme_mean_permil" as *u8, rsum4[PM_RS_LIP_NME_MEAN_MEASURED]); gv_kv("referee_anchored_lip_nme_mean_permil" as *u8, rsum4[PM_RS_ANCH_NME_MEAN]); gv_kv("referee_shifted_lip_nme_max_permil" as *u8, rsum5[PM_RS_LAST_LIP_NME_MAX])
518 return gv_verdict("nx_photomark_gate" as *u8, ctr, "a synthetic frontal face with planted asymmetric canthal tilts and a split mouth: the face box, four canthi within pixels, both tilts within tolerance with the asymmetry kept, the two canon ratios, the stomion and lip ratio, no-face and no-eyes UNMEASURED, mirrored sides swapped with signs kept, and the card write appending five measured rows once" as *u8)
519}