mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1612] [CLOSED] gguf_reader: open a tensor-less shard that ends before its aligned data start #3563
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3563
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1612
Author: @CYoung83
Created: 10/8/2026
Status: ❌ Closed
Base:
main← Head:fix/gguf-tensorless-shard-eof📝 Commits (2)
fd3d818gguf_reader_test: a tensor-less file that ends before its aligned data startbf8554fgguf_reader: open a tensor-less shard that ends before its aligned data start📊 Changes
2 files changed (+46 additions, -3 deletions)
View changed files
📝
include/strata/artifact/gguf_reader.hpp(+8 -1)📝
src/artifact/gguf_reader_test.cpp(+38 -2)📄 Description
Title
Issue: Resolves #1611
Summary
A GGUF file with no tensors (a split model's metadata-only first shard) whose header ends before the
32-byte-aligned data start was refused with "data section starts past EOF". It now opens. A file with
tensors and the same truncation is still refused.
What changed
file has tensors. Otherwise clamp data_start_ to the file size. That keeps
file_size() - data_start()at 0 in the payload checks that compute it (native_dense.cpp, native_head.cpp, expert_source.cpp,
in_bounds), where it would otherwise wrap. Nothing else in the reader changes.
Extra Notes
Tested:
fb58e0dwith GCC 13.3 (-std=c++20 -Wall -Wextra, no warnings): gguf_reader_test fails 2 checkswithout the header change and passes with it. gguf_split_test passes either way. Clang 18.1 (-std=c++17)
passes.
fb58e0d(v0.1.41), CUDA build (sm_120, Release, -DSTRATA_Q6K_EXPERTS=ON), on an RTX 5090: the engineas released against the engine with these two commits, run back to back.
padded with 6 zero bytes.
The same holds for Q8_0, whose shard 1 needs no padding: 3,424 rows, all identical.
ple_reader_selftest.
commits:
(-DSTRATA_PREFILL_MMQ=ON, CMAKE_HIP_ARCHITECTURES=gfx1100;gfx1201): both trees build
stratawith noerrors, and gguf_reader_test and gguf_split_test pass. The fixed tree's reader test includes the two new
cases.
with BUILD EXIT 0 and errors: 0.
gguf_reader.hpp says it is generated from src/artifact/gguf_reader.cpp by scripts/split_artifact.py. That
.cpp no longer holds the parser, and scripts/ isn't in the published tree, so I edited the header directly.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.