Shader cache: an entry another thread published meanwhile is taken (port of Marvisak#1324) #664
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!664
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-664"
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?
@kibagami-nc on GitHub · 2026-11-28 03:02 UTC · original
kibagami-nc:fix/shader-cache-concurrent-publish→main· +65 −3 · 1 files · 1 commits · merged 2026-11-29 00:24 UTCThe problem
Cache::get_or_convert(crates/victory-pipeline/src/cache.rs) is the shader cache's store (victory-gpu/src/shader_cache.rs). It writes a translation to a staging file and renames it over the content-addressed entry.Sometimes another thread or process (the pipeline makers, or
victory warm's processes) has finished publishing the same entry in the meantime and still holds it open. Windows then refuses the rename, with access denied or a sharing violation.That error came back as the translation's.
shader_cache::host_shaderpasses it on, so the shader was taken as one that does not translate, and its pipelines' draws were dropped for the run.The change
If the rename fails, the staging file is removed. When the entry is now there, it is taken. When it is not there, or is not a file, the error is still given. A write that fails before the rename is still an error, as before.
This is a port of mgunes1311-lab's fix (Marvisak/VIctory#1324). It applied cleanly.
Tests
cache::tests::accepts_entry_published_concurrently_while_open, which comes with the port. During the conversion, the test publishes the same entry and holds it open in read share mode, so the rename is refused. Before the change it fails withAccess denied (os error 5).cargo test -p victory-pipeline --locked: 8 passed. That includesfailed_publication_removes_the_staging_file, which still passes.cargo clippy -p victory-pipeline --all-targets -- -D warnings: no warnings.No game files, dumps or extracted data are included.
@Dukestar69 on GitHub · 2026-11-28 05:35 UTC · original · approved these changes
LGTM — verified on Windows:
cargo test -p victory-pipelinepassed (8/8, includingaccepts_entry_published_concurrently_while_open)cargo clippy -p victory-pipeline --all-targets -- -D warningspassed with 0 warningscargo xtask policypassed (294 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).