Keep shader cache hits when the dump directory changes #880

Open
github-bot wants to merge 1 commit from github-bot/gh-880 into main AGit
Owner

@⁠Lkxex on GitHub · 2026-11-25 11:37 UTC · original
Lkxex:fix/shader-cache-dump-directory → main · +16 −6 · 2 files · 1 commits · open

Problem

VICTORY_EMIT_DUMP selects an output directory for the translation tools. The shader build script also adds it to the translation fingerprint, so changing or clearing that path causes misses in an otherwise reusable shader cache.

Fix

Exclude the dump directory from the generated cache settings list. The regression test checks that the fingerprint excludes the dump directory and still includes VICTORY_SHADER_OPT, which controls emitted DXIL.

Validation

  • The regression test fails on the base commit and passes with this patch.
  • cargo test --locked -p victory-shader passed with 216 tests passing and 3 ignored.
  • git diff --check passed.

AI-assisted change. Validation used the repository's tests without game files.

**@⁠Lkxex** on GitHub · 2026-11-25 11:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/880) `Lkxex:fix/shader-cache-dump-directory` → `main` · +16 −6 · 2 files · 1 commits · open ### Problem `VICTORY_EMIT_DUMP` selects an output directory for the translation tools. The shader build script also adds it to the translation fingerprint, so changing or clearing that path causes misses in an otherwise reusable shader cache. ### Fix Exclude the dump directory from the generated cache settings list. The regression test checks that the fingerprint excludes the dump directory and still includes `VICTORY_SHADER_OPT`, which controls emitted DXIL. ### Validation - The regression test fails on the base commit and passes with this patch. - `cargo test --locked -p victory-shader` passed with 216 tests passing and 3 ignored. - `git diff --check` passed. AI-assisted change. Validation used the repository's tests without game files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:53:03 +00:00
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-25 12:00 UTC · original

I independently checked f85101b6095e8cf3cecf8f0647cc7f5428daa177 against 8d4a671c54fa9ab83254ab1a1623e401299b1f09. I compiled each revision’s unchanged shader_cache.rs with its own shader and pipeline crates and called warm() in separate Linux processes against an on-disk cache. The inputs were two synthetic compute shader containers.

  • Changing VICTORY_EMIT_DUMP to either of two new paths caused a miss on base. On the PR head, both changes hit the entry warmed with the setting unset. Empty and unset paths also hit that entry.
  • Disabling VICTORY_SHADER_OPT still caused a miss and changed the emitted DXIL. A different container still caused a first-use miss. Each fixture emitted identical DXIL across the two revisions at matched settings.
  • The first lookup after upgrading to this PR missed in the shared cache. After that lookup, changing the dump path hit. Running the old binary again still hit the original entry.

The 24 per-revision lookups and five upgrade and rollback lookups matched expectations. Linux victory-shader --lib passed 171 tests at base and 172 at head, with two ignored each. On the head, cargo check --target x86_64-pc-windows-msvc -p victory-shader -p victory-gpu --all-targets --features blake3/pure passed. Native Windows execution and CLI dump-file writing were outside these checks.

**@⁠avt0m4t48** on GitHub · 2026-11-25 12:00 UTC · [original](https://github.com/fxceless/victory-fork/pull/880#issuecomment-7161805186) I independently checked `f85101b6095e8cf3cecf8f0647cc7f5428daa177` against `8d4a671c54fa9ab83254ab1a1623e401299b1f09`. I compiled each revision’s unchanged `shader_cache.rs` with its own shader and pipeline crates and called `warm()` in separate Linux processes against an on-disk cache. The inputs were two synthetic compute shader containers. - Changing `VICTORY_EMIT_DUMP` to either of two new paths caused a miss on base. On the PR head, both changes hit the entry warmed with the setting unset. Empty and unset paths also hit that entry. - Disabling `VICTORY_SHADER_OPT` still caused a miss and changed the emitted DXIL. A different container still caused a first-use miss. Each fixture emitted identical DXIL across the two revisions at matched settings. - The first lookup after upgrading to this PR missed in the shared cache. After that lookup, changing the dump path hit. Running the old binary again still hit the original entry. The 24 per-revision lookups and five upgrade and rollback lookups matched expectations. Linux `victory-shader --lib` passed 171 tests at base and 172 at head, with two ignored each. On the head, `cargo check --target x86_64-pc-windows-msvc -p victory-shader -p victory-gpu --all-targets --features blake3/pure` passed. Native Windows execution and CLI dump-file writing were outside these checks.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 12:23 UTC · original

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head 8d4a671 into main f85101b in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails with exactly the errors main itself has on this machine (placed_filler_twins, depth_written, a sort; PR #841 fixes them), also with --all-features; this PR adds none. cargo test --workspace --locked: run 1: 556 passed, 0 failed, 11 ignored; run 2: 556 passed, 0 failed, 11 ignored (main alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-25 12:23 UTC · [original](https://github.com/fxceless/victory-fork/pull/880#issuecomment-7162302096) Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `8d4a671` into `main` `f85101b` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails with exactly the errors `main` itself has on this machine (`placed_filler_twins`, `depth_written`, a sort; PR #841 fixes them), also with `--all-features`; this PR adds none. `cargo test --workspace --locked`: run 1: 556 passed, 0 failed, 11 ignored; run 2: 556 passed, 0 failed, 11 ignored (`main` alone: 555 passed, 0 failed, 11 ignored). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/880/head:github-bot/gh-880'
git switch 'github-bot/gh-880'

Merge

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