code wiki / (root) / nx_zimage_layout.nx

nx_zimage_layout.nx

buildroot/runtime/nx_zimage_layout.nx

3126 B71 linesdepth 8pulls 14 transitivereach 0 importersview sourcekind tooltopic zimage
docsdependenciesstructsconstsfunctions

about

nx_zimage_layout.nx -- dump the REAL Z-Image/Qwen GGUF tensor layout (offsets/dims/types), sovereignly. sd-server -> Nishi migration: to run a REAL transformer op we must know where blk.0's weights live in the file and their shapes. This parses the real `Z-Image_Qwen_3_4b-Q6_K.gguf` metadata (bounded prefix) and writes, for token_embd + blk.0 attention/ffn tensors, their data offset (hdr.data_off + ti.offset), dim_0, dim_1, and ggml_type -- so the next organ sizes the read + matmul correctly. Metadata only; no materialize. 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_layout.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 ↻ sys_openat_wr zl_emit sys_mmap ↻ nx_strconv_format_i64 sys_write zl_dump nx_gguf_find_tensor nx_gguf_tensor_at nx_gguf_name_equals nx_gguf_tensor_at ↻ zl_emit ↻

structs

none

consts

none

functions

19func zl_emit(fd: i64, key: *u8, key_len: i64, value: i64) -> i64
34func zl_dump(fd: i64, hdr: *NxGgufHeader, name: *u8, name_len: i64,
46func main() -> i64