code wiki / _hdl_build / nx_cdmap_gate.nx

nx_cdmap_gate.nx

buildroot/runtime/_hdl_build/nx_cdmap_gate.nx

26431 B319 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic cdmap
docsdependenciesstructsconstsfunctions

about

nx_cdmap_gate.nx -- referee for nx_cdmap_lib (2026-09-15): the centrality/distinctiveness ruler on planted tables with HAND-WORKED answers (each worked in the comment above its teeth), the tie law, absent and identical players, the code and number parsers, the AXIS REGISTRY (names, permil values, the momentum plot scale), the VIEW conf (cut and cube rows, defaults, an unknown axis REFUSED by name), the ISOMETRIC projection pinned at its corners, and the day spine written to a /tmp fixture dir and read back (never a production path -- the gate-fixture law; the fixture is truncated at SETUP, so a crashed run leaves nothing to misread). Every numeric tooth goes through gv_check_eq so the value published and the value tested are ONE expression. GREEN iff every tooth passes; the exit code carries gv_verdict's verdict. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_cdmap_lib.nx nx_syscalls.nx nx_gate_verdict.nx nx_cdmap_gate.nx

imports: nx_cdmap_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 ↻ sys_mmap ↻ cd_compute sys_mmap ↻ gv_check_eq gv_check gv_puts ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap cd_mean cd_quadrant cd_pts cd_nishi_pts cd_atoi cd_atoi_n cd_signed cd_slen cd_isqrt

structs

none

consts

13const G_DIR: *u8 = "/tmp/nx_cdmap_gate/"
14const G_DOM: *u8 = "cdgate"
15const G_DOM_NOFILE: *u8 = "cdgate_nofile"
16const G_DOM_BAD: *u8 = "cdgate_bad"
17const G_EPOCH_DAY1: i64 = 1789430400 // 2026-09-15 00:00:00 UTC: a FIXED clock so the fixture reproduces
18const G_HOUR: i64 = 3600
19const G_P2: i64 = 2
20const G_R3: i64 = 3
21const G_R1: i64 = 1
22const G_R2: i64 = 2
23const G_MODE_644: i64 = 420
24const G_NAME_A: *u8 = "A"
25const G_NAME_B: *u8 = "B"
26const G_NAME_Z: *u8 = "Z"
27const G_C_DAY2: i64 = 900
28const G_UNKNOWN_CODE: i64 = 9
29const G_UNKNOWN_STATE: i64 = 7
30const G_ISO_OX: i64 = 380
31const G_ISO_OY: i64 = 300
32const G_ISO_UNIT: i64 = 220
33const G_VIEW_ROWS: *u8 = "# planted view conf\ncut|breadth|depth\ncube|centrality|momentum|breadth\n"
34const G_VIEW_BAD: *u8 = "cut|centrality|bogus\n"
37const G_NOTES_CAP: i64 = 8
38const G_NOTE1_TEXT: *u8 = "Holds every row the field holds"
39const G_LONG_WORD: *u8 = "Distinctivene"
40const G_WRAP_12: i64 = 12
41const G_WRAP_5: i64 = 5
42const G_WRAP_4: i64 = 4
43const G_WRAP_MAX: i64 = 8
44const G_NOTE_ROWS: *u8 = "note|n1|A|Holds every row the field holds|2026-09-15|seat\nnote|n2|at:250,750|Empty corner nobody serves|2026-09-15|seat\nnote|n3|Zed|unknown player|2026-09-15|seat\nnote|n4|at:12|malformed anchor|2026-09-15|seat\nnote|n5|B|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|2026-09-15|seat\n"

functions

46func g_names(a: *u8, b: *u8) -> *i64 { let n: *i64 = sys_mmap(G_P2 * CD_I64_BYTES) as *i64; n[0] = a as i64; n[1] = b as i64; return n }
called by 1: main calls 1: sys_mmap
47func g_fresh_spine() -> i64
55func g_read_spine(nb: *i64) -> *u8 { let path: *u8 = sys_mmap(CD_PATH_CAP); cd_spine_path(G_DIR, G_DOM, path); nb[0] = 0; return sys_read_file(path, nb) }
56func g_write_view(dom: *u8, body: *u8) -> i64
67func g_write_notes(dom: *u8, body: *u8) -> i64
78func g_streq(a: *u8, b: *u8) -> i64 { return cd_name_eq_n(a, b, cd_slen(b)) }
called by 1: main calls 2: cd_name_eq_ncd_slen
80func main() -> i64