fix(gpu): keep translated shaders when cache publication fails #556

Open
github-bot wants to merge 1 commit from github-bot/gh-556 into a-publier AGit
Owner

@⁠hajduzsolt on GitHub · 2026-11-27 11:22 UTC · original
hajduzsolt:fix/use-uncached-shader-translation → a-publier · +93 −42 · 1 files · 1 commits · open

What changes

The shader cache translates on a miss, then writes and renames a staging file. If that write or rename failed, the runtime discarded the compiled result and could drop draws or dispatches even though translation succeeded.

The runtime now uses the result already in memory and warns if the cache could not store it. Successful misses also skip reading the just-written file back. Explicit shader precompilation still reports a publication failure, and a real translator error is still returned. The on-disk format and keys are the same.

This keeps rendering available when a cache write fails on an RX 9070 XT Windows setup. It does not make an unsupported shader compile.

Verification

The new regression test obstructs a cache destination with a directory. The runtime returns the synthetic shader after one translation, while precompilation reports an error. The existing round-trip, corrupted-entry and stale-cache tests also pass. Windows workspace compile, strict Clippy in both configurations, GPU tests and asset policy pass. Both workspace test runs reproduce the same HLE loopback failure and shader test process exit 0xc0000005 as the base.

AI assistance: ChatGPT 6.2 Sol Extra High.

**@⁠hajduzsolt** on GitHub · 2026-11-27 11:22 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/556) `hajduzsolt:fix/use-uncached-shader-translation` → `a-publier` · +93 −42 · 1 files · 1 commits · open ## What changes The shader cache translates on a miss, then writes and renames a staging file. If that write or rename failed, the runtime discarded the compiled result and could drop draws or dispatches even though translation succeeded. The runtime now uses the result already in memory and warns if the cache could not store it. Successful misses also skip reading the just-written file back. Explicit shader precompilation still reports a publication failure, and a real translator error is still returned. The on-disk format and keys are the same. This keeps rendering available when a cache write fails on an RX 9070 XT Windows setup. It does not make an unsupported shader compile. ## Verification The new regression test obstructs a cache destination with a directory. The runtime returns the synthetic shader after one translation, while precompilation reports an error. The existing round-trip, corrupted-entry and stale-cache tests also pass. Windows workspace compile, strict Clippy in both configurations, GPU tests and asset policy pass. Both workspace test runs reproduce the same HLE loopback failure and shader test process exit 0xc0000005 as the base. AI assistance: ChatGPT 6.2 Sol Extra High.
AI assistance: ChatGPT 6.2 Sol Extra High.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 11:25:33 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 15:56 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At 02868ad: victory-gpu 396 passed, 1 failed, 34 ignored. The failure, watch::tests::a_write_opens_the_view_it_goes_through, is the known watch flake (#450). The PR doesn't touch watch.rs; the module passed 10 of 10 on re-run.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 15:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/556#issuecomment-7222665453) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `02868ad`: `victory-gpu` 396 passed, 1 failed, 34 ignored. The failure, `watch::tests::a_write_opens_the_view_it_goes_through`, is the known `watch` flake (#450). The PR doesn't touch `watch.rs`; the module passed 10 of 10 on re-run. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠hajduzsolt on GitHub · 2026-11-27 16:23 UTC · original

Thanks for testing 02868ad and rerunning the watch suite. The first failure matches #450, and the watch suite passed in the rerun. Both results are useful for interpreting this shader-cache test.

AI assistance: ChatGPT 6.2 Sol Extra High.

**@⁠hajduzsolt** on GitHub · 2026-11-27 16:23 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/556#issuecomment-7223213928) Thanks for testing `02868ad` and rerunning the watch suite. The first failure matches #450, and the watch suite passed in the rerun. Both results are useful for interpreting this shader-cache test. AI assistance: ChatGPT 6.2 Sol Extra High.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/556/head:github-bot/gh-556'
git switch 'github-bot/gh-556'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-556'
git switch 'github-bot/gh-556'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-556'
git switch 'github-bot/gh-556'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-556'
git switch 'a-publier'
git merge --squash 'github-bot/gh-556'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-556'
git switch 'a-publier'
git merge 'github-bot/gh-556'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.