nx_q4k_ggml_kat.nx
buildroot/runtime/nx_q4k_ggml_kat.nx
about
nx_q4k_ggml_kat.nx -- PERMANENT golden regression guard for Q4_K dequant.
Embeds the REAL 2304 bytes of blk.0.attn_q.weight ROW 0 (16 Q4_K
super-blocks) from Huihui-Qwen3-4B-Instruct-2507-abliterated-Q4_K_M.gguf
at file offset 1040894048, and asserts -- through BOTH the f32 path
(nx_q4k_to_f32) and the fused integer Q24 path (nx_q4k_dot_row_col) --
the ggml-true golden values:
element0 (row0,col0) f32 bits == 0x3AD18400 (= +0.0015985)
row-0 dot vs col[i]=1024+(i%5)*256 (Q10) == +0.2157557 (true ggml)
Cross-checked bit-exact vs ggml-quants.c (dequantize_row_q4_K) and the
gguf-py reference. DO NOT edit the bytes / expected values without
re-deriving them from the model + ggml. license_tier: ORIGINAL
dependencies 12 imports · 0 importers
diagram shows first 10 each side; +2 more imports, +0 more importers in the complete lists below.
imports: nx_gate_verdict.nxnx_syscalls.nxnx_tier.nxnx_le.nxnx_gguf.nxnx_gguf_load.nxnx_dequant_iter.nxnx_q4k_matmul.nxnx_q4k_to_f32.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.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
| 27 | const KAT_HID: i64 = 4096 |
| 28 | const KAT_NBLK: i64 = 16 |
| 29 | const KAT_BYTES: i64 = 2304 |
functions
| 31 | func _kat_fill_0(buf: *u8) -> i64 called by 1: _kat_fill |
| 59 | func _kat_fill_1(buf: *u8) -> i64 called by 1: _kat_fill |
| 87 | func _kat_fill_2(buf: *u8) -> i64 called by 1: _kat_fill |
| 115 | func _kat_fill_3(buf: *u8) -> i64 called by 1: _kat_fill |
| 143 | func _kat_fill_4(buf: *u8) -> i64 called by 1: _kat_fill |
| 171 | func _kat_fill_5(buf: *u8) -> i64 called by 1: _kat_fill |
| 199 | func _kat_fill_6(buf: *u8) -> i64 called by 1: _kat_fill |
| 227 | func _kat_fill_7(buf: *u8) -> i64 called by 1: _kat_fill |
| 255 | func _kat_fill(buf: *u8) -> i64 |
| 267 | func kat_run() -> i64 |
| 317 | func main() -> i64 |