Skip to content

fix(model): validate GGUF extents before capacity - #9631

Merged
morluto merged 3 commits into
mainfrom
audit/model-parsers-dda
Nov 9, 2026
Merged

morluto merged 3 commits into
mainfrom
audit/model-parsers-dda

Conversation

@morluto

@morluto morluto commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Truncated GGUF files with oversized tensor counts or string lengths were rejected as exceeding the report budget before their declared extents were checked. Validate those extents first, using the existing reader, so impossible declarations report malformed input. Declarations whose minimum extents fit still receive the representation-capacity refusal.

The same owner already follows this ordering for arrays; Safetensors is a working sibling comparison. No new limits or abstractions are introduced.

Validation and scope

Both malformed-input regressions failed before their respective fixes. With Node 24.22.1, 139 tests across the model, cancellation and identity suites passed; the model suite passed 133 tests after the final capacity control was added. Sparse-file controls exercise fitting extents without allocating the declared payload in memory. Scoped formatting and diff checks passed.

This is a local header-parser correctness repair. No model execution or real model/toolchain qualification, new authority, provider, dependency, installer or generated metadata. Maintainer scope decision is not applicable to this existing format boundary.

Author readiness

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Remaining-work integration

Raw GGUF and Safetensors lengths/counts are now checked against physical file bounds before capacity admission or numeric conversion. GGUF framing uses the complete 24-byte tensor minimum. Decoded header counts survive capacity refusal as partial Evidence; scalar bigint metadata is unchanged.

Validation: 138 model boundary tests passed; check:fast passed. Coverage uses local format fixtures and sparse files, without model execution.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T12:54:09.353775Z a351a4a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@morluto

morluto commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Raw GGUF and Safetensors lengths/counts are now checked against physical file bounds before capacity admission or numeric conversion. GGUF framing uses the complete 24-byte tensor minimum. Decoded header counts survive capacity refusal as partial Evidence; scalar bigint metadata is unchanged.

Validation: 138 model boundary tests passed; check:fast passed. Coverage uses local format fixtures and sparse files, without model execution.

@morluto
morluto merged commit b06df80 into main Nov 9, 2026
7 of 9 checks passed
@morluto
morluto deleted the audit/model-parsers-dda branch November 9, 2026 12:55
blankym added a commit to blankym/rea that referenced this pull request Nov 10, 2026
@morluto morluto added area: domain Domain logic, errors, and pure functions bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant