GPU: fix 3 encoding, fallback, and slice-panic bugs in shader_cache.rs with unit tests #1200

Closed
geiyiliyabumo wants to merge 1 commit from upstream-pr/1200 into main
geiyiliyabumo commented 2026-11-24 16:24:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:24:22Z.


Summary

Closes #1034

Full verification details and change notes are documented in #1034 (commit f4c4bd4, based on main ffe310e).

 crates/victory-gpu/src/shader_cache.rs | 330 +++++++++++++++++++++++++++++----
 1 file changed, 297 insertions(+), 33 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6586440179 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1200). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T16:24:22Z. --- ### Summary Closes #1034 Full verification details and change notes are documented in #1034 (commit `f4c4bd4`, based on `main` `ffe310e`). ```text crates/victory-gpu/src/shader_cache.rs | 330 +++++++++++++++++++++++++++++---- 1 file changed, 297 insertions(+), 33 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
DenRakEiw commented 2026-11-24 17:03:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T16:27:21Z.

Review: APPROVED


Tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP (VICTORY_D3D12_WARP=1):

  • cargo test -p victory-gpu (RTX 5090): 60 passed, 0 failed, 1 ignored
  • VICTORY_D3D12_WARP=1 cargo test -p victory-gpu (WARP): 60 passed, 0 failed, 1 ignored
  • cargo clippy -p victory-gpu --all-targets: 0 warnings
  • cargo xtask policy: ok

Solid encoding/fallback/slice-bounds fixes in shader_cache.rs with clean unit tests. Approving.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6043237079 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1200#pullrequestreview-6043237079). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T16:27:21Z. **Review:** APPROVED --- Tested merged cleanly onto `main` (`ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC) with **NVIDIA GeForce RTX 5090** (Blackwell) and **WARP** (`VICTORY_D3D12_WARP=1`): - `cargo test -p victory-gpu` (RTX 5090): **60 passed, 0 failed, 1 ignored** - `VICTORY_D3D12_WARP=1 cargo test -p victory-gpu` (WARP): **60 passed, 0 failed, 1 ignored** - `cargo clippy -p victory-gpu --all-targets`: **0 warnings** - `cargo xtask policy`: ok Solid encoding/fallback/slice-bounds fixes in `shader_cache.rs` with clean unit tests. Approving. AI-assisted (Gemini 4 Neon).
Zipettte commented 2026-11-24 18:06:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:15Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at f4c4bd4: cargo test -p victory-gpu passes, 60 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140016195 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1200#issuecomment-7140016195). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:00:15Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at f4c4bd4: `cargo test -p victory-gpu` passes, 60 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
upstream-sync closed this pull request 2026-11-25 01:05:55 +00:00
Marvisak commented 2026-11-25 01:08:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:34:46Z.


Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Its real fix (a failed cache write must not fail the translation) is in main; the other two (a root type tag near u32::MAX, a cache input shorter than its own 32-byte prefix) cannot happen.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148658393 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1200#issuecomment-7148658393). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:34:46Z. --- Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Its real fix (a failed cache write must not fail the translation) is in main; the other two (a root type tag near u32::MAX, a cache input shorter than its own 32-byte prefix) cannot happen. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Marvisak/VIctory!1200
No description provided.