Shader cache keyed by the translator (survives rebuilds), missing switches in the key, and a warm-up: translate --cache #544
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!544
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/544/head"
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?
@justrealyme on GitHub · 2026-11-25 02:04 UTC · original
justrealyme:pr-shader-cache-key→main· +190 −8 · 8 files · 1 commits · closed without mergingWhat
1. The shader cache keys on the translator, not the executable.
shader_cache::build()hashed the wholevictory.exe, so every rebuild, even one that leaves the translator alone, and every switch between the release and diagnostics builds started with an empty cache. The first run after that shows black screens and dropped draws while thousands of shaders translate. The key is now a hash of the translator's own sources (victory-shader's build script, taken from upstream VIctoryc47b529by Marvis, credited in the commit), plus the host settings and switches a translation depends on.2. Three translation switches were missing from the key.
VICTORY_WAVE_LOCAL,VICTORY_STRICT_JOINSandVICTORY_MESH_OUTPUT_STRICTchange the translation but weren't hashed, so a run with one of them could be served translations made without it. They're in the key now, and so are the host's widest wave and capped view heap (set_host_max_wave,set_view_heap_limit), which the exe hash didn't cover either.3.
victory translate --cache <game dir>: a warm-up that translates every container into the shader cacherunreads, through the same path a run takes (shader_cache::warm: the host device is created and the view heap cap probed first, since the translation and its key depend on them). Run it once after a translator change, with the sameVICTORY_*switches you play with.Checked
shaders from the cache and translated so far hits=2378 misses=0), and reached the world sooner;c96b4f2):translate --cacheon the builder DLL twice into an empty cache:49 translated now, then49 were in the cache, 0 translated now.cargo test --workspace: 505 passed.cargo clippy --workspace --all-targets --all-features -- -D warningsclean. Without--all-features, clippy stops onplaced_filler_twinsbeing unused (victory-gpu/src/resource.rs), which is already the case onmain; this branch doesn't touch that file.AI-assisted (Claude Code). No game data in the change or here.
🤖 Generated with Claude Code
@justrealyme on GitHub · 2026-11-25 08:14 UTC · original
Closing this:
8dd30abkeys the cache ontranslation_fingerprint()(the translator's source hash plus every switch it reads) and addstranslate --warm, which covers what this PR did and more. I've merged8dd30abinto my fork instead.AI-assisted (Claude Code).
@Headache3318 on GitHub · 2026-11-25 08:32 UTC · original
Independent verification: PR #544 merges cleanly onto main (fast-forward). Build: success (17.7s). Tests: fail to compile on Linux host due to Windows-specific code paths gated by #[cfg(windows)] (victory-gpu host module and host_resource() not found). Environment/target mismatch rather than PR regression. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
Pull request closed