Reuse a completed shader cache entry after a concurrent write #632
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cnuonr on 2026-11-28T02:07:02Z.
Problem
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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T20:28:52Z.
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