Skip to content

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

Open
pug205gti6 wants to merge 1 commit into
fxceless:mainfrom
pug205gti6:pr/426-shaders-dxil-ir
Open

pug205gti6 wants to merge 1 commit into
fxceless:mainfrom
pug205gti6:pr/426-shaders-dxil-ir

Conversation

@pug205gti6

Copy link
Copy Markdown

…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.

…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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Headache3318

Copy link
Copy Markdown

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.

@Revens2

Revens2 commented Nov 25, 2026

Copy link
Copy Markdown

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.

KyleS98 added a commit to KyleS98/VIctory-Neo that referenced this pull request Nov 25, 2026
…torage: a plain read the kernel refuses into guarded title memo…

Upstream pull request 552, applied unchanged on c96b4f2 for this integration branch. All credit to its author.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants