Retry failed pipeline cache saves #640
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/640"
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 Fluxxer763664 on 2026-11-24T06:04:16Z.
This fix lets VIctory retry saving its pipeline cache after a failed write. The Windows GPU suite passed 46 tests, and the fix passed three simulated write-failure scenarios. No game files were used. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:13:40Z.
Review: APPROVED
Tested on Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc).
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T11:09:54Z.
Review: COMMENTED
Tested
446fef9on Windows 11, RTX 5070, MSVC:cargo test -p victory-gpu -- --test-threads=143 passed, and with--features diagnostics45 passed. Clippy's 1 warning is the existingundocumented_unsafe_blocksin host.rs.The retry logic is right.
USED_CHANGEDis restored on both failure paths, andadded -= addedkeeps pipelines added during the write. Nothing else lowersaddedafter creation, so the subtraction can't underflow. One concern before approving:pipeline/library.rs(save):LASTis now held acrossSerializeand bothwrite_atomicallycalls.save(false)is called from pipeline creation (make.rs:186,make.rs:218). Before, a second caller during a save saw the fresh timestamp and returned at once. Now it blocks onLASTuntil the whole serialize-and-write finishes, then returns. So pipeline creation threads stall for the length of a library write, which can be many MB. To keep the "no two saves share temp paths" guarantee without the stall, take the lock withLAST.try_lock()when!nowand return onWouldBlock, or use a separateSAVING: Mutex<()>taken withtry_lockfor the write. Onlysave(true)(shutdown) should wait.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T11:41:19Z.
Independent verification & code review on Windows 11 Pro (build 26100) + AMD Radeon RX 9060 XT (RDNA4, driver
32.0.32029.2010, Rust1.98.1), cleanly merged ontomain(ffe310e):cargo xtask policy: PASS (154 files ok)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: PASScargo clippy -p victory-gpu --all-targets --features diagnostics --locked -- -D warnings: PASScargo test -p victory-gpu --locked: 50 passed, 0 failed, 1 ignoredDiff review (
crates/victory-gpu/src/pipeline/library.rs): clean and deadlock-free:LASTacross bothwrite_atomicallycalls prevents concurrentsave()calls from racing on the shared.tmpfilenames while keeping the lock order strictlyLAST -> library/LAST -> USED(never acquiringLASTfrom inside either).addedonly onOk(())preserves both failed-save retry state and any pipelines stored concurrently during disk I/O, and restoringUSED_CHANGEDon serialize/write failure avoids silently dropping early-pipeline updates.library.rs, so maintainers may want to pick one of #640 or #72.AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:26:41Z.
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #72. Same retry-after-failed-save change as #72 without its unique temp files or tests.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed