HLE/dstorage: a plain read the kernel refuses into guarded title memo… #552

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

@⁠pug205gti6 on GitHub · 2026-11-25 02:07 UTC · original
pug205gti6:pr/426-shaders-dxil-ir → main · +68 −0 · 1 files · 1 commits · open

…ry is copied through a buffer

A plain DirectStorage read (options 0, file source, address destination) lands through ReadFile into title memory. kernel_will_write opens the write guard's blocks first, but the GPU side's check can make a block read-only again before the read lands; ReadFile then fails with ERROR_INVALID_USER_BUFFER (0x800706f8), the request fails, and the title stops on its own breakpoint shortly after (int3 at +0x23d8f03 here: an allocator result checked for null).

On those two errors (and ERROR_NOACCESS), when the destination is committed and accessible, read into our own buffer and store the bytes with plain writes, which fault into the guard's handler like the title's own. Anything else keeps the kernel's error.

RTX 3070 Ti 8 GB, Ryzen 5 5600X, Windows 11, Series X profile: three cold starts (fresh shader cache) in a row ended on that breakpoint, each right after "dstorage: request failed: copying ... hr=0x800706f8"; with this change three runs on new builds (shaders translated afresh) reached the world; the fallback copied one refused read in two of them, the third had none.

**@⁠pug205gti6** on GitHub · 2026-11-25 02:07 UTC · [original](https://github.com/fxceless/victory-fork/pull/552) `pug205gti6:pr/426-shaders-dxil-ir` → `main` · +68 −0 · 1 files · 1 commits · open …ry is copied through a buffer A plain DirectStorage read (options 0, file source, address destination) lands through ReadFile into title memory. `kernel_will_write` opens the write guard's blocks first, but the GPU side's check can make a block read-only again before the read lands; ReadFile then fails with ERROR_INVALID_USER_BUFFER (0x800706f8), the request fails, and the title stops on its own breakpoint shortly after (int3 at +0x23d8f03 here: an allocator result checked for null). On those two errors (and ERROR_NOACCESS), when the destination is committed and accessible, read into our own buffer and store the bytes with plain writes, which fault into the guard's handler like the title's own. Anything else keeps the kernel's error. RTX 3070 Ti 8 GB, Ryzen 5 5600X, Windows 11, Series X profile: three cold starts (fresh shader cache) in a row ended on that breakpoint, each right after "dstorage: request failed: copying ... hr=0x800706f8"; with this change three runs on new builds (shaders translated afresh) reached the world; the fallback copied one refused read in two of them, the third had none.
A plain DirectStorage read (options 0, file source, address destination)
lands through ReadFile into title memory. `kernel_will_write` opens the
write guard's blocks first, but the GPU side's check can make a block
read-only again before the read lands; ReadFile then fails with
ERROR_INVALID_USER_BUFFER (0x800706f8), the request fails, and the title
stops on its own breakpoint shortly after (int3 at +0x23d8f03 here: an
allocator result checked for null).

On those two errors (and ERROR_NOACCESS), when the destination is
committed and accessible, read into our own buffer and store the bytes
with plain writes, which fault into the guard's handler like the title's
own. Anything else keeps the kernel's error.

RTX 3070 Ti 8 GB, Ryzen 5 5600X, Windows 11, Series X profile: three cold
starts (fresh shader cache) in a row ended on that breakpoint, each right
after "dstorage: request failed: copying ... hr=0x800706f8"; with this
change three runs on new builds (shaders translated afresh) reached the world;
the fallback copied one refused read in two of them, the third had none.

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

@⁠Headache3318 on GitHub · 2026-11-25 05:08 UTC · original

Independent verification: PR #552 merges cleanly onto main, 68 lines added to crates/victory-hle/src/modules/dstorage.rs. Build: success (7.97s). Tests: fail to compile on Linux due to pre-existing windows_sys issues in victory-loader and victory-gpu — confirmed on unmodified main. Addresses DirectStorage guarded memory read failure. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.

**@⁠Headache3318** on GitHub · 2026-11-25 05:08 UTC · [original](https://github.com/fxceless/victory-fork/pull/552#issuecomment-7153487632) Independent verification: PR #552 merges cleanly onto main, 68 lines added to crates/victory-hle/src/modules/dstorage.rs. Build: success (7.97s). Tests: fail to compile on Linux due to pre-existing windows_sys issues in victory-loader and victory-gpu — confirmed on unmodified main. Addresses DirectStorage guarded memory read failure. Machine: Arch Linux, kernel 7.3.5-arch1-1, 3x RTX 4090 driver 620.73.04, Proton, AI-assisted.
Author
Owner

@⁠Revens2 on GitHub · 2026-11-25 07:38 UTC · original

Duplicate of #426: @⁠YeokiNoewChi opened this patch 87 minutes earlier, and gh pr diff returns the same bytes for both (+68/-0 on 1 file(s), same title).

Both PRs are CONFLICTING, so this copy does not resolve the conflict it was probably made for.

Please continue in #426 so the review history and any test data stay in one place.
Thanks.

**@⁠Revens2** on GitHub · 2026-11-25 07:38 UTC · [original](https://github.com/fxceless/victory-fork/pull/552#issuecomment-7156084088) Duplicate of #426: @⁠YeokiNoewChi opened this patch 87 minutes earlier, and `gh pr diff` returns the same bytes for both (+68/-0 on 1 file(s), same title). Both PRs are CONFLICTING, so this copy does not resolve the conflict it was probably made for. Please continue in #426 so the review history and any test data stay in one place. Thanks.
This pull request has changes conflicting with the target branch.
  • crates/victory-hle/src/modules/dstorage.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/552/head:github-bot/gh-552'
git switch 'github-bot/gh-552'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-552'
git switch 'github-bot/gh-552'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-552'
git switch 'github-bot/gh-552'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-552'
git switch 'main'
git merge --squash 'github-bot/gh-552'
git switch 'main'
git merge --ff-only 'github-bot/gh-552'
git switch 'main'
git merge 'github-bot/gh-552'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.