code wiki / (root) / nx_q4k_to_f32_test.nx

nx_q4k_to_f32_test.nx

buildroot/runtime/nx_q4k_to_f32_test.nx

3098 B97 linesdepth 7pulls 12 transitivereach 0 importersview sourcekind gate/prooftopic q4k
docsdependenciesstructsconstsfunctions

about

nx_q4k_to_f32_test.nx -- smoke for nx_q4k_to_f32.nx. Synthetic Q4_K block (same as nx_gguf_load_q4k_test): d = 1.0 (f16 0x3C00 -> f32 0x3F800000) dmin = 0 (f16 0x0000 -> f32 0) sc[0..3] = 1, sc[4] = 2, sc[5..7] = 0 m[0..7] = 0 nibble byte 0 -> low nibble 2, high nibble 3 nibble byte 64 -> low nibble 2, high nibble 3 ggml layout (verified bit-exact vs ggml-quants.c): 32-byte groups g=0..3; group g feeds sub-block 2g (low nibbles) + 2g+1 (high nibbles). byte 0 is group 0, l=0 -> low -> sub-block 0, out[0]; high -> sub-block 1, out[32] byte 64 is group 2, l=0 -> low -> sub-block 4, out[128]; high -> sub-block 5 (sc[5]=0) -> out[160]=0 Expected f32 outputs (EXACT — all operands are exact small ints): out[0] = 1 * sc[0]=1 * 2 - 0 = 2.0 (f32 0x40000000) out[32] = 1 * sc[1]=1 * 3 - 0 = 3.0 (f32 0x40400000) out[128] = 1 * sc[4]=2 * 2 - 0 = 4.0 (f32 0x40800000) out[160] = 1 * sc[5]=0 * 3 - 0 = 0.0 (sc[5] is zero) everywhere else: 0.0 (f32 0)

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_gguf.nx nx_f32.nx nx_f32_cvt.nx nx_q4k_to_f32.nx nx_q4k_to_f32_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_gguf.nxnx_f32.nxnx_f32_cvt.nxnx_q4k_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 nx_q4kf_verdict_is_valid sys_mmap nx_le_write_u16 nx_q4k_block_to_f32 nx_le_read_u16 nx_f16_to_f32 nx_le_read_u8 nx_i32_to_f32

structs

none

consts

none

functions

33func main() -> i64