nx_q6_k_to_f32_test.nx
buildroot/runtime/nx_q6_k_to_f32_test.nx
about
nx_q6_k_to_f32_test.nx -- KAT for ggml-correct Q6_K dequant.
Block layout: ql:128 + qh:64 + scales:16 + d:2 = 210 bytes.
Per ggml dequantize_row_q6_K, super-block produces 256 values via
two 128-value chunks. Within each chunk, l=0..31 emits to
positions [l, l+32, l+64, l+96] using ql[l], ql[l+32], qh[l].
Synthetic block:
d = 1.0 (f16=0x3C00)
All scales = 1 (i8)
ql[0] = 0x32 (low=2, high=3)
qh[0] = 0x01 (bits01=1, bits23=0, bits45=0, bits67=0)
Everything else zero.
Expected for chunk c=0, l=0:
y[0] = (ql[0].low | bits01<<4) - 32 = (2|16)-32 = -14 -> 0xC1600000
y[32] = (ql[32].low | bits23<<4) - 32 = (0|0) - 32 = -32 -> 0xC2000000
y[64] = (ql[0].high | bits45<<4) - 32 = (3|0)-32 = -29 -> 0xC1E80000
y[96] = (ql[32].high | bits67<<4) - 32 = (0|0)-32 = -32 -> 0xC2000000
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_f32.nxnx_q6_k_to_f32.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
| none |
functions
| 27 | func main() -> i64 |