[PR #3044] [CLOSED] artifact: reject invalid tensor bounds and architecture failures in --check #4419

Closed
opened 2026-11-07 15:35:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3044
Author: @j-luwierski
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: codex/gguf-check-validation


📝 Commits (1)

  • 57f8aba artifact: reject invalid GGUF check results

📊 Changes

3 files changed (+113 additions, -3 deletions)

View changed files

📝 CMakeLists.txt (+4 -0)
📝 src/artifact/gguf_reader.cpp (+6 -3)
➕ tests/core/gguf_cli_test.cpp (+103 -0)

📄 Description

Title

Resolves #3043

Summary

strata-gguf --check returns success after an architecture failure, and unsigned gap/byte arithmetic can accept a tensor outside the file or a tensor whose byte count overflows. These cases now return status 1.

What changed

  • Use the existing overflow-safe tensor_payload_bytes() helper and check file bounds before subtracting an offset in the standalone CLI.
  • Return status 1 when the architecture guard fails.
  • Add a CPU-only CTest invoking the actual CLI entry point on nine synthetic cases: valid input, inspection-only behavior, unsupported/missing architecture, wrapped and ordinary out-of-file offsets, overflowing byte count and truncation.

Inspection without --check, the reader API, inference code, GPU kernels, unknown-type reporting and the existing padding bracket are unchanged.

Validation

Linux x86_64, GCC 14.2.0, upstream base 477ac13c:

  • CMake build with STRATA_WERROR=ON: strata-gguf, gguf_cli_test, gguf_reader_test, gguf_split_test, gguf_geometry_test and model_family_test.
  • CTest: all five selected tests passed.
  • The new test against unchanged upstream fails for unsupported/missing architecture, wrapped offset and overflowing byte count.
  • Old/new executable comparison: identical exit codes, stdout and stderr bytes for a valid file with --check and three inspection-only fixtures.
  • git diff --check passed.

Extra Notes

No model inference, Windows runtime or CUDA/HIP/SYCL engine builds were run. The changed production source is the standalone host-only CLI target; GPU backend sources are untouched. Searched open issues and PRs; #2288 and #2475 address different readers.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3044 **Author:** [@j-luwierski](https://github.com/j-luwierski) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/gguf-check-validation` --- ### 📝 Commits (1) - [`57f8aba`](https://github.com/Niko1221/Strata/commit/57f8abaaea6748aff38ca2b1110fe31597d18b09) artifact: reject invalid GGUF check results ### 📊 Changes **3 files changed** (+113 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+4 -0) 📝 `src/artifact/gguf_reader.cpp` (+6 -3) ➕ `tests/core/gguf_cli_test.cpp` (+103 -0) </details> ### 📄 Description ## Title Resolves #3043 ## Summary `strata-gguf --check` returns success after an architecture failure, and unsigned gap/byte arithmetic can accept a tensor outside the file or a tensor whose byte count overflows. These cases now return status 1. ## What changed - Use the existing overflow-safe `tensor_payload_bytes()` helper and check file bounds before subtracting an offset in the standalone CLI. - Return status 1 when the architecture guard fails. - Add a CPU-only CTest invoking the actual CLI entry point on nine synthetic cases: valid input, inspection-only behavior, unsupported/missing architecture, wrapped and ordinary out-of-file offsets, overflowing byte count and truncation. Inspection without `--check`, the reader API, inference code, GPU kernels, unknown-type reporting and the existing padding bracket are unchanged. ## Validation Linux x86_64, GCC 14.2.0, upstream base `477ac13c`: - CMake build with `STRATA_WERROR=ON`: strata-gguf, gguf_cli_test, gguf_reader_test, gguf_split_test, gguf_geometry_test and model_family_test. - CTest: all five selected tests passed. - The new test against unchanged upstream fails for unsupported/missing architecture, wrapped offset and overflowing byte count. - Old/new executable comparison: identical exit codes, stdout and stderr bytes for a valid file with `--check` and three inspection-only fixtures. - `git diff --check` passed. ## Extra Notes No model inference, Windows runtime or CUDA/HIP/SYCL engine builds were run. The changed production source is the standalone host-only CLI target; GPU backend sources are untouched. Searched open issues and PRs; #2288 and #2475 address different readers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:34 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4419
No description provided.