Reuse a completed shader cache entry after a concurrent write #632
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!632
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-632"
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?
@cnuonr on GitHub · 2026-11-28 02:07 UTC · original
cnuonr:fix/shader-cache-concurrent-publish→main· +55 −2 · 1 files · 1 commits · closed without mergingProblem
Two shader translations can miss the same content-addressed cache key. If the first writer publishes the entry and a reader keeps it open on Windows, replacement by the second writer can fail with access denied. The existing complete entry is already available, but the second caller reports a shader conversion error.
Change
After a failed publication, remove the staging file and use the completed entry if a file now exists at the cache key. An unavailable destination still returns the original error.
Verification
cargo test --locked -p victory-pipeline --lib cache::testspassed all 8 tests on Windows. The new test reproduces the access-denied error on the original implementation with a file opened for shared reads. It checks that the final result remains readable and that the staging file is cleaned up.@trustno1-coder on GitHub · 2026-11-28 20:28 UTC · original
Thanks for this. I'm closing it because main already does this: when the rename fails because another writer published the same key meanwhile, the existing entry is used (crates/victory-pipeline/src/cache.rs, with its own test of an entry published while open). The two conflict.
Pull request closed