fix(gguf): restore 32-byte scaling on data_offset (chatgpt-codex catch on PR #367)#368
Merged
Merged
Conversation
The 1.95 clippy sweep in PR #367 (sprint-log-8 agent W4) flagged `(pos + 31) / 32 * 32` as `manual_div_ceil` and rewrote it to `(pos + 31).div_ceil(32)` — losing the `* 32` byte-scaling and turning a byte-rounded offset into a block COUNT (off by ×32). chatgpt-codex P2 catch on PR #367 review thread. Symptom: every GGUF header parsed by `gguf_thinking_styles.rs` returned data_offset ≈ N/32 where it should have returned N rounded up to the next 32-byte boundary. `SeekFrom::Start(h.data_offset + t.offset)` then landed in the header/metadata area and decoded garbage. Fix: `pos.div_ceil(32) * 32` (matches gguf_euler_fold.rs:373 + gguf_families.rs:337 + gamma_phi_gguf.rs:356 which all kept the `* 32` scaling correctly). Audit summary across the workspace's GGUF parsers post-PR #367: - gguf_euler_fold.rs:373 `pos.div_ceil(32) * 32` ✓ - gguf_families.rs:337 `pos.div_ceil(align) * align` ✓ - gguf_thinking_styles.rs:360 was buggy (this PR) → ✓ fix - gamma_phi_gguf.rs:356 `pos.div_ceil(32) * 32` ✓ Workspace clippy on 1.95.0 still clean; fmt still clean. No CI behavior change for non-GGUF code paths. Process note: the 12-agent fleet's per-file isolation was good for parallelism but missed the cross-file invariant that "all GGUF parsers in the workspace must produce the same data_offset". A future linter sweep that touches a pattern present in multiple sibling files should either cross-check the result or be reviewed against a single reviewer who can spot the divergence. The codex review was the safety net here.
7 tasks
AdaWorldAPI
pushed a commit
that referenced
this pull request
May 14, 2026
Channel was bumped to 1.95.0 in PR #367 but the explanatory comment above it still said "Pinned to 1.94.1 ... 1.95 turned several previously-safe patterns into denied lints ... without sufficient value to justify the churn." Pure documentation drift — the bump already happened, the lint debt was closed by #367 + #368, and the comment now describes a state that has not been true for ~a day. Update the comment to reflect the actual 1.95.0 pin, cross-ref PR #367, name the clippy lints that came with 1.95, and keep the "never auto-track stable" rule.
AdaWorldAPI
added a commit
that referenced
this pull request
May 28, 2026
fix(gguf): restore 32-byte scaling on data_offset (chatgpt-codex catch on PR #367)
AdaWorldAPI
pushed a commit
that referenced
this pull request
May 28, 2026
Channel was bumped to 1.95.0 in PR #367 but the explanatory comment above it still said "Pinned to 1.94.1 ... 1.95 turned several previously-safe patterns into denied lints ... without sufficient value to justify the churn." Pure documentation drift — the bump already happened, the lint debt was closed by #367 + #368, and the comment now describes a state that has not been true for ~a day. Update the comment to reflect the actual 1.95.0 pin, cross-ref PR #367, name the clippy lints that came with 1.95, and keep the "never auto-track stable" rule.
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.
Summary
Fixes a regression introduced by PR #367's sprint-log-8 agent W4: the
manual_div_ceilrewrite ongguf_thinking_styles.rs:360dropped the* 32byte-scaling, turning a byte offset into a block COUNT (off by ×32).chatgpt-codex P2 catch on PR #367 review thread:
The bug
Both look superficially like
manual_div_ceilrewrites, but the original(pos + 31) / 32 * 32had TWO operations:div_ceil(32))W4's "fix" preserved only the first.
Audit across the workspace
Verified all four GGUF parsers in
bgz-tensor/examples/after this PR:gguf_euler_fold.rspos.div_ceil(32) * 32gguf_families.rspos.div_ceil(align) * aligngguf_thinking_styles.rspos.div_ceil(32) * 32gamma_phi_gguf.rspos.div_ceil(32) * 32Verification
rustup run 1.95.0 cargo clippy --workspace --all-targets -- -D warningsexits 0rustup run 1.95.0 cargo fmt --all --checkexits 0Process note
The 12-agent fleet's per-file isolation enabled parallel work but missed the cross-file invariant that "all GGUF parsers in the workspace must produce the same
data_offsetshape". W4's per-file clippy verification passed; the bug only surfaces when comparing W4's output against the parallel parsers in W2/W3/W7's files.Future linter-sweep fleets that touch a pattern present in multiple sibling files should either:
Codex review was the safety net here. Worth keeping that loop in place.
Generated by Claude Code