code wiki / _hdl_build / nx_cdmap_referee_gate.nx

nx_cdmap_referee_gate.nx

buildroot/runtime/_hdl_build/nx_cdmap_referee_gate.nx

15981 B237 linesdepth 8pulls 13 transitivereach 0 importersview sourcekind gate/prooftopic cdmap
docsdependenciesstructsconstsfunctions

about

nx_cdmap_referee_gate.nx -- referee for the position map's SECOND RULER (datavis DV2a, 2026-09-15): the SVG scanner on a hand-built figure, the heuristic critic reproducing a hand-worked grade, two PLANTED defects the ruler must fire on (a label on a label, a label on a mark), the api.json reader with absent-key controls, then -- when the SIL-OFL face is on disk -- real advances bounded by what a sans face can measure and the metric critic firing on the same plant, and -- when the live search page is on disk -- the self-grade the emitter published re-derived from its own SVG. The font and the live page are OPTIONAL witnesses, announced through gv_kv, never gv_need: a witness structurally absent on one host must not SKIP the whole gate forever there (measured 2026-09-02 on the browser lane). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_cdmap_referee_lib.nx nx_syscalls.nx nx_gate_verdict.nx nx_cdmap_referee_gate.nx

imports: nx_cdmap_referee_lib.nxnx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main 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 ↻ gv_head gv_puts sys_write ↻ g_fixture sys_mmap ↻ g_cat g_i64 sys_mmap ↻ sys_mmap ↻ g_scan g_i64 ↻ cr_scan cr_find cr_slen cr_tag_end cr_attr cr_find ↻ cr_int_at cr_slen ↻ cr_in_note cr_rfind cr_find ↻ cr_slen ↻

structs

none

consts

12const G_FONT: i64 = 13
13const G_EXP_N: i64 = 2
14const G_FRAME_X0: i64 = 70
15const G_FRAME_X1: i64 = 730
16const G_FRAME_Y1: i64 = 460
17const G_L0_X: i64 = 201
18const G_L0_BOX_Y: i64 = 208
19const G_TW_NISHI: i64 = 36 // cl_text_w(5, 13)
20const G_TW_MOJEEK: i64 = 43 // cl_text_w(6, 13) = 43.68 floored
21const G_SPREAD_PRISTINE: i64 = 428 // marks 180..483 of 660 (459) and 216..387 of 430 (397), mean 428
22const G_PUB_MM: i64 = 1
23const G_PUB_SPREAD: i64 = 690
24const G_JSON_BYTES: i64 = 512
25const G_CH_QUOTE: i64 = 34
26const G_MIN_EM_PERMIL: i64 = 350 // a sans glyph advance never reads below 0.35 em on average...
27const G_MAX_EM_PERMIL: i64 = 900 // ...nor above 0.90 em; outside this band the ruler is broken, not the font
28const G_NISHI_CHARS: i64 = 5
29const G_CRIT_W: i64 = 6
30const G_FONT_NAS: *u8 = "knowledge/fonts/LiberationSans-Regular.ttf"
31const G_FONT_NAS_BOLD: *u8 = "knowledge/fonts/LiberationSans-Bold.ttf"
32const G_FONT_LAPTOP: *u8 = "web_assets/fonts/LiberationSans-Regular.ttf"
33const G_FONT_LAPTOP_BOLD: *u8 = "web_assets/fonts/LiberationSans-Bold.ttf"
34const G_LIVE_PAGE: *u8 = "sites/nishifamily/compare/search/index.html"
35const G_LIVE_API: *u8 = "sites/nishifamily/compare/search/api.json"
36const G_BLOCK: *u8 = "readability_cut"
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<circle cx='180' cy='216' r='15' fill='var(--nx-color-accent)'><title>Nishi</title></circle>\n<circle cx='483' cy='387' r='15' fill='rgb(230,159,0)'><title>Mojeek</title></circle>\n"
39const G_FIX_TAIL: *u8 = "</svg></figure>\n"
40const 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"
41const G_LBL_NISHI_ONMARK: *u8 = "<text x='170' y='220' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke' font-weight='700'>Nishi</text>\n"
42const G_LBL_MOJEEK_ONMARK: *u8 = "<text x='150' y='220' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke'>Mojeek</text>\n"
43const 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"
44const G_LBL_MOJEEK_ONLABEL: *u8 = "<text x='201' y='220' font-size='13' fill='var(--nx-color-fg)' style='paint-order:stroke'>Mojeek</text>\n"
45const G_FIX_BYTES: i64 = 2048

functions

47func g_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } return p }
48func g_fixture(a: *u8, b: *u8) -> *u8
called by 1: main calls 2: sys_mmapg_cat
54func g_q(d: *u8, o: i64) -> i64 { d[o] = G_CH_QUOTE as u8; return o + 1 }
called by 2: g_jkeyg_json
55func g_jkey(d: *u8, o: i64, k: *u8, v: i64) -> i64
called by 1: g_json calls 3: g_qg_catgv_catn
60func g_json(d: *u8) -> i64
called by 1: main calls 3: g_catg_jkeyg_q
76func g_i64(n: i64) -> *i64 { return sys_mmap(n * CR_I64_BYTES) as *i64 }
called by 2: g_scanmain calls 1: sys_mmap
77func g_setname(names: *u8, i: i64, s: *u8) -> i64 { let slot: *u8 = cr_name_at(names, i); var k: i64 = 0; while s[k] != (0 as u8) { slot[k] = s[k]; k = k + 1 } slot[k] = 0 as u8; return k }
calls 1: cr_name_at
79func g_scan(fx: *u8, rec: *i64, names: *u8) -> i64
called by 1: main calls 3: g_i64cr_scancr_slen
85func g_grade(rec: *i64, names: *u8, n: i64, fhr: *i64, fhb: *i64) -> *i64
called by 1: main calls 2: cr_boxescr_critic
90func g_load_font(nas: *u8, laptop: *u8) -> *i64
called by 1: main calls 1: tf_load
96func main() -> i64