GPU: serialize pipeline library atomic writes with unique temp files #1659
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1660"
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 Marvisak/VIctory. Originally posted by HailLucifer666 on 2026-11-24T20:33:34Z.
Issue:
pipeline::library::savereleases bothLASTandlibrarylocks before callingwrite_atomically, which always wrote to the same fixedhost-pipelines.tmppath. Concurrent pipeline worker saves and shutdownsave(true)can truncate or unlink each other's temp file on Windows, failing or corrupting the saved pipeline library.Fix:
write_atomicallywith a mutex, write to a unique per-call temp file (.tmp-<pid>-<n>), and clean up the temp file ifrenamefails.concurrent_write_atomically_never_fails_or_truncates.Verification:
cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(clean)cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings(clean)cargo test -p victory-gpu --locked(51 passed, 0 failed, 1 ignored)cargo test -p xtask --locked(4 passed, 0 failed)Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:19:51Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Pipeline library atomic writes serialized: concurrent worker and shutdown saves no longer race on the same staging file or target rename. concurrent_write_atomically_never_fails_or_truncates covers it.
Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T22:11:39Z.
Overlap: #72 already serializes pipeline-library saves and writes each publication to a unique temporary file. That's a superset of this change. The two conflict in
library.rs.Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current
main(70564ae):cargo test -p victory-gpumainmain+ this PRmain,--all-featuresmain+ this PR,--all-featurescargo clippy --all-targets -- -D warnings, with and without--all-features: clean.victory-gputests fail on currentmainon this NVIDIA card:dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views. That's the 1,000,000-view heap cap, see #1744. They fail the same way with this PR, and no other test does.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.