code wiki / _hdl_build / nx_cdmap_pixjudge_gate.nx
nx_cdmap_pixjudge_gate.nx source
↩ module page · 282 lines · 18970 B
1// nx_cdmap_pixjudge_gate.nx -- referee for the position map's PIXEL REFEREE (datavis DV2, 2026-09-15). Hand-built
2// figures are drawn as ink through the sovereign font engine and the pixel critic is held to what a reader would see:
3// a pristine figure reads clean; a PLANTED FONT-METRIC DRIFT -- two runs of wide glyphs reserved by the heuristic
4// width and placed just past that reserve, so the self-grade's boxes are apart while the real ink overlaps -- must be
5// caught by the pixel ruler AND missed by the box ruler on the same bytes (the DV2 done-rule); a label on ANOTHER
6// player's mark is a defect while a label on its OWN mark is not; ink that leaves the plot frame is OFF; the agreement
7// call is bound to the published number both ways; a missing face is a NAMED refusal, never a zero vector; and, when
8// the live search page is on disk, the served figure's pixel grade is compared with the grade it published (an optional
9// witness announced through gv_kv, never gv_need, so an absent page cannot SKIP the gate forever on one host).
10// The face IS the subject's substrate, so its absence is gv_need: without a face nothing here measures anything.
11// license_tier: ORIGINAL
12import "nx_cdmap_pixjudge_lib.nx"
13import "nx_syscalls.nx"
14import "nx_gate_verdict.nx"
15
16const G_FONT_PX: i64 = 13
17const G_EXP_N: i64 = 2
18const G_VB_W: i64 = 760
19const G_VB_H: i64 = 520
20const G_FRAME_X1: i64 = 730
21const G_W_CHARS: i64 = 6 // the drift plant: six W, the widest Latin glyph a sans face carries
22const G_DRIFT_A_X: i64 = 100
23const G_DRIFT_GAP: i64 = 2 // label B starts this far past label A's HEURISTIC reserve
24const G_JSON_BYTES: i64 = 512
25const G_CH_QUOTE: i64 = 34
26const G_PUB_MM: i64 = 1
27const G_PUB_SPREAD: i64 = 690
28const G_PUB_DEFECTS_WRONG: i64 = 3
29const G_FONT_NAS: *u8 = "knowledge/fonts/LiberationSans-Regular.ttf"
30const G_FONT_NAS_BOLD: *u8 = "knowledge/fonts/LiberationSans-Bold.ttf"
31const G_FONT_LAPTOP: *u8 = "web_assets/fonts/LiberationSans-Regular.ttf"
32const G_FONT_LAPTOP_BOLD: *u8 = "web_assets/fonts/LiberationSans-Bold.ttf"
33const G_LIVE_PAGE: *u8 = "sites/nishifamily/compare/search/index.html"
34const G_LIVE_API: *u8 = "sites/nishifamily/compare/search/api.json"
35const G_BLOCK: *u8 = "readability_cut"
36const G_FIX_BYTES: i64 = 2048
37
38const G_FIX_HEAD: *u8 = "<figure><svg class='cdmap' viewBox='0 0 760 520'>\n<rect x='70' y='30' width='660' height='430' rx='6' fill='var(--nx-color-panel)'/>\n<text x='70' y='475' fill='var(--nx-color-mut)' font-size='11'>700</text>\n"
39const G_FIX_TAIL: *u8 = "</svg></figure>\n"
40const G_MARKS_PRISTINE: *u8 = "<circle cx='180' cy='216' r='15' fill='var(--nx-color-accent)'/>\n<circle cx='483' cy='387' r='15' fill='rgb(230,159,0)'/>\n"
41const G_MARKS_FAR: *u8 = "<circle cx='600' cy='100' r='5' fill='rgb(1,1,1)'/>\n<circle cx='650' cy='100' r='5' fill='rgb(1,1,1)'/>\n"
42const G_MARK_EDGE: *u8 = "<circle cx='700' cy='216' r='5' fill='rgb(1,1,1)'/>\n"
43const G_LBL_NISHI_OK: *u8 = "<text x='201' y='220' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke' font-weight='700'>Nishi</text>\n"
44const G_LBL_MOJEEK_OK: *u8 = "<text x='504' y='391' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke'>Mojeek</text>\n"
45const G_LBL_NISHI_OWNMARK: *u8 = "<text x='170' y='220' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke' font-weight='700'>Nishi</text>\n"
46const G_LBL_MOJEEK_ONMARK0: *u8 = "<text x='150' y='236' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke'>Mojeek</text>\n"
47const G_LBL_EDGE: *u8 = "<text x='700' y='220' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke'>Marginalia</text>\n"
48const G_DRIFT_A: *u8 = "<text x='100' y='300' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke'>WWWWWW</text>\n"
49const G_DRIFT_B_OPEN: *u8 = "<text x='"
50const G_DRIFT_B_CLOSE: *u8 = "' y='300' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke'>WWWWWW</text>\n"
51const G_WWWWWW: *u8 = "WWWWWW"
52// THE NOTES (datavis DV5): a cdnote group whose lines carry the foreground fill like a label; the scanner must keep the
53// label/mark pairing (the note is not a player), draw the note as ONE mask, and count it in LL/LM/OFF only
54const G_NOTE_CLEAR: *u8 = "<g class='cdnote'><title>note t1</title><rect x='400' y='100' width='170' height='40' rx='4'/>\n<text x='405' y='114' fill='var(--nx-color-fg)' font-size='11'>a clear note</text>\n<text x='405' y='128' fill='var(--nx-color-fg)' font-size='11'>second line</text>\n</g>\n"
55const G_NOTE_ONLABEL: *u8 = "<g class='cdnote'><title>note t2</title><rect x='500' y='378' width='170' height='26' rx='4'/>\n<text x='504' y='391' fill='var(--nx-color-fg)' font-size='11'>Mojeek again</text>\n</g>\n"
56const G_NOTE_ONMARK: *u8 = "<g class='cdnote'><title>note t3</title><rect x='148' y='206' width='40' height='26' rx='4'/>\n<text x='152' y='220' fill='var(--nx-color-fg)' font-size='11'>over</text>\n</g>\n"
57const G_NOTE_LINES: i64 = 2
58
59func g_i64(n: i64) -> *i64 { return sys_mmap(n * CRG_I64_BYTES) as *i64 }
60func g_fixture(marks: *u8, a: *u8, b: *u8) -> *u8 {
61 let d: *u8 = sys_mmap(G_FIX_BYTES)
62 var o: i64 = gv_cat(d, 0, G_FIX_HEAD); o = gv_cat(d, o, marks); o = gv_cat(d, o, a); o = gv_cat(d, o, b); o = gv_cat(d, o, G_FIX_TAIL)
63 d[o] = 0 as u8
64 return d
65}
66func g_fixture_note(marks: *u8, a: *u8, b: *u8, note: *u8) -> *u8 {
67 let d: *u8 = sys_mmap(G_FIX_BYTES)
68 var o: i64 = gv_cat(d, 0, G_FIX_HEAD); o = gv_cat(d, o, marks); o = gv_cat(d, o, a); o = gv_cat(d, o, b); o = gv_cat(d, o, note); o = gv_cat(d, o, G_FIX_TAIL)
69 d[o] = 0 as u8
70 return d
71}
72// the drift fixture: label B's x is DERIVED from the heuristic reserve, never typed, so the plant follows the ruler
73func g_drift_fixture(bx: i64) -> *u8 {
74 let lb: *u8 = sys_mmap(G_FIX_BYTES)
75 var o: i64 = gv_cat(lb, 0, G_DRIFT_B_OPEN); o = gv_catn(lb, o, bx); o = gv_cat(lb, o, G_DRIFT_B_CLOSE)
76 lb[o] = 0 as u8
77 return g_fixture(G_MARKS_FAR, G_DRIFT_A, lb)
78}
79func g_q(d: *u8, o: i64) -> i64 { d[o] = G_CH_QUOTE as u8; return o + 1 }
80func g_jkey(d: *u8, o: i64, k: *u8, v: i64) -> i64 {
81 var p: i64 = g_q(d, o); p = gv_cat(d, p, k); p = g_q(d, p); p = gv_cat(d, p, ":" as *u8); p = gv_catn(d, p, v); return p
82}
83// {"readability_cut":{...,"defects":D}} assembled at runtime so no double quote lives in a literal and no scanner can
84// mistake the fixture for a published api.json
85func g_json(d: *u8, defects: i64) -> i64 {
86 var o: i64 = gv_cat(d, 0, "{" as *u8)
87 o = g_q(d, o); o = gv_cat(d, o, G_BLOCK); o = g_q(d, o); o = gv_cat(d, o, ":{" as *u8)
88 o = g_jkey(d, o, "label_overlaps" as *u8, 0); o = gv_cat(d, o, "," as *u8)
89 o = g_jkey(d, o, "labels_over_marks" as *u8, 0); o = gv_cat(d, o, "," as *u8)
90 o = g_jkey(d, o, "off_canvas" as *u8, 0); o = gv_cat(d, o, "," as *u8)
91 o = g_jkey(d, o, "mark_overlaps" as *u8, G_PUB_MM); o = gv_cat(d, o, "," as *u8)
92 o = g_jkey(d, o, "spread_permil" as *u8, G_PUB_SPREAD); o = gv_cat(d, o, "," as *u8)
93 o = g_jkey(d, o, "defects" as *u8, defects); o = gv_cat(d, o, "}}" as *u8)
94 d[o] = 0 as u8
95 return o
96}
97func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
98// judge a fixture: returns the rc and fills vec and rec
99func g_judge(fix: *u8, fhr: *i64, fhb: *i64, vec: *i64, recout: *i64) -> i64 {
100 let r: *i64 = crg_rec_new()
101 recout[0] = r as i64
102 return crg_judge(fix, g_len(fix), fhr, fhb, r, vec)
103}
104// the heuristic (box) critic on the same fixture: the self-grade's own ruler, re-derived through the DV10 referee lib
105func g_box_grade(fix: *u8, out: *i64) -> i64 {
106 let r: *i64 = crg_rec_new()
107 let rc: i64 = crg_scan(fix, g_len(fix), r)
108 if rc != CRG_OK { return rc }
109 let lw: *i64 = g_i64(CR_MAXN)
110 let lh: *i64 = g_i64(CR_MAXN)
111 cr_boxes(r[CRG_R_NL], r[CRG_R_NAMES] as *u8, r[CRG_R_LFONT] as *i64, r[CRG_R_LBOLD] as *i64, 0 as *i64, 0 as *i64, lw, lh)
112 cr_critic(r[CRG_R_NL], r[CRG_R_MX] as *i64, r[CRG_R_MY] as *i64, r[CRG_R_MR] as *i64, r[CRG_R_LX] as *i64, r[CRG_R_LY] as *i64, lw, lh, r[CRG_R_FRAME] as *i64, out)
113 return CRG_OK
114}
115
116func main(argc: i64, argv: *i64) -> i64 {
117 gv_head("nx_cdmap_pixjudge_gate -- the position map's pixel referee: ink through the sovereign font engine, a planted font-metric drift the box ruler cannot see, own-mark semantics, off-frame ink, the agreement call both ways, and the live page when present" as *u8)
118 let ctr: *i64 = gv_ctr()
119 // the face: argv, then the NAS path, then the laptop path
120 var freg: *u8 = G_FONT_NAS
121 var fbold: *u8 = G_FONT_NAS_BOLD
122 if argc >= 3 { freg = argv[1] as *u8; fbold = argv[2] as *u8 }
123 var fhr: *i64 = tf_load(freg)
124 var fhb: *i64 = tf_load(fbold)
125 if (fhr as i64) == 0 { freg = G_FONT_LAPTOP; fbold = G_FONT_LAPTOP_BOLD; fhr = tf_load(freg); fhb = tf_load(fbold) }
126 if (fhb as i64) == 0 { fhb = fhr }
127 var font_present: i64 = 0
128 if (fhr as i64) != 0 { font_present = 1 }
129 gv_puts("face=" as *u8); gv_puts(freg); gv_puts("\n" as *u8)
130 gv_need("face-on-disk-the-subject-substrate" as *u8, font_present, ctr)
131 if font_present == 0 { return gv_verdict("nx_cdmap_pixjudge_gate" as *u8, ctr, "no TrueType face on disk: the pixel referee cannot draw, so nothing here is measured" as *u8) }
132
133 // T1 pristine: the referee gate's own two players, labels beside their marks
134 let vec1: *i64 = g_i64(CRG_V_W)
135 let rec1: *i64 = g_i64(1)
136 let rc1: i64 = g_judge(g_fixture(G_MARKS_PRISTINE, G_LBL_NISHI_OK, G_LBL_MOJEEK_OK), fhr, fhb, vec1, rec1)
137 gv_check_eq("T1-pristine-judged-OK" as *u8, rc1, CRG_OK, ctr)
138 let r1: *i64 = rec1[0] as *i64
139 gv_check_eq("T1a-scan-labels" as *u8, r1[CRG_R_NL], G_EXP_N, ctr)
140 gv_check_eq("T1b-scan-marks" as *u8, r1[CRG_R_NM], G_EXP_N, ctr)
141 gv_check_eq("T1c-viewbox-w" as *u8, r1[CRG_R_W], G_VB_W, ctr)
142 gv_check_eq("T1d-viewbox-h" as *u8, r1[CRG_R_H], G_VB_H, ctr)
143 gv_check("T1e-ink-was-drawn" as *u8, (vec1[CRG_V_INKPX] > 0) as i64, ctr)
144 gv_check_eq("T2a-pristine-LL-0" as *u8, vec1[CRG_V_LL], 0, ctr)
145 gv_check_eq("T2b-pristine-LM-0" as *u8, vec1[CRG_V_LM], 0, ctr)
146 gv_check_eq("T2c-pristine-OFF-0" as *u8, vec1[CRG_V_OFF], 0, ctr)
147 gv_check_eq("T2d-pristine-DEFECTS-0" as *u8, vec1[CRG_V_DEFECTS], 0, ctr)
148
149 // T3 the planted font-metric drift: A reserved by the heuristic width, B placed just past that reserve
150 let reserve: i64 = cl_text_w(G_W_CHARS, G_FONT_PX)
151 let bx: i64 = G_DRIFT_A_X + reserve + G_DRIFT_GAP
152 let metric_w: i64 = cr_w_metric(fhr, G_WWWWWW, G_FONT_PX)
153 gv_check("T3a-fixture-reached-the-condition-real-ink-wider-than-the-reserve" as *u8, (metric_w > reserve + G_DRIFT_GAP) as i64, ctr)
154 let fix3: *u8 = g_drift_fixture(bx)
155 let box3: *i64 = g_i64(CL_CRIT_W)
156 gv_check_eq("T3b-box-ruler-scans-the-drift-fixture" as *u8, g_box_grade(fix3, box3), CRG_OK, ctr)
157 gv_check_eq("T3c-neg-control-the-self-grade-is-blind-to-the-drift-LL-0" as *u8, box3[CL_C_LL], 0, ctr)
158 let vec3: *i64 = g_i64(CRG_V_W)
159 let rec3: *i64 = g_i64(1)
160 gv_check_eq("T3d-drift-judged-OK" as *u8, g_judge(fix3, fhr, fhb, vec3, rec3), CRG_OK, ctr)
161 gv_check_eq("T3e-pixel-referee-catches-the-drift-LL-1" as *u8, vec3[CRG_V_LL], 1, ctr)
162 let r3: *i64 = rec3[0] as *i64
163 let masks3: *i64 = r3[CRG_R_MASKS] as *i64
164 let shared3: i64 = crg_overlap(masks3[0] as *u8, masks3[1] as *u8, r3[CRG_R_W] * r3[CRG_R_H])
165 gv_check("T3f-the-shared-ink-is-named-in-pixels" as *u8, (shared3 > 0) as i64, ctr)
166 gv_check_eq("T3g-drift-DEFECTS-counts-only-the-overlap" as *u8, vec3[CRG_V_DEFECTS], 1, ctr)
167
168 // T4 a label on ANOTHER player's mark is a defect; a label on its OWN mark is not
169 let vec4: *i64 = g_i64(CRG_V_W)
170 let rec4: *i64 = g_i64(1)
171 gv_check_eq("T4-onmark-judged-OK" as *u8, g_judge(g_fixture(G_MARKS_PRISTINE, G_LBL_NISHI_OWNMARK, G_LBL_MOJEEK_ONMARK0), fhr, fhb, vec4, rec4), CRG_OK, ctr)
172 let r4: *i64 = rec4[0] as *i64
173 let masks4: *i64 = r4[CRG_R_MASKS] as *i64
174 let mx4: *i64 = r4[CRG_R_MX] as *i64
175 let my4: *i64 = r4[CRG_R_MY] as *i64
176 let mr4: *i64 = r4[CRG_R_MR] as *i64
177 let own4: i64 = crg_ink_over_disk(masks4[0] as *u8, r4[CRG_R_W], r4[CRG_R_H], mx4[0], my4[0], mr4[0])
178 gv_check("T4a-fixture-reached-the-condition-nishi-ink-sits-on-its-own-mark" as *u8, (own4 > 0) as i64, ctr)
179 let other4: i64 = crg_ink_over_disk(masks4[1] as *u8, r4[CRG_R_W], r4[CRG_R_H], mx4[0], my4[0], mr4[0])
180 gv_check("T4b-fixture-reached-the-condition-mojeek-ink-enters-nishi-mark" as *u8, (other4 > 0) as i64, ctr)
181 gv_check_eq("T4c-label-over-another-mark-LM-1" as *u8, vec4[CRG_V_LM], 1, ctr)
182 gv_check_eq("T4d-neg-control-own-mark-not-a-defect-LL-0" as *u8, vec4[CRG_V_LL], 0, ctr)
183
184 // T5 ink past the frame edge is OFF
185 let vec5: *i64 = g_i64(CRG_V_W)
186 let rec5: *i64 = g_i64(1)
187 gv_check_eq("T5-edge-judged-OK" as *u8, g_judge(g_fixture(G_MARK_EDGE, G_LBL_EDGE, "" as *u8), fhr, fhb, vec5, rec5), CRG_OK, ctr)
188 let r5: *i64 = rec5[0] as *i64
189 let bb5: *i64 = crg_bbox_at(r5, 0)
190 gv_check("T5a-fixture-reached-the-condition-ink-crosses-frame-x1" as *u8, (bb5[CRG_B_X1] > G_FRAME_X1) as i64, ctr)
191 gv_check_eq("T5b-off-frame-ink-OFF-1" as *u8, vec5[CRG_V_OFF], 1, ctr)
192 gv_check_eq("T5c-edge-LM-0-own-mark-only" as *u8, vec5[CRG_V_LM], 0, ctr)
193
194 // T6 the agreement call, both ways, against a runtime-built api.json
195 let jd: *u8 = sys_mmap(G_JSON_BYTES)
196 let jn: i64 = g_json(jd, 0)
197 let pub0: i64 = cr_json_int(jd, jn, G_BLOCK, "defects" as *u8)
198 gv_check_eq("T6a-json-defects-read" as *u8, pub0, 0, ctr)
199 gv_check_eq("T6b-pristine-agrees-with-published-0" as *u8, crg_agree(vec1, pub0), 1, ctr)
200 let jn2: i64 = g_json(jd, G_PUB_DEFECTS_WRONG)
201 gv_check_eq("T6c-neg-control-pristine-disagrees-with-published-3" as *u8, crg_agree(vec1, cr_json_int(jd, jn2, G_BLOCK, "defects" as *u8)), 0, ctr)
202 gv_check_eq("T6d-neg-control-absent-grade-never-agrees" as *u8, crg_agree(vec1, CR_ABSENT), 0, ctr)
203
204 // T7 refusals are named, never a silent zero vector
205 let vec7: *i64 = g_i64(CRG_V_W)
206 let rec7: *i64 = g_i64(1)
207 gv_check_eq("T7a-neg-control-no-face-is-a-named-refusal" as *u8, g_judge(g_fixture(G_MARKS_PRISTINE, G_LBL_NISHI_OK, G_LBL_MOJEEK_OK), 0 as *i64, 0 as *i64, vec7, rec7), CRG_NO_FONT, ctr)
208 gv_check_eq("T7b-neg-control-no-figure-is-a-named-refusal" as *u8, g_judge("<figure><p>no map</p></figure>" as *u8, fhr, fhb, vec7, rec7), CRG_NO_FIGURE, ctr)
209 gv_check_eq("T7c-neg-control-unpaired-is-a-named-refusal" as *u8, g_judge(g_fixture(G_MARKS_PRISTINE, G_LBL_NISHI_OK, "" as *u8), fhr, fhb, vec7, rec7), CRG_UNPAIRED, ctr)
210
211 // T9 THE NOTES (DV5): a cdnote group keeps the label/mark pairing, is drawn as one mask, and counts only where its ink lands
212 let vec9: *i64 = g_i64(CRG_V_W)
213 let rec9: *i64 = g_i64(1)
214 gv_check_eq("T9-note-fixture-judged-OK-pairing-kept" as *u8, g_judge(g_fixture_note(G_MARKS_PRISTINE, G_LBL_NISHI_OK, G_LBL_MOJEEK_OK, G_NOTE_CLEAR), fhr, fhb, vec9, rec9), CRG_OK, ctr)
215 let r9: *i64 = rec9[0] as *i64
216 gv_check_eq("T9a-note-lines-are-not-player-labels" as *u8, r9[CRG_R_NL], G_EXP_N, ctr)
217 gv_check_eq("T9b-one-note-scanned" as *u8, r9[CRG_R_NN], 1, ctr)
218 gv_check_eq("T9c-two-note-lines-scanned" as *u8, r9[CRG_R_NNL], G_NOTE_LINES, ctr)
219 let ninkv9: *i64 = r9[CRG_R_NINK] as *i64
220 gv_check("T9d-note-ink-was-drawn" as *u8, (ninkv9[0] > 0) as i64, ctr)
221 gv_check_eq("T9e-a-clear-note-adds-no-defect" as *u8, vec9[CRG_V_DEFECTS], 0, ctr)
222 let vec9b: *i64 = g_i64(CRG_V_W)
223 let rec9b: *i64 = g_i64(1)
224 gv_check_eq("T9f-note-on-label-judged-OK" as *u8, g_judge(g_fixture_note(G_MARKS_PRISTINE, G_LBL_NISHI_OK, G_LBL_MOJEEK_OK, G_NOTE_ONLABEL), fhr, fhb, vec9b, rec9b), CRG_OK, ctr)
225 let r9b: *i64 = rec9b[0] as *i64
226 let nm9b: *i64 = r9b[CRG_R_NMASKS] as *i64
227 let lm9b: *i64 = r9b[CRG_R_MASKS] as *i64
228 let shared9b: i64 = crg_overlap(nm9b[0] as *u8, lm9b[1] as *u8, r9b[CRG_R_W] * r9b[CRG_R_H])
229 gv_check("T9g-fixture-reached-the-condition-note-ink-shares-pixels-with-the-mojeek-label" as *u8, (shared9b > 0) as i64, ctr)
230 gv_check_eq("T9h-a-note-on-a-label-is-LL-1" as *u8, vec9b[CRG_V_LL], 1, ctr)
231 gv_check_eq("T9i-note-on-label-DEFECTS-1" as *u8, vec9b[CRG_V_DEFECTS], 1, ctr)
232 let box9b: *i64 = g_i64(CL_CRIT_W)
233 g_box_grade(g_fixture_note(G_MARKS_PRISTINE, G_LBL_NISHI_OK, G_LBL_MOJEEK_OK, G_NOTE_ONLABEL), box9b)
234 gv_check_eq("T9j-neg-control-the-players-only-box-ruler-cannot-see-a-note-LL-0" as *u8, box9b[CL_C_LL], 0, ctr)
235 let vec9c: *i64 = g_i64(CRG_V_W)
236 let rec9c: *i64 = g_i64(1)
237 gv_check_eq("T9k-note-on-mark-judged-OK" as *u8, g_judge(g_fixture_note(G_MARKS_PRISTINE, G_LBL_NISHI_OK, G_LBL_MOJEEK_OK, G_NOTE_ONMARK), fhr, fhb, vec9c, rec9c), CRG_OK, ctr)
238 gv_check_eq("T9l-a-note-over-any-mark-is-LM-1-a-note-owns-no-mark" as *u8, vec9c[CRG_V_LM], 1, ctr)
239 gv_check_eq("T9m-note-on-mark-LL-0" as *u8, vec9c[CRG_V_LL], 0, ctr)
240 gv_check_eq("T9n-neg-control-no-notes-reads-0-groups" as *u8, r1[CRG_R_NN], 0, ctr)
241
242 // T8 the live search page, when it is on disk: the served figure's pixel grade beside the grade it published
243 var live_present: i64 = 0
244 var live_rc: i64 = CR_ABSENT
245 var live_defects: i64 = CR_ABSENT
246 var live_pub: i64 = CR_ABSENT
247 var live_agree: i64 = CR_ABSENT
248 let pl: *i64 = g_i64(2)
249 let ph: *u8 = sys_read_file(G_LIVE_PAGE, pl)
250 let jl: *i64 = g_i64(2)
251 let pj: *u8 = sys_read_file(G_LIVE_API, jl)
252 if (ph as i64) != 0 { if (pj as i64) != 0 {
253 live_present = 1
254 let vecL: *i64 = g_i64(CRG_V_W)
255 let rL: *i64 = crg_rec_new()
256 live_rc = crg_judge(ph, pl[0], fhr, fhb, rL, vecL)
257 if live_rc == CRG_OK {
258 live_defects = vecL[CRG_V_DEFECTS]
259 live_pub = cr_json_int(pj, jl[0], G_BLOCK, "defects" as *u8)
260 live_agree = crg_agree(vecL, live_pub)
261 gv_check_eq("T8-live-page-judged-OK" as *u8, live_rc, CRG_OK, ctr)
262 }
263 } }
264 gv_values_head()
265 gv_kv("font_present" as *u8, font_present)
266 gv_kv("drift_reserve_px" as *u8, reserve)
267 gv_kv("drift_metric_w_px" as *u8, metric_w)
268 gv_kv("drift_b_x" as *u8, bx)
269 gv_kv("drift_shared_ink_px" as *u8, shared3)
270 gv_kv("onmark_own_ink_px" as *u8, own4)
271 gv_kv("onmark_other_ink_px" as *u8, other4)
272 gv_kv("edge_ink_x1" as *u8, bb5[CRG_B_X1])
273 gv_kv("pristine_ink_px" as *u8, vec1[CRG_V_INKPX])
274 gv_kv("note_clear_ink_px" as *u8, ninkv9[0])
275 gv_kv("note_on_label_shared_ink_px" as *u8, shared9b)
276 gv_kv("live_page_present" as *u8, live_present)
277 gv_kv("live_rc" as *u8, live_rc)
278 gv_kv("live_pixel_defects" as *u8, live_defects)
279 gv_kv("live_published_defects" as *u8, live_pub)
280 gv_kv("live_agree" as *u8, live_agree)
281 return gv_verdict("nx_cdmap_pixjudge_gate" as *u8, ctr, "the position map's pixel referee, with the live page cross-checked when it is on disk" as *u8)
282}