code wiki / (root) / nx_q6_k_to_f32_test.nx

nx_q6_k_to_f32_test.nx

buildroot/runtime/nx_q6_k_to_f32_test.nx

1861 B54 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_le.nx nx_f32.nx nx_q6_k_to_f32.nx nx_q6_k_to_f32_test.nx

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

main sys_mmap nx_le_write_u16 nx_q6_k_to_f32 _nx_q6_k_block_to_f32 nx_le_read_u16 nx_f16_to_f32 nx_le_read_u8 _q6k_emit

structs

none

consts

none

functions

27func main() -> i64