Decode all BC7 modes with pinned MIT bcdec CPU reference and atomic publication #115

Manually merged
github merged 10 commits from gh-pr/115/head into gh-pr/115/base 2026-11-26 21:07:58 +00:00
Owner

@⁠ProhorovIlja on GitHub · 2026-11-23 14:46 UTC · original
ProhorovIlja:feat/full-bc7-cpu-reference-20261123 → main · +1803 −5 · 10 files · 10 commits · merged 2026-11-23 14:49 UTC

Integrates upstream iOrange/bcdec v0.985 at pinned commit 80859ed3b7afb1c527a2a99d70c61457bea72d0c using its MIT license option (upstream LICENSE retained). Adds separate Format::Bc7All to the existing native CPU decoder and Reader -> texture publication, retains the original Mode6 oracle, prevalidates every 16-byte block to reject reserved prefixes before any output write, handles odd-sized rectangles, and registers full 8-mode CPU regression tests on both platforms. Third-party implementation builds in an isolated static target.

Scope: no Xbox texture swizzle, RPF9/BCPack, real GTA VI assets, game boot, FPS, or all-mode GPU differential. This is a permissively licensed CPU fallback and regression oracle, not a finished game renderer.

Use existing Windows/Linux CI. Merge only on both green; do not create new workflows or scheduled/background tasks.

**@⁠ProhorovIlja** on GitHub · 2026-11-23 14:46 UTC · [original](https://github.com/ProhorovIlja/NativeX-Runtime/pull/115) `ProhorovIlja:feat/full-bc7-cpu-reference-20261123` → `main` · +1803 −5 · 10 files · 10 commits · merged 2026-11-23 14:49 UTC Integrates upstream iOrange/bcdec v0.985 at pinned commit 80859ed3b7afb1c527a2a99d70c61457bea72d0c using its MIT license option (upstream LICENSE retained). Adds separate Format::Bc7All to the existing native CPU decoder and Reader -> texture publication, retains the original Mode6 oracle, prevalidates every 16-byte block to reject reserved prefixes before any output write, handles odd-sized rectangles, and registers full 8-mode CPU regression tests on both platforms. Third-party implementation builds in an isolated static target. **Scope:** no Xbox texture swizzle, RPF9/BCPack, real GTA VI assets, game boot, FPS, or all-mode GPU differential. This is a permissively licensed CPU fallback and regression oracle, not a finished game renderer. Use existing Windows/Linux CI. Merge only on both green; do not create new workflows or scheduled/background tasks.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:07:57 +00:00
github manually merged commit c0481fba62 into gh-pr/115/base 2026-11-26 21:07:58 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-23 14:46 UTC · original · edited 2026-11-23 14:49 UTC

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-23T14:49:07.052508Z c0481fb PR opened
ℹ️ 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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-23 14:46 UTC · [original](https://github.com/ProhorovIlja/NativeX-Runtime/pull/115#issuecomment-7104527904) · edited 2026-11-23 14:49 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c0481fba629845bb47e66cee613637dc11c82dc4","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-23T14:49:07.052508Z">2026-11-23T14:49:07.052508Z</relative-time> | `c0481fb` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). 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. </details> </details>
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-23 14:49 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0481fba62

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-23 14:49 UTC · [original](https://github.com/ProhorovIlja/NativeX-Runtime/pull/115#pullrequestreview-6023715843) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `c0481fba62` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>
@ -0,0 +1320,4 @@
for (i = 0; i < numEndpoints; ++i) {
/* component-wise left-shift */
for (j = 0; j < 4; ++j) {
endpoints[i][j] <<= 1;
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-23 14:49 UTC · original

P2 Badge Initialize alpha endpoints before processing opaque BC7 modes

For legal BC7 modes 0–3, alpha endpoint extraction is skipped, leaving endpoints[][3] uninitialized. Modes 0, 1 and 3 then read and shift those values here; mode 2 reaches the same problem in the later alpha expansion. Overwriting alpha with 255 afterward does not undo the undefined behavior. The new fixture aborts at this line when built with Clang's -ftrivial-auto-var-init=pattern -fsanitize=undefined -fno-sanitize-recover=all. Initialize the endpoint array or skip alpha processing for modes without alpha so valid opaque blocks decode safely.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-23 14:49 UTC · [original](https://github.com/ProhorovIlja/NativeX-Runtime/pull/115#discussion_r4667409660) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Initialize alpha endpoints before processing opaque BC7 modes** For legal BC7 modes 0–3, alpha endpoint extraction is skipped, leaving `endpoints[][3]` uninitialized. Modes 0, 1 and 3 then read and shift those values here; mode 2 reaches the same problem in the later alpha expansion. Overwriting alpha with 255 afterward does not undo the undefined behavior. The new fixture aborts at this line when built with Clang's `-ftrivial-auto-var-init=pattern -fsanitize=undefined -fno-sanitize-recover=all`. Initialize the endpoint array or skip alpha processing for modes without alpha so valid opaque blocks decode safely. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.