fix: report save enumeration failures #3657

Open
github-bot wants to merge 7 commits from github-bot/gh-3657 into main AGit
Owner

@⁠igorevv on GitHub · 2026-11-30 03:07 UTC · original
igorevv:fix/xgamesave-enumeration-errors → main · +32 −8 · 3 files · 7 commits · open

fix: report save enumeration failures

Branch: fix/xgamesave-enumeration-errors
Commit: 77f08437

Summary

Make blob enumeration report corrupted or unreadable saves as NO_ACCESS instead of returning S_OK with no blobs.

Problem

enumerate_blobs() loaded the current save version with:

current_named(&c.dir, &c.name).ok().flatten()

This discarded both InvalidData and host I/O errors. A container with a malformed manifest or an access failure was therefore indistinguishable from an empty container: enumeration returned S_OK and invoked no callbacks.

Read and update paths already reported the same failures through the existing io_error() mapping.

Fix

enumerate_blobs() now matches on the current_named() result and returns io_error(&c.dir, &e) when loading fails.

Valid missing containers still enumerate as empty, and valid containers retain their existing behavior.

Regression test

Extended no_readable_version_is_refused_and_kept to corrupt the container manifest and verify that:

  • all_blobs() returns NO_ACCESS;
  • the blob callback is never invoked;
  • the damaged save remains in place, as before.

The callback deliberately panics if called, so the test would fail before the fix with both the wrong HRESULT and an unexpected callback path.

Changed files

  • crates/victory-hle/src/modules/xgamesave.rs
    • propagate save-loading errors during blob enumeration;
    • add broken-manifest enumeration coverage.

Validation

cargo test -p victory-hle no_readable_version_is_refused_and_kept --locked
1 passed; 0 failed

cargo test -p victory-hle blocking_calls_answer_as_the_async_ones --locked
1 passed; 0 failed

cargo xtask policy --staged
asset policy: 1 files ok

git diff --check
passed

The second test confirms that normal blocking blob enumeration still works. Tests were run with TEMP and TMP pointing to a writable directory on D:. No game or real user save was used.

**@⁠igorevv** on GitHub · 2026-11-30 03:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3657) `igorevv:fix/xgamesave-enumeration-errors` → `main` · +32 −8 · 3 files · 7 commits · open # fix: report save enumeration failures Branch: `fix/xgamesave-enumeration-errors` Commit: `77f08437` ## Summary Make blob enumeration report corrupted or unreadable saves as `NO_ACCESS` instead of returning `S_OK` with no blobs. ## Problem `enumerate_blobs()` loaded the current save version with: ```rust current_named(&c.dir, &c.name).ok().flatten() ``` This discarded both `InvalidData` and host I/O errors. A container with a malformed manifest or an access failure was therefore indistinguishable from an empty container: enumeration returned `S_OK` and invoked no callbacks. Read and update paths already reported the same failures through the existing `io_error()` mapping. ## Fix `enumerate_blobs()` now matches on the `current_named()` result and returns `io_error(&c.dir, &e)` when loading fails. Valid missing containers still enumerate as empty, and valid containers retain their existing behavior. ## Regression test Extended `no_readable_version_is_refused_and_kept` to corrupt the container manifest and verify that: - `all_blobs()` returns `NO_ACCESS`; - the blob callback is never invoked; - the damaged save remains in place, as before. The callback deliberately panics if called, so the test would fail before the fix with both the wrong HRESULT and an unexpected callback path. ## Changed files - `crates/victory-hle/src/modules/xgamesave.rs` - propagate save-loading errors during blob enumeration; - add broken-manifest enumeration coverage. ## Validation ```text cargo test -p victory-hle no_readable_version_is_refused_and_kept --locked 1 passed; 0 failed cargo test -p victory-hle blocking_calls_answer_as_the_async_ones --locked 1 passed; 0 failed cargo xtask policy --staged asset policy: 1 files ok git diff --check passed ``` The second test confirms that normal blocking blob enumeration still works. Tests were run with `TEMP` and `TMP` pointing to a writable directory on `D:`. No game or real user save was used.
`--set VICTORY_WARMUP_RESTART=<seconds>` asks for the older warm-up
restart, whose mark is written by the layer
(crates\victory-gpu\src\host\menu.rs, `warmup`). The layer is told the
seconds and nothing else: it reads the mark's path from
`VICTORY_WARMUP_MARK`, and does nothing when that is empty.

Since "First start of a new victory.exe: make every shader first, once"
the launcher names that mark only on the preload branch, which is
skipped whenever `VICTORY_WARMUP_RESTART` is set. So no mark is ever
written, and every start of the same exe warms up and starts again.
Before that commit the two variables were set together.

Set it on that branch too, and keep `warmup_mark` lazy so a start that
needs no mark does not hash the exe.
Configured XOR layouts are addressable on the CPU but have no pattern tables for the GPU detiler. Return no GPU detile parameters for them so the existing CPU fallback is used, and cover the configured case in the detile parameter test.
Blob enumeration discarded current_named errors and returned S_OK with no callbacks for malformed or unreadable saves. Propagate the existing NO_ACCESS mapping instead, and cover broken-manifest enumeration without invoking the callback.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 03:08:36 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-30 09:33 UTC · original

I replayed a real Windows I/O denial with a valid temporary save on current release/main 41adb551 and with the exact #3657 change 77f08437 applied as 7ae27b6.

The fixture opens the generated save manifest with OpenOptionsExt::share_mode(0). A second open returns Win32 error 32. I then call all_blobs with the same handle still held and again after releasing it.

Phase Main With #3657
Manifest denied S_OK, 0 callbacks NO_ACCESS (0x80830002), 0 callbacks
Handle released S_OK, 1 callback S_OK, 1 callback

Both runs preserved the manifest and blob byte for byte. The existing modules::xgamesave:: suite passed 17/17 with the patch. The additional sharing-denial test failed on main and passed with the patch on Rust 1.98.1/MSVC.

If you reuse the additional regression case, please retain its authorship with Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-30 09:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3657#issuecomment-7274365301) I replayed a real Windows I/O denial with a valid temporary save on current release/main `41adb551` and with the exact #3657 change `77f08437` applied as `7ae27b6`. The fixture opens the generated save manifest with `OpenOptionsExt::share_mode(0)`. A second open returns Win32 error 32. I then call `all_blobs` with the same handle still held and again after releasing it. | Phase | Main | With #3657 | | --- | --- | --- | | Manifest denied | `S_OK`, 0 callbacks | `NO_ACCESS` (`0x80830002`), 0 callbacks | | Handle released | `S_OK`, 1 callback | `S_OK`, 1 callback | Both runs preserved the manifest and blob byte for byte. The existing `modules::xgamesave::` suite passed 17/17 with the patch. The additional sharing-denial test failed on main and passed with the patch on Rust 1.98.1/MSVC. If you reuse the additional regression case, please retain its authorship with `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
This pull request has changes conflicting with the target branch.
  • apps/victory/src/play.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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