Preserve ambiguous legacy XGameSave migrations (FIND-23) #2720
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!2720
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2720"
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?
@leftmove on GitHub · 2026-11-25 18:49 UTC · original
leftmove:fix/find-23-xgamesave-migration→main· +236 −1 · 1 files · 2 commits · openSummary
On
main,migrate()treats an old-layout folder beside a committed save as the leftover from an interrupted migration and removes it. The two can legitimately differ. On Windows, a legacy blob opened without read or delete sharing can be skipped during migration. VIctory commits the other blobs to v1, then fails to remove the locked file. After the handle closes, the legacy folder still contains a blob that never made it into v1.A selected v1 clears the old folder only when the display metadata, decoded names, and payloads match. A later commit with readable listed blobs takes precedence, preserving its intentional deletions. An unreadable committed version that produces
InvalidDataalso takes the preservation path.Preserved data lives in numbered slots under
<container>/.legacy. VIctory does not read the backed-up files. Deleting the container removes its.legacydirectory along with the active save. Each move reserves a fresh slot, so existing backups stay intact and cannot block deletion. If a legacy folder is still in the provider root when the title deletes the container, deletion moves it into a fresh slot before retiring the whole container, preventing its re-import on the next open.This branch is based on current
main. A scratch merge with #2675 was clean and exercised that PR's missing-blob loader behavior. Coordination claimVerification
cargo test -p victory-hle --locked --target x86_64-pc-windows-gnullvm --no-run. Windows-target Clippy passed for all targets and features with-D warnings.cargo test -p victory-hle --locked --lib xgamesavepassed all 15 tests on this branch and all 17 on the scratch merge with #2675. The full Linux library run had 82 passes and two Windows-specific kernel failures that also reproduced on current main.cargo xtask policypassed for 191 files. The tests used synthetic saves. Gameplay and physical GPU behavior remain unverified.Native Windows CI passed the workspace test suite and both strict Clippy runs. This included all 16 XGameSave tests, 157 HLE unit tests, and both HLE integration tests. Windows CI
Written with AI assistance (Codex).
@kotekompotek on GitHub · 2026-11-25 18:59 UTC · original
Careful data-preservation logic: v1 proves the legacy folder by full content equality (display + decoded names + payload bytes), later versions only supersede when every listed blob is readable - which is exactly the guarantee needed since updates legitimately delete blobs. Ambiguous cases get renamed to .legacy rather than silently dropped, and delete() refusing while a re-importable legacy folder remains prevents the resurrect-old-save trap. Note: version.dir.ends_with("v1") is a path-component check so only v1 matches (v11, v21 don't) - correct, just easy to misread.
@oni-swr on GitHub · 2026-11-25 19:41 UTC · original
Independent WARP/CPU verification for head 7eefcfa2a42962c5a098440b040a06fea6208374 against origin/main
13f91caee2. State check: open, non-draft, clean merge-tree; no oni-swr comment found.Environment: Windows x64, Rust 1.98.1 (48a229cea 2026-09-01), Windows SDK dxil.dll 10.0.26100.0 (file version 1.8.2502.11); WARP/D3D12 WARP env vars set; CARGO_TARGET_DIR=D:\victory-warp-2720-target. Fixtures are synthetic temp files.
Commands/results:
Review: no data-loss issue found in the matching, backup, or delete-blocking paths exercised here.
Not tested: physical GPU, retail title/game behavior, release build. AI disclosure: Codex (gpt-6-luna).
@fuzeofficlal on GitHub · 2026-11-25 19:42 UTC · original
Independent Windows 11 verification and review of
7eefcfa(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo xtask policy: 184 files ok.cargo clippy --locked -p victory-hle --all-targets -- -D warnings: 0 warnings.cargo test --locked -p victory-hle: 151 passed, 0 failed (lib, all 5 new legacy-migration tests pass), plusfidelityfx(1) andno_dll_planting(1) clean.Review & Merge-Ordering Notes
v1(matches_legacy) and blob readability forv2+before deletingold, moving ambiguous legacy folders todir/.legacy(preservingoldif.legacyalready exists), and blockingdeletewhile an unmoved legacy folder remains directly close the data-loss window where a concurrent write could otherwise causemigrate()to wipe unmigrated legacy blobs.xgamesave.rs::migrateandmod testswith #2675 (which carries #2525). Beyond the textual conflict, note a semantic interaction: #2525/#2675 changesload()to returnOk(None)when a listed blob is missing, causingcurrent_named(&dir, name)to returnErr(InvalidData). Under#2720'sif let Some(version) = current_named(&dir, name).ok()?, that error short-circuits toNonerather than movingoldtodir/.legacy(which would breakincomplete_later_version_preserves_legacy_dataafter merging both unlessErr(InvalidData)with an existing version dir is also routed to the.legacybackup path).@Marvisak on GitHub · 2026-11-25 23:19 UTC · original · edited 2026-11-26 04:23 UTC
Automated triage for the maintainers.
Needs work. Thanks for working through all four points; backups now go into fresh numbered slots,
deleteremoves the whole container, andInvalidDatatakes the preservation path, with tests. The remaining problem is inmigrateitself (victory-hle/src/modules/xgamesave.rs): itsfilter_mapdrops any blob whosestd::fs::readfails and commits v1 without it, so the title still loses it even though it is kept under.legacy. Please makemigratestop without committing when a legacy blob cannot be read (leave the old folder for the next open), with a test; then I would see this as a merge candidate.CI: passing.
Generated by Claude Code
@leftmove on GitHub · 2026-11-26 03:31 UTC · original
Addressed the four triage points in
cdf2ec6, rebased ontomainat63bcca4.<container>/.legacy, VIctory does not read the files, and deleting the container removes them with the active save.InvalidDataresult for an unreadable committed destination now takes the preservation path.incomplete_later_version_preserves_legacy_datacovers both missing blobs and a missing manifest. The branch remains based on main. A clean scratch merge with #2675 passed all 17 local XGameSave tests, exercising #2675's missing-blob loader in the same regression.Native Windows CI passed all 16 XGameSave tests, all 157 HLE unit tests, both HLE integration tests, and both strict Clippy runs.
cargo xtask policypassed for 191 files. The tests used synthetic saves. Windows CIAI-assisted with Codex.
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.