nx_nofloat_qgap_probe.nx
buildroot/runtime/nx_nofloat_qgap_probe.nx
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
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
structs
| none |
consts
| 14 | const QG_OUT_CAP: i64 = 8192 |
| 15 | const QG_GP_SLOTS: i64 = 16 |
| 16 | const QG_META_SLOTS: i64 = 8 |
| 17 | const QG_MODE_I32: i64 = 0 |
| 18 | const QG_MODE_I8: i64 = 1 |
| 19 | const QG_MODE_Q8: i64 = 3 // search R0s: the resident block-native route (NSV_MODE_Q4K's slot tables over a Q8_0 gguf) |
| 20 | const QG_PROMPT_CAP: i64 = 4096 |
| 21 | const QG_PATH_CAP: i64 = 512 |
| 22 | const QG_PERMIL: i64 = 1000 |
| 23 | const QG_SEED: i64 = 1 |
| 24 | const QG_FILE_MODE: i64 = 420 |
| 25 | const QG_DEC: i64 = 10 |
| 26 | const QG_ASCII_0: i64 = 48 |
| 27 | const QG_INSTR: *u8 = "Rewrite the following question as a focused web search query that names the underlying scientific concepts. Question: " as *u8 |
functions
| 29 | func qg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 30 | func 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 } |
| 31 | func qg_catn(d: *u8, o: i64, v0: i64) -> i64 |
| 42 | func 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 } |
| 43 | func 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 } |
| 44 | func qg_putsn(b: *u8, n: i64) { if n > 0 { sys_write(1, b, n) } } |
| 46 | func qg_query(buf: *u8, n: i64, idx: i64, out: *u8, cap: i64) -> i64 called by 1: qg_run |
| 69 | func qg_path(out: *u8, dir: *u8, idx: i64, arm: *u8, ext: *u8) -> i64 |
| 79 | func qg_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 88 | func qg_run(argc: i64, argv: *i64, ctr: *i64) -> i64 |
| 159 | func qg_common(a: *u8, an: i64, b: *u8, bn: i64) -> i64 called by 1: qg_compare |
| 167 | func qg_compare(argc: i64, argv: *i64, ctr: *i64) -> i64 |
| 240 | func main(argc: i64, argv: *i64) -> i64 |