Shader cache serves translations from older builds: TRANSLATOR_VERSION was never bumped after translator changes #215
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by kekonn on 2026-11-26T11:54:53Z.
What goes wrong
crates/victory-shader/src/lib.rs:29:pub const TRANSLATOR_VERSION: u32 = 1;By default the shader cache key is
build()incrates/victory-gpu/src/shader_cache.rs(~86-150). It is made ofTRANSLATOR_VERSION,FORMAT, a list of named switches andhost_settings(), plus the container bytes.The two build-script fingerprints are not part of the default key:
victory-gpu/build.rs→VICTORY_TRANSLATOR. It joins the key only withVICTORY_SHADER_KEY=source. Otherwise it only drives the "stale" count.victory-shader/build.rs→VICTORY_SHADER_SOURCE_HASH. Its only reader,emit::translation_fingerprint(), has no callers.git log -G 'pub const TRANSLATOR_VERSION'shows only1162d38, which introduced the constant. Since then, merges have brought about 9 commits that change what the translator emits (368293e,4fd34fd,06fe22a,7348b80,ad0f9dd,431cab5,abbbd6b,7bf91deand9b7dc77, inlower.rs/ir.rs), with no bump. On a cache hit,cached_by(~239-255) seesmade_by != SOURCE, logs once and serves the old DXIL as it is.When
Default runs whose cache was made by an earlier build. Translator fixes never reach shaders that are already cached unless
VICTORY_SHADER_FRESH=1is set orvictory shadersis run.Proposed fix
Set
TRANSLATOR_VERSIONto2. That matches #184 (and #142), so those merge cleanly. #152 sets4and conflicts on this one line.Longer term, the manual bump is easy to forget. A test or xtask check could compare the source fingerprint against a recorded value, or a fingerprint of the translator's output on fixed inputs.
Upstream: #184, #152 and #142 bump the constant as a side effect. None changes the policy of serving stale entries.
Status: the bump is being prepared in kekonn/VIctory-7900XTX on branch
claude/gifted-clarke-uxuqw8.Generated by Claude Code