HLE/dstorage: a plain read the kernel refuses into guarded title memory is copied through a buffer #426
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!426
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-426"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@YeokiNoewChi on GitHub · 2026-11-25 00:40 UTC · original
YeokiNoewChi:dstorage-guarded-read-fallback→main· +68 −0 · 1 files · 1 commits · openProblem
On cold starts (fresh shader cache) the title kept stopping on its own breakpoint during the world load:
0x80000003at+0x23d8f03, where it checks an allocator's result for null and traps. Each time, the log showed this a moment before:0x800706f8isERROR_INVALID_USER_BUFFER. A plain request (options 0: file source, address destination) is read withReadFilestraight into title memory.into_destinationcallskernel_will_writefirst, which opens the write guard's blocks. However, the GPU side's check can make a block read-only again (watch::protect) before the kernel's write lands. The kernel then refuses the read, the request fails, and the title's load fails with it.Change
dstorage.rsonly, plain copies only:ReadFilereturnsERROR_INVALID_USER_BUFFERorERROR_NOACCESSfor an address destination, and the whole destination is committed and notPAGE_NOACCESSor a guard page (VirtualQuery), the read goes into our own buffer instead. The bytes are then stored with plain writes, which fault into the guard's handler like the title's own writes and are noted written as usual.dstorage: a read the kernel refused into guarded title memory was copied through a bufferat the 1st, 2nd, 4th, 8th... occurrence.Tested
RTX 3070 Ti 8 GB, Ryzen 5 5600X (6 cores), 32 GB, Windows 11, Series X profile:
copyingrequest above.cargo test -p victory-hle dstorage: 14 passed.cargo clippy -p victory-hle -- -D warnings: clean.The race is more likely on machines where the GPU side's checks compete with the title for CPU, like this 6-core one during shader warm-up. That may be why it shows on some machines and not others.
Related, not overlapping: #329 (diagnostics for page-destination write failures) and #403 (DirectStorage file lifetime).
AI-assisted (Claude Code); counts, offsets and hashes only, nothing from the game.
🤖 Generated with Claude Code
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.Merge
Merge the changes and update on Forgejo.