code wiki / (root) / nx_zimage_gguf_arch.nx

nx_zimage_gguf_arch.nx

buildroot/runtime/nx_zimage_gguf_arch.nx

6867 B147 linesdepth 8pulls 14 transitivereach 0 importersview sourcekind tooltopic zimage
docsdependenciesstructsconstsfunctions

about

nx_zimage_gguf_arch.nx -- extract the REAL Z-Image text-encoder architecture from its GGUF, sovereignly. sd-server -> Nishi migration: the real-scale assembly needs the REAL dims to scale our f32 organs to. This reads the actual `Z-Image_Qwen_3_4b-Q6_K.gguf` and pulls token_embd.weight's dims (hidden, vocab) + ggml quant type + tensor_count from the parsed header (metadata at the front -> bounded prefix read, no multi-GB tensor materialization), and writes them to /tmp/zimg_arch.txt for inspection. Composes the proven sovereign GGUF reader. Gate: opens, GGUF v3, token_embd found, hidden>0. license_tier: ORIGINAL

dependencies 10 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_gguf_arch.nx

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.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 ↻ sys_openat_wr za_emit_kv sys_mmap ↻ nx_strconv_format_i64 sys_write za_blk_name sys_mmap ↻ nx_strconv_format_i64 ↻ za_emit_dims sys_mmap ↻ za_blk_name ↻ nx_gguf_find_tensor ↻ nx_gguf_tensor_at ↻ za_emit_kv ↻

structs

none

consts

none

functions

20func za_emit_kv(fd: i64, key: *u8, key_len: i64, value: i64) -> i64
35func za_blk_name(out: *u8, n: i64, suffix: *u8, suffix_len: i64) -> i64
55func za_emit_dims(ofd: i64, hdr: *NxGgufHeader, label: *u8, label_len: i64, suffix: *u8, suffix_len: i64) -> i64
74func main() -> i64