Skip to content

HLE: retain unreadable legacy save display metadata (on #2525) - #2675

Closed
jaschinski97-ops wants to merge 6 commits into
Marvisak:mainfrom
jaschinski97-ops:test/windows-legacy-save-retry
Closed

jaschinski97-ops wants to merge 6 commits into
Marvisak:mainfrom
jaschinski97-ops:test/windows-legacy-save-retry

Conversation

@jaschinski97-ops

@jaschinski97-ops jaschinski97-ops commented Nov 25, 2026 •

Copy link
Copy Markdown

An unreadable legacy .display currently becomes an empty display name during XGameSave migration. Migration can commit that incomplete metadata, retain the locked source folder, then delete the original label on retry. Defer migration when existing display metadata cannot be read; a missing .display still means an empty name.

Stacked on #2525, with its original commit/author retained. Land that PR first. The additional production change is only the display-file error handling. Existing partially migrated destinations are not repaired by this follow-up.

Tests hold either a legacy blob or .display with Windows FILE_SHARE_NONE, confirm ERROR_SHARING_VIOLATION32, require no partial v1, then unlock and verify both exact decoded blob names/payloads and the display before source removal. A genuinely missing metadata file remains accepted.

Validation:

Claims NEW-215 and NEW-216; completion.
AI-assisted with Codex: separate implementation and coordinator/agent reviews. Synthetic files only; no GPU/game data or gameplay claim.

@oni-swr

oni-swr commented Nov 25, 2026

Copy link
Copy Markdown

Independent verification (review, not a task claim) — covered by the existing claim on #1633.

Commands and results

  • cargo test --locked -p victory-hle --lib xgamesave → 15 passed, 0 failed, 0 ignored. This includes the new a_locked_legacy_blob_delays_migration_until_it_can_be_read, a_locked_legacy_display_delays_migration_until_it_can_be_read, missing_legacy_display_metadata_can_still_migrate and stray_u64_max_version_does_not_lose_the_save.
  • cargo test --locked -p victory-hle (full crate) → lib 150 passed, 0 failed, 0 ignored; tests/fidelityfx.rs 1 passed; tests/no_dll_planting.rs 1 passed; doc-tests 0 tests. No failures; I did not hit the dstorage flake mentioned in the description.
  • cargo clippy --locked -p victory-hle --all-targets → clean, no warnings.

Negative controls (each production hunk reverted on its own on the PR head, then restored; cargo test --locked -p victory-hle --lib xgamesave, each run 14 passed, 1 failed)

  • Unreadable .display read as empty (unwrap_or_default) → a_locked_legacy_display_delays_migration_until_it_can_be_read FAILED.
  • An unreadable legacy blob silently skipped → a_locked_legacy_blob_delays_migration_until_it_can_be_read FAILED.
  • Version number wraps instead of checked_add → stray_u64_max_version_does_not_lose_the_save FAILED (left == right assertion).
  • Manifest naming missing blobs accepted (the new check in load removed) → an_unreadable_newer_version_does_not_cost_the_save FAILED (the new "missing blob" case).
  • The positive control missing_legacy_display_metadata_can_still_migrate passes on the PR head. Because it does not need the fix, it is not expected to fail on main.

Review notes

  • The display fix is right: NotFound still means an empty name, and any other read error returns None so the whole migration is deferred and the legacy folder is kept. The blob loop now propagates the read error with ? instead of dropping the entry in filter_map, which closes the partial-publish case.
  • The locked-file tests are good: the fixture holds the file with share_mode(0), explicitly asserts ERROR_SHARING_VIOLATION (32), checks that no v1 is published, and checks the retry result and removal of the old folder. They are cfg(windows), so they do not run on other platforms.
  • Behavioural note: any non-NotFound error on .display, including a permanent one such as a permissions problem, now blocks migration indefinitely, since every later open retries and defers again. That looks intended, because the data stays safe, but it is worth knowing.
  • I found no bugs. Merge order matters because of the HLE: guard XGameSave version overflow and validate blobs before removing older versions #2525 stacking.

AI disclosure: independent verification by Claude Code (Claude Sonnet 5.5).

@kotekompotek

Copy link
Copy Markdown

Correct layering on #2525. Deferring on an unreadable .display closes the lose-the-name retry window, and load() now rejecting a version whose manifest names a missing blob prevents publishing a version that points at data that isn't there. The checked_add(1) on the version number is a good catch too. Needs #2525 first, as stated.

@fuzeofficlal

Copy link
Copy Markdown
Contributor

Independent Windows 11 verification and code review of b29c3a75 (on 13f91ca):

Verification (rustc 1.98.1 MSVC)

  • cargo clippy --locked -p victory-hle --all-targets -- -D warnings and --all-features: 0 warnings.
  • cargo test --locked -p victory-hle: 150 passed, 0 failed (lib, including all new legacy display/blob lock and missing-display tests), plus fidelityfx and no_dll_planting checks clean.
  • cargo xtask policy: 184 files ok.

Review Notes

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

This branch is built on #2525, which was closed today as covered by other PRs, and most of its diff in crates/victory-hle/src/modules/xgamesave.rs is that PR again: the blob check in load duplicates the open #1981, and the checked_add in Update::submit duplicates the open #2511. The remaining change, deferring migrate when .display or a blob cannot be read, has the flaw named when #2525 was closed. Once the title saves under that container name, Update::submit commits a fresh v1. The next Provider::open then finds current_named set in migrate and runs remove_dir_all(old), so the legacy data is still lost; a reviewer here describes the same path. A rework against current main, without the #1981/#2511 hunks, would need to make a deferred legacy container block or merge into a new save under that name, with a test of that sequence. CI (check) passes.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

@jaschinski97-ops

Copy link
Copy Markdown
Author

The refresh CI failed only in unchanged frame::tests::waits_end_on_ticks_and_count_frames (S_OK0 rather than TIMEOUT1 at frame.rs231); source and failing job are recorded in #3080, which already addresses that timing assumption. All156 native HLE tests and strict Clippy pass. A single new CI attempt is triggered with an explicitly empty commit; product code is unchanged. Rerunning the upstream job directly requires repository admin rights, so I could not use that button/API. I will record the new result rather than treat the first run as green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants