code wiki / (root) / nx_zimage_dequant_block.nx

nx_zimage_dequant_block.nx

buildroot/runtime/nx_zimage_dequant_block.nx

3799 B92 linesdepth 8pulls 18 transitivereach 0 importersview sourcekind tooltopic zimage
docsdependenciesstructsconstsfunctions

about

nx_zimage_dequant_block.nx -- dequant a block of REAL Z-Image weight DATA into f32, sovereignly. sd-server -> Nishi migration: extends the real-weight bridge from METADATA to actual WEIGHT DATA. Reads the real `Z-Image_Qwen_3_4b-Q6_K.gguf`, locates token_embd.weight (Q6_K, ggml_type 14), computes its data location (hdr.data_off + ti.offset -- it's the first tensor so this is at the very start of the data section, inside our bounded prefix), and dequantizes the FIRST Q6_K super-block (256 real embedding values) with our own `nx_q6_k_to_f32`. Proves: real Z-Image quantized weights -> our dequant -> real, finite, nonzero f32. Writes the first sample values to /tmp/zimg_dq.txt. license_tier: ORIGINAL

dependencies 11 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_strconv.nx nx_tensor.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_placement.nx nx_gguf_load_lazy.nx nx_zimage_dequant_block.nx

diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_strconv.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_placement.nxnx_gguf_load_lazy.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_openat_rd sys_mmap sys_read sys_close nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ nx_gguf_find_tensor nx_gguf_tensor_at nx_gguf_name_equals nx_gguf_tensor_at ↻ 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 sys_openat_wr zd_emit sys_mmap ↻ nx_strconv_format_i64 sys_write

structs

none

consts

none

functions

22func zd_emit(fd: i64, key: *u8, key_len: i64, value: i64) -> i64
36func main() -> i64