Repository navigation
Shader cache: six translator switches the key left out are in it, and a test checks every switch - #807
Merged
trustno1-coder merged 1 commit intoNov 29, 2026
Conversation
Dukestar69
approved these changes
Nov 28, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
Tested locally merged onto main (63b902f).
- Merge & Policy: Clean merge;
cargo xtask policypassed (294 files ok). - Tests:
cargo test -p victory-gpu --lib shader_cache::passed (3 passed; 0 failed, including the newevery_switch_of_the_translator_is_in_the_keyregression test).cargo test -p victory-shader --lib emit::tests::passed (22 passed; 0 failed; 1 ignored).
Good cache-correctness fix preventing stale cached DXIL across VICTORY_LOOPS_WAVE / VICTORY_LDS_FIRST_INIT toggles. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
MystifiedSky
added a commit
to MystifiedSky/VIctory-NVIDIA-Improved
that referenced
this pull request
Nov 28, 2026
Shaun-Fong
added a commit
to Shaun-Fong/VIctory-NVIDIA
that referenced
this pull request
Nov 28, 2026
…TORY_LDS_FIRST_INIT are in the key, and a test checks every translator switch
kibagami-nc
force-pushed
the
fix/shader-cache-keys-loop-and-lds-switches
branch
from
November 28, 2026 19:24
81622c2 to
cc41119
Compare
… a test checks every switch VICTORY_LOOPS_WAVE, VICTORY_LDS_FIRST_INIT, VICTORY_LDS_INIT_HOIST, VICTORY_HDR_CLAMP, VICTORY_SAMPLED_MARKS and VICTORY_DEFRAG change how a program is translated, but the cache's key left them out: a run with one of them changed was served the translations an earlier run had cached without the change. The keyed names are now a const, KEYED. victory_shader::emit::SWITCHES gives the switches the translator's build.rs gathers from its sources, and a test checks that each one is in KEYED, in the key another way, or changes no translation. translation_fingerprint() reads the same const.
kibagami-nc
force-pushed
the
fix/shader-cache-keys-loop-and-lds-switches
branch
from
November 28, 2026 19:48
cc41119 to
3f5ba8c
Compare
1 task done
1 task done
trustno1-coder
added a commit
that referenced
this pull request
Nov 29, 2026
…R are in the key #807's test of every translator switch found them left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X5CFykxe6G44cMPrmExrcw
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Found while choosing the tests to ask for in #739, the water light's tile-sized blocks under water.
Rebuilt on main (923e38c). Its new test found three more switches missing from the key, added by today's merges, so six are keyed now. Main's own two new names (
VICTORY_WATER_VOLUME_PORTALS,VICTORY_LDS_BOUNDS_EXEMPT) are inKEYEDtoo.What happens
These switches change how a program is translated, and none of them is in the shader cache's key:
VICTORY_LOOPS_WAVEVICTORY_LDS_FIRST_INITVICTORY_LDS_INIT_HOISTlds_init_hoist_oninlower.rs)VICTORY_HDR_CLAMP=0turns it off)VICTORY_SAMPLED_MARKS=1; off by default)VICTORY_DEFRAGCS_DefragHeap_ComputeRelocationsis translated (=0leaves it untranslated, for comparisons)The comment in
pipeline/make.rscredits the first two for the water light's open-water fix.A run that changes one of them is served the translations an earlier run cached without the change, so the switch looks as if it did nothing. For example,
VICTORY_SAMPLED_MARKS=1gets programs that mark no slot, andVICTORY_DEFRAG=0still runs the defragmentation from the cache. The comment above the list already describes the same trap forVICTORY_WAVE_WIDE.The change
Cache key: the list of switches keyed by name is now a const,
KEYED, with the six names added.Translator:
victory_shader::emit::SWITCHESgives the list ofVICTORY_*switches that the translator'sbuild.rsalready gathers from its sources (VICTORY_SHADER_SWITCHES).translation_fingerprint()now reads the same const.Test: a new test checks every switch on that list. Each one must be either:
KEYED;VICTORY_RDNA_FLOATthroughhost_rdna);VICTORY_REQUIRE_HW_GPU).A new switch that is none of these fails the test. So does a listed name the translator no longer reads.
The key changes, so every translation is made again once after the update, as after any translator change.
Why not
translation_fingerprint()Main already has
victory_shader::emit::translation_fingerprint()(847a0af). It keys every switch the translator names, but nothing calls it: the cache's key is stillbuild()inshader_cache.rs.Keying on it would also key the switches that change no translation, such as
VICTORY_WAVE_WHY,VICTORY_EMIT_DUMPorVICTORY_ADAPTER. A run with one of those set would then translate everything again. So this PR keeps the cache's own list, and the test keeps that list complete.#550 adds
VICTORY_CODE_TABLE_AFTERto the same list. Whichever of the two lands second needs to add one line.Tests
shader_cache::tests::every_switch_of_the_translator_is_in_the_key. It passes. It fails without the names it found:["VICTORY_LDS_FIRST_INIT", "VICTORY_LDS_INIT_HOIST", "VICTORY_LOOPS_WAVE"];["VICTORY_DEFRAG", "VICTORY_HDR_CLAMP", "VICTORY_SAMPLED_MARKS"].cargo test -p victory-gpu --lib --locked: 551 passed, 43 ignored.--all-targets, default and--all-features): nothing in the changed lines. Main 923e38c has findings of its own: 13 in the default build and 11 with--all-features. Among them: an unusedcolourand amanual_checked_opsinlower.rs, dead code insend.rs,pool.rsandresource.rs, too many arguments, and adropof a reference inhost.rs.