code wiki / (root) / nx_gguf_dequant_kat_gate.nx

nx_gguf_dequant_kat_gate.nx

buildroot/runtime/nx_gguf_dequant_kat_gate.nx

8786 B180 linesdepth 8pulls 18 transitivereach 0 importersview sourcekind gate/prooftopic gguf
docsdependenciesstructsconstsfunctions

about

nx_gguf_dequant_kat_gate.nx -- KATs for the DEBT-EATEN quant family (2026-07-15): every newly added block dequant (Q4_0/Q4_1/Q5_1/Q5_K/Q3_K/Q2_K/F16/BF16) is checked against HAND-DERIVED expected values on hand-constructed blocks (known bits in -> exact Q16 out), plus the loud-fail contract and the canonical stride table. The fleet's live types (F32/Q5_0/Q8_0/Q4_K/Q6_K) keep their existing gates; this gate covers the types no current model ships -- so the NEXT model never hits a silent hole. T1 Q4_0 / Q4_1 / Q5_1 KATs exact T2 F16 / BF16 KATs exact T3 Q5_K KAT exact (scale-pair unpack + qh high-bit + dmin) T4 Q3_K KAT exact (6-bit scales, hmask -4) T5 Q2_K KAT exact (sc/min nibbles) T6 LOUD-FAIL: unknown type -> -1 from stride/to_q16/row expect_exit: 0 license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 9 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_tensor.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_nofloat_llm.nx nx_gate_verdict.nx nx_gguf_dequant_kat_gate.nx

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_nofloat_llm.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 kq_w sys_write sys_mmap q4_0_block f16_to_q16 nx_le_read_u16 nx_le_read_u8 kq_chk kq_w ↻ kq_n kq_w ↻ sys_mmap ↻ sys_write ↻ q4_1_block f16_to_q16 ↻ nx_le_read_u16 ↻ nx_le_read_u8 ↻ q5_1_block f16_to_q16 ↻ nx_le_read_u16 ↻ nx_le_read_u32 nx_le_read_u8 ↻ dequant_to_q16 f32_to_q16 nx_le_read_u32 ↻ f16_to_q16 ↻ nx_le_read_u16 ↻ nx_gguf_dequant_q4_k_q14 nx_gguf_dequant_q4_k nx_le_read_u16 ↻ _gguf_f16_to_q24 nx_le_read_u8 ↻ q6k_block _gguf_f16_to_q24 ↻ nx_le_read_u16 ↻ nx_le_read_u8 ↻ q_i8 nx_le_read_u8 ↻ q5k_block

structs

none

consts

none

functions

20func kq_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 3: kq_nkq_chkmain calls 1: sys_write
21func kq_n(v: i64) -> i64
called by 2: kq_chkmain calls 3: kq_wsys_mmapsys_write
34func kq_chk(name: *u8, got: i64, want: i64, fails: *i64) -> i64
called by 1: main calls 2: kq_wkq_n
42func main() -> i64