From 5fde38470a75fba1ac24b68ecdfa685b0e996da1 Mon Sep 17 00:00:00 2001 From: CYoung83 <204268872+CYoung83@users.noreply.github.com> Date: Wed, 7 Oct 2026 22:44:04 -0600 Subject: [PATCH] gguf_reader: open a tensor-less shard that ends before its aligned data start unsloth/Qwen3.8-Flash-Next-GGUF UD-Q5_K_XL shard 1 holds metadata only and is 10,946,618 bytes; its 32-byte-aligned data start is 10,946,624, so the engine refused it with 'GGUF: data section starts past EOF'. llama.cpp's gguf-py reads the same file (0 tensors, data_offset 10,946,624). A file with tensors is still refused. A file without them gets data_start clamped to the file size, so file_size() - data_start() stays 0 in the payload checks downstream. --- include/strata/artifact/gguf_reader.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/strata/artifact/gguf_reader.hpp b/include/strata/artifact/gguf_reader.hpp index 298dc3bc..1be01432 100644 --- a/include/strata/artifact/gguf_reader.hpp +++ b/include/strata/artifact/gguf_reader.hpp @@ -455,7 +455,14 @@ private: if (a->u) align = a->u; alignment_ = align; data_start_ = (c.pos() + align - 1) / align * align; - if (data_start_ > size_) throw std::runtime_error("GGUF: data section starts past EOF"); + if (data_start_ > size_) { + // A file with tensors needs its data section. One without (a split model's metadata-only first + // shard) may end at its header, before the aligned start - unsloth's UD-Q5_K_XL shard 1 ends 6 bytes + // short, and llama.cpp's gguf-py reads it. Nothing is read there; the clamp keeps + // `file_size() - data_start()` (the payload checks downstream) at 0 instead of wrapping. + if (n_tensors != 0) throw std::runtime_error("GGUF: data section starts past EOF"); + data_start_ = size_; + } } std::string path_;