Keep shader cache hits when the dump directory changes #879

Open
Lkxex wants to merge 1 commit from upstream-pr/880 into main
Lkxex commented 2026-11-25 11:37:53 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Lkxex on 2026-11-25T11:37:53Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6603612547 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/880). Originally posted by [Lkxex](https://github.com/Lkxex) on 2026-11-25T11:37:53Z. --- ### 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.
avt0m4t48 commented 2026-11-25 12:07:05 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T12:00:56Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7161805186 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/880#issuecomment-7161805186). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T12:00:56Z. --- 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.
MamaLeVrai commented 2026-11-25 13:05:59 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T12:23:10Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7162302096 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/880#issuecomment-7162302096). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T12:23:10Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/880:upstream-pr/880'
git switch 'upstream-pr/880'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/880'
git switch 'upstream-pr/880'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/880'
git switch 'upstream-pr/880'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/880'
git switch 'main'
git merge --squash 'upstream-pr/880'
git switch 'main'
git merge --ff-only 'upstream-pr/880'
git switch 'main'
git merge 'upstream-pr/880'
git push origin 'main'
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
fxceless/victory-fork!879
No description provided.