You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep shader cache hits when the dump directory changes - #880
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.
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.
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 mainf85101b 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
VICTORY_EMIT_DUMPselects 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
cargo test --locked -p victory-shaderpassed with 216 tests passing and 3 ignored.git diff --checkpassed.AI-assisted change. Validation used the repository's tests without game files.