HLE XGameSave: tolerate locked old or unfinished version cleanup #3104
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3104
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3104"
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?
@fuzeofficlal on GitHub · 2026-11-26 08:12 UTC · original
fuzeofficlal:fix/hle-xgamesave-tolerate-locked-cleanup→main· +85 −5 · 1 files · 1 commits · openSummary
crates/victory-hle/src/modules/xgamesave.rs(current), treatstd::fs::remove_dir_allfailures when cleaning stale*.newstaging folders or olderv<old>committed versions as non-fatal (tracing::warn!and continue) instead of aborting container reads and blocking subsequent updates (e.g., when Windows AV/backup scanners temporarily hold a file in an older version folder without delete sharing).read_dir,load,commitstaging/rename, or missing readable manifests) continue to propagate unchanged.OpenOptionsExt::share_mode(0)verifying that reads, subsequent updates, and post-unlock cleanup all succeed when an old version or stale.newdirectory is locked.(Issue pattern originally noted in
fxceless/victory-fork6a42ed27; implemented cleanly againstmainwith Windows-native locked-file regression tests.)Verification
cargo test -p victory-hle --locked -- modules::xgamesave::: 13 passed, 0 failed.cargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean.cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings: clean.cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed, 0 failed.@Marvisak on GitHub · 2026-11-26 08:24 UTC · original
Automated triage for the maintainers.
Merge candidate. In
crates/victory-hle/src/modules/xgamesave.rs,currentnow logs and continues whenremove_dir_allfails on a leftover*.newstaging folder or an olderv<N>version. Before, a file held open without delete sharing (a scanner, a backup tool) made every read and update of that container fail. I checked that the cleanup is the only thing relaxed:read_dir,load,commitand the commit rename still propagate their errors.The two Windows tests lock a file with
share_mode(0)and check that reads and updates still work, and that cleanup finishes once the lock is gone. CI (check, windows-latest) passes.A note: a locked leftover named
v<highest+1>.newstill fails the next update.commitremoves that exact folder first and propagates the error, as on main. That is the usual crash leftover, so the test withv99.newsteps around it. It is not a regression, but a follow-up could commit to a fresh name in that case.Generated by Claude Code
@oni-swr on GitHub · 2026-11-26 08:28 UTC · original
Independent Windows CPU verification of PR #3104 at
c4509390cf(single commit, parent63bcca43c6= main). Claim: #1633 . Windows 11 x64, no GPU, no gamepad,cargo test --locked -j 4 -p victory-hle --lib xgamesave, isolated tempdirs only, synthetic data only..newversion).remove_dir_all(...)?fail both new tests with Windows error 32 (sharing violation), so the tests do exercise the change.v1and av50.newstaging dir. Repeated reads returned the newer committed version, update tov3succeeded, both locked dirs were left in place, and after release the next read removed both. With a zero-share lock on the active version's manifest: read and update both returned the same error (NO_ACCESS),v3was kept, nov4was created; after release, read and update worked normally.Not checked: source review, other platforms, clippy. Test report only; no source changes and no PR from me.
AI use: Claude Code (Claude Sonnet 5.5) ran the checks, coordinated by Codex (gpt-6.2-sol).
@Dukestar69 on GitHub · 2026-11-26 08:30 UTC · original · approved these changes
Verified against
origin/main(63bcca4):cargo test -p victory-hle --lib modules::xgamesave:: -- --test-threads=1: 13/13 passed (includinga_locked_old_version_does_not_block_reads_or_updatesanda_locked_unfinished_version_does_not_block_reads_or_updates).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly tolerates locked old or unfinished version directories during XGameSave cleanup instead of failing reads/updates.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.