Preserve the last complete save during XGameSave recovery #4273
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!4273
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4272"
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?
@invismann on GitHub · 2026-11-30 18:01 UTC · original
invismann:fix/xgamesave-recovery→main· +166 −33 · 1 files · 2 commits · openSplit from #4255.
What it changes
v2.new.Based on towiice's
034cb3de6and lgtlgt0015-code's7e9f3a028and2e2ca139f.How it was tested
Before: All three save regressions failed on
84bd61e2cwith the tests applied. The cases cover an unreadable legacy blob, a newer version with a missing or invalid blob file, and noncanonical staging directory names.After: The Windows
victory-hlemodules::xgamesave::suite passed on this branch, including all three regressions. The fixtures use temporary directories and synthetic blobs. The asset policy passed for the save commit.Startup smoke: The combined branch in #4255 ran on Windows with an RTX 4090, Series X at 2560×1440 SDR, and DLSS, frame generation, and hardware ray tracing disabled. It reached at least 1,024 presented frames.
CI baseline: The workspace Clippy run on #4255 failed on existing warnings in the shader and GPU crates. CI log
Checked for overlap
@babuakhil on GitHub · 2026-11-30 18:30 UTC · original
Checked on Windows 11 (Rust 1.98.1, pinned), applied on current
main(e1251c31); cherry-picks cleanly.cargo test -p victory-hle --lib xgamesavegives 19 passed, 0 failed, the three new cases among them. Not tested in the game.The
loadand.newchanges look right to me: a version missing a blob file now falls back to the one before it, and onlyv<N>.newdirectories are cleaned up, which is exactly whatcommitstages (format!("v{number}.new")).For the migration change, I tried the case I'd expect most often on Windows: another program (a backup tool, a virus scanner) holding one blob of an old-layout save with no sharing, during one start only. A throwaway test (not part of this PR) used an old
Playerfolder withSave Game Data= "progress" andSave Game Header= "header", the header opened withshare_mode(0)during the firstProvider::open, then released:mainData=progressHeaderlost for good,Data=progressData=progress,Header=header, completemain, title saves a newPlayerin betweenData=progressData=fresh startPlayerin betweenData=fresh start; the old progress is deletedSo the PR fixes the silent loss of a blob (rows 1–2), but it opens a worse case (row 4). While migration is put off, the title finds no save, and a player who then starts a new game and saves makes
current_namedreturn a version, so the next start takesdoneand runsremove_dir_all(old)on a save that was never migrated. Onmainthe title would have shown the progress and the player wouldn't have started over.A small change would close it: when migration is put off, don't let a later version count as "done". For example, only remove
oldwhen the committed version came from the migration (a marker written in the same commit), or, whendonebutoldstill exists, rename it aside (Player.unmigrated) rather than delete it. Atracing::warn!naming the container when migration is put off would also tell the user why their save is missing for that run.49f339061eto8ded1280c2View 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.