Repository navigation
core: a GGUF reader and an exact repack of GGUF's quantized blocks (#1920, steps 1-2) - #1926
Merged
Merged
Conversation
This was referenced Nov 2, 2026
Merged
Preflight metadata, tensor geometry and byte ranges before allocating indexes. Expose borrowed family and tokenizer views with host corruption and allocation-failure tests. Refs #1920.
Support ten layouts with FP32 coefficients and an independent FP64 host reference. Exhaust physical byte fields and half encodings, with seeded combinations and production fault controls. Reject non-finite half fields. Affine cancellation preserves numerical zeros but can change their sign; strict IEEE weight-bit preservation is not claimed. Refs #1920.
…d blocks (#1920, steps 1-2)
ashhart
force-pushed
the
lead/s192-gguf-core
branch
from
November 2, 2026 14:50
7ebed3c to
0ed7487
Compare
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps 1 and 2 of #1920 (native GGUF on Apple Silicon): a GGUF reader in core, and an exact repack of GGUF's quantized blocks into per-group affine weights. No engine reads GGUF yet. Step 3, the Qwen3.8-27B load on Metal, comes next on top of this.
What changes
zig/src/core/gguf.zigreads a GGUF v3 file: the header, metadata of all 13 kinds (including nested arrays), tensor infos, alignment and the data offset. A GGUF file is untrusted input, so it checks every length word and count against the file before allocating anything, and caps strings, arrays, metadata and nesting depth. Tensor offsets must be aligned and inside the data region. Shape and byte products are overflow-checked, and overlapping, duplicate and truncated tensors are refused. Unknown kinds and tensor types are refused by name, and the second pass rechecks every range before slicing. It exposes the metadata a family config needs, plus the tokenizer arrays.Checks