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

Closed
github-bot wants to merge 6 commits from github-bot/gh-2675 into main AGit
Owner

@⁠jaschinski97-ops on GitHub · 2026-11-25 17:57 UTC · original
jaschinski97-ops:test/windows-legacy-save-retry → main · +139 −14 · 1 files · 6 commits · closed without merging

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:

  • Locked-blob regression fails on main13f91ca and passes on unchanged #2525; locked-display regression fails on #2525 before this fix. Final tests pass.
  • Current main63bcca43: all156 native Windows GNU HLE tests and strict all-target/all-feature Clippy pass.
  • Combined MSVC release source08b4585: 19 app,156 HLE and35 loader tests pass in Windows CI; the downloaded release passes10 native Windows11 program/path/status cases.
  • Latest head9e27cd3 has passing Windows MSVC workspace CI. Its parent attempt failed only in the unchanged frame timing test; the evidence is reported in #3080. The retry commit is explicitly empty; product code is unchanged.
  • Asset policy passes. One earlier local DirectStorage failure, followed by successful isolated/full reruns, was also retained in the verification record.

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.

**@⁠jaschinski97-ops** on GitHub · 2026-11-25 17:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/2675) `jaschinski97-ops:test/windows-legacy-save-retry` → `main` · +139 −14 · 1 files · 6 commits · closed without merging 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: - Locked-blob regression fails on main13f91ca and passes on unchanged #2525; locked-display regression fails on #2525 before this fix. Final tests pass. - Current main63bcca43: all156 native Windows GNU HLE tests and strict all-target/all-feature Clippy pass. - Combined MSVC release source08b4585: 19 app,156 HLE and35 loader tests pass in [Windows CI](https://github.com/jaschinski97-ops/VIctory/actions/runs/45850777211); the downloaded release passes10 native Windows11 program/path/status cases. - Latest head9e27cd3 has passing [Windows MSVC workspace CI](https://github.com/Marvisak/VIctory/actions/runs/45851572598). Its parent attempt failed only in the unchanged frame timing test; the evidence is reported in [#3080](https://git.gtahub.st/github/Marvisak--VIctory/pulls/3080). The retry commit is explicitly empty; product code is unchanged. - Asset policy passes. One earlier local DirectStorage failure, followed by successful isolated/full reruns, was also retained in the verification record. Claims NEW-215 and NEW-216; [completion](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633). AI-assisted with Codex: separate implementation and coordinator/agent reviews. Synthetic files only; no GPU/game data or gameplay claim.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:11:45 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 18:34 UTC · original

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

  • PR head: b29c3a7510f55c06f30ea17e038d6fc2a6b564c4 (OPEN, non-draft, merges cleanly; merge-base == origin/main)
  • origin/main: 13f91caee25f2fdf2c062be5f7a27f058e51cbca
  • Environment: Windows 11, VICTORY_WARP=1, VICTORY_D3D12_WARP=1, dxil.dll 1.8.2502.11 (Windows Kit 10.0.26100.0 x64), no physical GPU used (the HLE tests do not open a GPU), no game files, synthetic temp files only.
  • Note: the PR bundles the #2525 commit (a805860, which is still open at that head) plus 3 follow-up commits, so the diff against main contains #2525's production changes (version overflow, blob validation) as well as the display-metadata fix.

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 #2525 stacking.

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

**@⁠oni-swr** on GitHub · 2026-11-25 18:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/2675#issuecomment-7171106715) **Independent verification (review, not a task claim)** — covered by the existing claim on #1633. - PR head: `b29c3a7510f55c06f30ea17e038d6fc2a6b564c4` (OPEN, non-draft, merges cleanly; merge-base == `origin/main`) - `origin/main`: `13f91caee25f2fdf2c062be5f7a27f058e51cbca` - Environment: Windows 11, `VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`, `dxil.dll` 1.8.2502.11 (Windows Kit 10.0.26100.0 x64), no physical GPU used (the HLE tests do not open a GPU), no game files, synthetic temp files only. - Note: the PR bundles the #2525 commit (`a805860`, which is still open at that head) plus 3 follow-up commits, so the diff against `main` contains #2525's production changes (version overflow, blob validation) as well as the display-metadata fix. **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 #2525 stacking. AI disclosure: independent verification by Claude Code (Claude Sonnet 5.5).
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 18:35 UTC · original

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.

**@⁠kotekompotek** on GitHub · 2026-11-25 18:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/2675#issuecomment-7171114071) 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.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 19:09 UTC · original

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

  • Distinguishing NotFound (migrates with empty display name) from transient read errors (returns None and retries once unlocked) works as intended, and the Windows file-lock tests exercise the real locking path.
  • Data-loss interaction during transient lock + concurrent write (xgamesave.rs:349 vs Update::submit 476-539): if .display (or a blob) is locked when Provider::open runs so migrate() skips old, and the title writes a new update to the same container name before the lock clears, Update::submit sees current(&self.dir) == Ok(None) and creates a fresh v1 without the unmigrated legacy blobs. On a subsequent migrate() after the lock clears, current_named(&dir, name).ok()?.is_some() treats that v1 as a completed prior migration and runs remove_dir_all(old), deleting the unmigrated legacy blobs (inherited from #2525's deferred blob migration and now reachable when .display is locked too).
  • Note on merge ordering: because this branch carries #2525's commit a805860 verbatim, git merge-tree conflicts with #2525 unless merged in order (#2525 first + rebase, or taking #2675 as a superset).
**@⁠fuzeofficlal** on GitHub · 2026-11-25 19:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/2675#issuecomment-7171899663) 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 - Distinguishing `NotFound` (migrates with empty display name) from transient read errors (returns `None` and retries once unlocked) works as intended, and the Windows file-lock tests exercise the real locking path. - **Data-loss interaction during transient lock + concurrent write (`xgamesave.rs:349` vs `Update::submit` `476-539`):** if `.display` (or a blob) is locked when `Provider::open` runs so `migrate()` skips `old`, and the title writes a new update to the same container name before the lock clears, `Update::submit` sees `current(&self.dir) == Ok(None)` and creates a fresh `v1` without the unmigrated legacy blobs. On a subsequent `migrate()` after the lock clears, `current_named(&dir, name).ok()?.is_some()` treats that `v1` as a completed prior migration and runs `remove_dir_all(old)`, deleting the unmigrated legacy blobs (inherited from #2525's deferred blob migration and now reachable when `.display` is locked too). - Note on merge ordering: because this branch carries #2525's commit `a805860` verbatim, `git merge-tree` conflicts with #2525 unless merged in order (#2525 first + rebase, or taking #2675 as a superset).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 23:24 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 23:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/2675#issuecomment-7177520713) <!-- victory-triage v1 head=b29c3a7510f55c06f30ea17e038d6fc2a6b564c4 verdict=proposed-close at=2026-11-25T23:24:28Z --> 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](https://claude.ai/code)_
Author
Owner

@⁠jaschinski97-ops on GitHub · 2026-11-26 15:41 UTC · original

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.

**@⁠jaschinski97-ops** on GitHub · 2026-11-26 15:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/2675#issuecomment-7196612543) 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.
github-bot closed this pull request 2026-11-26 18:12:20 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2675
No description provided.