code wiki / _hdl_build / nx_gmmlu_ingest.nx

nx_gmmlu_ingest.nx

buildroot/runtime/_hdl_build/nx_gmmlu_ingest.nx

9725 B225 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_gmmlu_ingest.nx -- F786 rung-2: parse the fetched Global-MMLU-Lite pages into a CONTAMINATION-SPLIT battery, so an uncontaminated seat can sit a REAL public benchmark and nx_battery_grade scores it straight into model-card cell b16 (Global-MMLU-Lite). knowledge/store/gmmlutask- : sample_id<TAB>subject<TAB>question<TAB>opt_a<TAB>opt_b<TAB>opt_c<TAB>opt_d knowledge/store/gmmlugold- : sample_id<TAB>answer (SEPARATE PLANE -- a seat reading the task plane can NEVER see the answers; same guard as the F788 battery) A seat then writes gmmluans- rows (sample_id<TAB>given-letter) and: nx_battery_grade knowledge/store/gmmlugold- knowledge/store/gmmluans- knowledge/status/gmmlu_grade.log SCHEMA VERIFIED LIVE 2026-07-20 against datasets-server first-rows (CohereLabs/Global-MMLU-Lite, config en, split test): sample_id / subject / subject_category / question / option_a..option_d / answer (answer is a single letter A-D = exact-match gradeable). ⚠The dataset was RENAMED from CohereForAI/ -> CohereLabs/. Escape-aware JSON string-value end (terminating '"' = preceded by an EVEN run of backslashes) so option and question text containing \" never mis-terminates a field; row search BOUNDED to [row,next-row) so a malformed row cannot steal a sibling's fields. Values are stored JSON-ESCAPED VERBATIM, which is TAB/NEWLINE-safe by construction (JSON escapes them as two-char \t/\n, never literal bytes). TOOTH: task rows == gold rows AND > 0, else verdict=RED and NEITHER store is touched (fail-closed). Truncations are COUNTED and REPORTED, never silent (round-12 law). expect_exit: 0 (GREEN) | 1 RED license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_store_seed_lib.nx nx_seg_store.nx nx_syscalls.nx nx_gmmlu_ingest.nx

imports: nx_store_seed_lib.nxnx_seg_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap gi_read sys_openat_rd sys_read sys_close gi_werr sys_write gi_slen sys_exit gi_scan gi_find gi_slen ↻ gi_field gi_find ↻ gi_slen ↻ gi_vend gi_t_slice gi_col gi_field ↻ gi_t_c gi_t_slice ↻ gi_t_c ↻ gi_g_slice gi_g_c sts_seed ss_begin_cap sys_mmap ↻ sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ sts_rowkey ss_catn sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len

structs

none

consts

34const GI_TASK: *u8 = "knowledge/store/gmmlutask-" as *u8
35const GI_GOLD: *u8 = "knowledge/store/gmmlugold-" as *u8
36const GI_LOG: *u8 = "knowledge/status/gmmlu_ingest.log" as *u8
37const GI_FCAP: i64 = 4194304
38const GI_OCAP: i64 = 1048576
39const GI_FIELDCAP: i64 = 16384
40const GI_SBCAP: i64 = 2048
41const GI_PATHCAP: i64 = 256
42const GI_TAB: i64 = 9
43const GI_NL: i64 = 10
44const GI_Q: i64 = 34
45const GI_BSL: i64 = 92
46const GI_STDERR: i64 = 2
47const GI_MODE: i64 = 0x1a4
48const GI_D0: i64 = 48
49const GI_B10: i64 = 10
50const GI_NUMB: i64 = 24
51const GI_EXIT_RED: i64 = 1

functions

53func gi_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
54func gi_werr(s: *u8) -> i64 { sys_write(GI_STDERR, s, gi_slen(s)); return 0 }
called by 1: main calls 2: sys_writegi_slen
55func gi_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
69func gi_find(buf: *u8, needle: *u8, from: i64, limit: i64) -> i64
called by 2: gi_fieldgi_scan calls 1: gi_slen
83func gi_vend(buf: *u8, vs: i64, limit: i64) -> i64
called by 1: gi_field
97func gi_field(buf: *u8, needle: *u8, from: i64, limit: i64) -> i64
called by 2: gi_colgi_scan calls 3: gi_findgi_slengi_vend
105func gi_t_slice(buf: *u8, a: i64, b: i64) -> i64
called by 2: gi_colgi_scan
112func gi_t_c(c: i64) -> i64 { if g_to < GI_OCAP - 2 { g_t[g_to] = c as u8; g_to = g_to + 1 } return 0 }
called by 2: gi_colgi_scan
113func gi_g_slice(buf: *u8, a: i64, b: i64) -> i64
called by 1: gi_scan
118func gi_g_c(c: i64) -> i64 { if g_go < GI_OCAP - 2 { g_g[g_go] = c as u8; g_go = g_go + 1 } return 0 }
called by 1: gi_scan
119func gi_bcat(d: *u8, off: i64, s: *u8) -> i64
called by 1: main
125func gi_bcatn(d: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
138func gi_col(buf: *u8, needle: *u8, a: i64, limit: i64) -> i64
called by 1: gi_scan calls 3: gi_fieldgi_t_cgi_t_slice
146func gi_scan(buf: *u8, n: i64) -> i64
187func main() -> i64