HLE: a save of the old layout is not moved without a file it cannot read #3329

Open
github-bot wants to merge 1 commit from github-bot/gh-3329 into main AGit
Owner

@⁠Creaa on GitHub · 2026-11-26 18:20 UTC · original
Creaa:hle/xgamesave-migrate-unreadable → main · +118 −11 · 1 files · 1 commits · open

xgamesave::migrate moves a container of the old (pre-versioned) layout into a committed version, then removes the old folder. A .display it could not read became an empty display name, and a blob it could not read was skipped, so a file another process held open (no sharing) was committed without and then lost with the old folder. This keeps the old layout when a file that is there cannot be read; a later listing moves it whole. Covers NEW-215 and NEW-216 from #1633 (their earlier base #2525 is closed).

What is in it

  • crates/victory-hle/src/modules/xgamesave.rs: in migrate, .display not found is still an empty name; any other error reading .display, a blob or an entry of the folder listing logs a warning and returns before commit, leaving the old folder for the next listing.
  • Same file: new old_moved(root, name); Update::submit and delete call it first and return NO_ACCESS while the container's old layout cannot be moved yet, so no version is committed that migrate would then take for its own before removing the old folder.
  • Test an_unreadable_old_display_or_blob_leaves_the_old_layout_for_later: for .display and for a blob held with share_mode(0), the old layout stays and nothing is committed, and an update and a delete of the container are refused without committing or removing anything; after the handle is dropped, the next Provider::open moves both blobs and the display name Chapter 1.

