code wiki / (root) / nx_nofloat_qgap_probe.nx

nx_nofloat_qgap_probe.nx

buildroot/runtime/nx_nofloat_qgap_probe.nx

13068 B249 linesdepth 10pulls 28 transitivereach 0 importersview sourcekind probetopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_qgap_probe.nx -- THE QUANTISATION-GAP INSTRUMENT (2026-09-17, search R0s): does the served W12A12 (i8) route generate what the lossless i32 route generates? Same model file, same prompts, GREEDY decoding, so the only variable left is the arithmetic. The oracle scores biology 408 and the sovereign i8 pass 352 with two different samplers, so that gap cannot say whether quantisation is the cause; this can. Two processes because a 16 GB VM holds one weight cache beside the running engine: nx_nofloat_qgap_probe run i32|i8|q8 <model.gguf> <queries.tsv> <nq> <max_new> <outdir> -- one file per prompt nx_nofloat_qgap_probe compare <outdir> <nq> [ref_prefix] [arm] -- the agreement, as values It is an INSTRUMENT: the teeth assert that every prompt produced both arms and that the comparator can see a planted difference; the gap itself is printed, never judged, so a large gap cannot be argued away by a threshold.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_nofloat_serve_core.nx nx_gate_verdict.nx nx_nofloat_qgap_probe.nx

imports: nx_syscalls.nxnx_nofloat_serve_core.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 ↻ gv_puts ↻ qg_streq qg_run gv_puts ↻ qg_atoi qg_streq ↻ gv_need gv_puts ↻ nsv_init_i32only nsv_init sys_now_ms sys_mmap ↻ sys_clock_gettime_mono nsv_log sys_write ↻ nf_pool nx_pool_new nx_hw_worker_count sys_mmap ↻ nx_chan_new

structs

none

consts

14const QG_OUT_CAP: i64 = 8192
15const QG_GP_SLOTS: i64 = 16
16const QG_META_SLOTS: i64 = 8
17const QG_MODE_I32: i64 = 0
18const QG_MODE_I8: i64 = 1
19const QG_MODE_Q8: i64 = 3 // search R0s: the resident block-native route (NSV_MODE_Q4K's slot tables over a Q8_0 gguf)
20const QG_PROMPT_CAP: i64 = 4096
21const QG_PATH_CAP: i64 = 512
22const QG_PERMIL: i64 = 1000
23const QG_SEED: i64 = 1
24const QG_FILE_MODE: i64 = 420
25const QG_DEC: i64 = 10
26const QG_ASCII_0: i64 = 48
27const QG_INSTR: *u8 = "Rewrite the following question as a focused web search query that names the underlying scientific concepts. Question: " as *u8

functions

29func qg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
30func qg_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 } d[p] = 0 as u8; return p }
31func qg_catn(d: *u8, o: i64, v0: i64) -> i64
42func qg_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { if s[i] >= (48 as u8) { if s[i] <= (57 as u8) { v = v * QG_DEC + ((s[i] - (48 as u8)) as i64) } } i = i + 1 } return v }
called by 2: qg_runqg_compare
43func qg_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 }
called by 2: qg_runmain
44func qg_putsn(b: *u8, n: i64) { if n > 0 { sys_write(1, b, n) } }
called by 1: qg_compare calls 1: sys_write
46func qg_query(buf: *u8, n: i64, idx: i64, out: *u8, cap: i64) -> i64
called by 1: qg_run
69func qg_path(out: *u8, dir: *u8, idx: i64, arm: *u8, ext: *u8) -> i64
called by 2: qg_runqg_compare calls 2: qg_catqg_catn
79func qg_write(path: *u8, buf: *u8, n: i64) -> i64
88func qg_run(argc: i64, argv: *i64, ctr: *i64) -> i64
159func qg_common(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: qg_compare
167func qg_compare(argc: i64, argv: *i64, ctr: *i64) -> i64
240func main(argc: i64, argv: *i64) -> i64