code wiki / _hdl_build / nx_cdmap_gate.nx
nx_cdmap_gate.nx
buildroot/runtime/_hdl_build/nx_cdmap_gate.nx
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
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
structs
| none |
consts
| 13 | const G_DIR: *u8 = "/tmp/nx_cdmap_gate/" |
| 14 | const G_DOM: *u8 = "cdgate" |
| 15 | const G_DOM_NOFILE: *u8 = "cdgate_nofile" |
| 16 | const G_DOM_BAD: *u8 = "cdgate_bad" |
| 17 | const G_EPOCH_DAY1: i64 = 1789430400 // 2026-09-15 00:00:00 UTC: a FIXED clock so the fixture reproduces |
| 18 | const G_HOUR: i64 = 3600 |
| 19 | const G_P2: i64 = 2 |
| 20 | const G_R3: i64 = 3 |
| 21 | const G_R1: i64 = 1 |
| 22 | const G_R2: i64 = 2 |
| 23 | const G_MODE_644: i64 = 420 |
| 24 | const G_NAME_A: *u8 = "A" |
| 25 | const G_NAME_B: *u8 = "B" |
| 26 | const G_NAME_Z: *u8 = "Z" |
| 27 | const G_C_DAY2: i64 = 900 |
| 28 | const G_UNKNOWN_CODE: i64 = 9 |
| 29 | const G_UNKNOWN_STATE: i64 = 7 |
| 30 | const G_ISO_OX: i64 = 380 |
| 31 | const G_ISO_OY: i64 = 300 |
| 32 | const G_ISO_UNIT: i64 = 220 |
| 33 | const G_VIEW_ROWS: *u8 = "# planted view conf\ncut|breadth|depth\ncube|centrality|momentum|breadth\n" |
| 34 | const G_VIEW_BAD: *u8 = "cut|centrality|bogus\n" |
| 37 | const G_NOTES_CAP: i64 = 8 |
| 38 | const G_NOTE1_TEXT: *u8 = "Holds every row the field holds" |
| 39 | const G_LONG_WORD: *u8 = "Distinctivene" |
| 40 | const G_WRAP_12: i64 = 12 |
| 41 | const G_WRAP_5: i64 = 5 |
| 42 | const G_WRAP_4: i64 = 4 |
| 43 | const G_WRAP_MAX: i64 = 8 |
| 44 | const 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
| 46 | func 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 } |
| 47 | func g_fresh_spine() -> i64 |
| 55 | func 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) } |
| 56 | func g_write_view(dom: *u8, body: *u8) -> i64 |
| 66 | func g_unlink_view(dom: *u8) -> i64 { let path: *u8 = sys_mmap(CD_PATH_CAP); cd_view_path(G_DIR, dom, path); sys_unlinkat(path); return 0 } |
| 67 | func g_write_notes(dom: *u8, body: *u8) -> i64 |
| 77 | func g_unlink_notes(dom: *u8) -> i64 { let path: *u8 = sys_mmap(CD_PATH_CAP); cd_notes_path(G_DIR, dom, path); sys_unlinkat(path); return 0 } |
| 78 | func g_streq(a: *u8, b: *u8) -> i64 { return cd_name_eq_n(a, b, cd_slen(b)) } |
| 80 | func main() -> i64 |