Tested

  • Windows 11 build 26300, i7-13700F, Rust 1.98.1 (pinned); on main 63bcca4.
  • The new test passes (#[cfg(windows)], like the other Windows-only test here); with main's migrate it fails at ".display held: nothing committed", and with old_moved always true at ".display held: update".
  • cargo test -q --locked -p victory-hle --lib --no-fail-fast: 153 passed, 0 failed (the_old_layout_moves_over unchanged and passing).
  • cargo clippy --workspace --all-targets --locked -- -D warnings and with --all-features: clean. cargo xtask policy: 191 files ok.

Not tested

  • With the title (synthetic save folders only; no game data). Other locking cases than a share-none handle.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change and the test, ran the checks and drafted this description; I checked it.

🤖 Generated with Claude Code

**@⁠Creaa** on GitHub · 2026-11-26 18:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/3329) `Creaa:hle/xgamesave-migrate-unreadable` → `main` · +118 −11 · 1 files · 1 commits · open `xgamesave::migrate` moves a container of the old (pre-versioned) layout into a committed version, then removes the old folder. A `.display` it could not read became an empty display name, and a blob it could not read was skipped, so a file another process held open (no sharing) was committed without and then lost with the old folder. This keeps the old layout when a file that is there cannot be read; a later listing moves it whole. Covers NEW-215 and NEW-216 from #1633 (their earlier base #2525 is closed). **What is in it** - `crates/victory-hle/src/modules/xgamesave.rs`: in `migrate`, `.display` not found is still an empty name; any other error reading `.display`, a blob or an entry of the folder listing logs a warning and returns before `commit`, leaving the old folder for the next listing. - Same file: new `old_moved(root, name)`; `Update::submit` and `delete` call it first and return `NO_ACCESS` while the container's old layout cannot be moved yet, so no version is committed that `migrate` would then take for its own before removing the old folder. - Test `an_unreadable_old_display_or_blob_leaves_the_old_layout_for_later`: for `.display` and for a blob held with `share_mode(0)`, the old layout stays and nothing is committed, and an update and a delete of the container are refused without committing or removing anything; after the handle is dropped, the next `Provider::open` moves both blobs and the display name `Chapter 1`. **Tested** - Windows 11 build 26300, i7-13700F, Rust 1.98.1 (pinned); on `main` `63bcca4`. - The new test passes (`#[cfg(windows)]`, like the other Windows-only test here); with `main`'s `migrate` it fails at "`.display` held: nothing committed", and with `old_moved` always true at "`.display` held: update". - `cargo test -q --locked -p victory-hle --lib --no-fail-fast`: 153 passed, 0 failed (`the_old_layout_moves_over` unchanged and passing). - `cargo clippy --workspace --all-targets --locked -- -D warnings` and with `--all-features`: clean. `cargo xtask policy`: 191 files ok. **Not tested** - With the title (synthetic save folders only; no game data). Other locking cases than a share-none handle. **AI use** - Claude Code (Claude Opus 5.5) wrote the change and the test, ran the checks and drafted this description; I checked it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`migrate` moves a container of the pre-versioned layout into a committed
version and then removes the old folder. A `.display` it could not read
became an empty display name, and a blob it could not read was skipped,
so a file another process held open (no sharing) was committed without
and then lost with the old folder (NEW-215, NEW-216 in #1633).

Now a missing `.display` is still an empty name, but any other read
failure of the display or of a blob leaves the old layout untouched and
returns, so a later listing moves the container whole.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:23:41 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 18:27 UTC · original · approved these changes

LGTM — verified on Windows against origin/main (63bcca4).

  • Bailing out of migrate on non-NotFound .display read errors or any blob read error prevents committing an incomplete save and deleting the old layout while another process holds a file.
  • cargo test -p victory-hle --lib modules::xgamesave:: -- --test-threads=1: 12 passed, 0 failed (including an_unreadable_old_display_or_blob_leaves_the_old_layout_for_later).
  • cargo clippy -p victory-hle --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 18:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/3329#pullrequestreview-6078973789) · **approved these changes** LGTM — verified on Windows against `origin/main` (`63bcca4`). - Bailing out of `migrate` on non-`NotFound` `.display` read errors or any blob read error prevents committing an incomplete save and deleting the old layout while another process holds a file. - `cargo test -p victory-hle --lib modules::xgamesave:: -- --test-threads=1`: 12 passed, 0 failed (including `an_unreadable_old_display_or_blob_leaves_the_old_layout_for_later`). - `cargo clippy -p victory-hle --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠borosf on GitHub · 2026-11-26 19:03 UTC · original

Independent local verification on Windows 11 x64, Intel Arc B580 12 GB (12 cores), at this PR's head e419c04:

cargo test -p victory-hle --lib --locked --no-fail-fast -- --test-threads=1
cargo clippy -p victory-hle --all-targets --locked -- -D warnings
cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings

Result: victory-hle lib: fully green (exit 0) apart from modules::dstorage::tests::a_page_list_filled_after_its_request_starts, which passed on 2x --exact --test-threads=1 re-runs (flake); the PR's new bounds test and all xgamesave tests pass.

Both clippy runs exit 0 (-D warnings, both feature sets). The B580 baseline failures pristine main also hits are: victory-gpu descriptor::host::tests::dynamic_slots_are_held_until_released + memory::tests::lists_share_a_table_and_copies_keep_their_views (#1744/#1829); victory-shader emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros + emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products. No PR regressions.

Synthetic tests only; no game data used. Full log kept locally. — borosf

**@⁠borosf** on GitHub · 2026-11-26 19:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/3329#issuecomment-7201148014) Independent local verification on Windows 11 x64, Intel Arc B580 12 GB (12 cores), at this PR's head `e419c04`: ``` cargo test -p victory-hle --lib --locked --no-fail-fast -- --test-threads=1 cargo clippy -p victory-hle --all-targets --locked -- -D warnings cargo clippy -p victory-hle --all-targets --all-features --locked -- -D warnings ``` Result: victory-hle lib: fully green (exit 0) apart from modules::dstorage::tests::a_page_list_filled_after_its_request_starts, which passed on 2x --exact --test-threads=1 re-runs (flake); the PR's new bounds test and all xgamesave tests pass. Both clippy runs exit 0 (-D warnings, both feature sets). The B580 baseline failures pristine main also hits are: victory-gpu descriptor::host::tests::dynamic_slots_are_held_until_released + memory::tests::lists_share_a_table_and_copies_keep_their_views (#1744/#1829); victory-shader emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros + emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products. No PR regressions. Synthetic tests only; no game data used. Full log kept locally. — borosf
github-bot force-pushed github-bot/gh-3329 from e419c04bed to 80e854a221 2026-11-26 20:20:44 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3329/head:github-bot/gh-3329'
git switch 'github-bot/gh-3329'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3329'
git switch 'github-bot/gh-3329'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3329'
git switch 'github-bot/gh-3329'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3329'
git switch 'main'
git merge --squash 'github-bot/gh-3329'
git switch 'main'
git merge --ff-only 'github-bot/gh-3329'
git switch 'main'
git merge 'github-bot/gh-3329'
git push origin 'main'
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!3329
No description provided.