Skip to content

tools : reject truncated GGUF tensor data in merge - #31044

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
shreya-11733:fix-gguf-merge-truncated-read
Oct 25, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
shreya-11733:fix-gguf-merge-truncated-read

Conversation

@shreya-11733

Copy link
Copy Markdown
Contributor

Overview

This change addresses missing read-error check when gguf_merge doesn't check f_input.read() return, so truncated split files produce silently corrupt merged output.

My reproduction: truncate a split file to 50%, merge exits 0, 45% of output bytes corrupt

The fix: 4 lines, mirrors the existing check in copy_file_to_file
The changes add short-read checks by checking the stream state in gguf_merge.

Additional information

PR #30497 fixed the same issue in the split path but missed the merge path

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES
    AI assistance covered investigating the truncated-GGUF issue and analyzing the cause of the unchecked reads.
    I applied the patch, built the affected tools, ran the regression tests, reviewed the Git diff, and submitted the changes.

@CISC CISC added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Oct 23, 2026
@ggerganov
ggerganov merged commit 7790a92 into ggml-org:master Oct 25, 2026
15 checks passed
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
Co-authored-by: Shreya Agrawal <shreyaagrawal@Shreyas-MacBook-Air.local>
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 30, 2026
Co-authored-by: Shreya Agrawal <shreyaagrawal@Shreyas-MacBook-Air.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants