fs, dstorage: a ReadFile into first-touch title memory commits the pages and reads again (RT-READFILE-NOACCESS) #555
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!555
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/555/head"
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?
@Tyrannys on GitHub · 2026-11-24 07:50 UTC · original
Tyrannys:fix/readfile-noaccess→main· +118 −1 · 3 files · 1 commits · merged 2026-11-24 09:26 UTCClaimed in #14 as
RT-READFILE-NOACCESS.What
xmemmaps the title's physical pages as views of a reserve-only section, and its vectored handler commits each page the first time user-mode code faults on it. A kernel write raises no such fault. So aReadFileinto a page nobody has touched yet fails withERROR_NOACCESS(998).Sleep(1)andReadFileagain forever. Seen by sampling the thread and reading its TEB last-error. The boot never gets past its first frame loop (one clear, one draw,PresentX).read_file_rangereads into the same memory. The request completes withE_DSTORAGE_ACCESS_VIOLATION, and the title stops on anint3.Fix
ReadFile. OnERROR_NOACCESSit reads one byte of every 4 KiB page of the destination from user mode (the handler commits them), then callsReadFileonce more. Other errors and the normal path are unchanged.dstorage.cpp'sread_file_rangedoes the same.Tested
file_system_test: new check on a reserve-only section view with a first-touch commit handler. The hostReadFilefails withERROR_NOACCESS; the shimmed one reads all 196,731 bytes, which match. 494 checks, 0 failures.dstorage_testpasses.mainplus the open boot PRs (#375–#432, #445, #360, #219, #461, #404; see #321). Without this change, the file reader loops at 998 forever. With it, that loop is gone, the DirectStorageint3is gone, and the title runs much further: about 190 slot-67 compute pipelines instead of about 40, and still running at 120 s. It is still not past the boot screen: the frames are still black. The DirectStorage half is checked only by that run; there's no unit test for it.AI-assisted (Claude Code).
🤖 Generated with Claude Code
@sodove on GitHub · 2026-11-24 08:18 UTC · original
Independent Windows 11 build 26100.7623 check of
779f901against main1c93c86, MSVC 19.44.35220 Release. The stock file_system and dstorage tests both passed on the PR.I also exercised the file-backed DirectStorage queue with a synthetic reserve-only view and a first-touch commit handler. The destination was unaligned and crossed three pages. Each request read from a nonzero file offset.
All three requests completed. The two failing main requests performed no user-mode page commits. Synthetic fixture only. No GPU required. AI-assisted verification.
@QemmHD on GitHub · 2026-11-24 09:26 UTC · original
Merging. Why merged: a ReadFile into first-touch title memory that fails with ERROR_NOACCESS (fs shim and DirectStorage reads) now touches the destination pages from user mode and retries once; every other error path is unchanged.
Why it's good: built with VS 2022 + Ninja on main
7430f59: file_system_test 490 checks / 1 failure (with the PR's test) -> 494 / 0 with the fix; dstorage_test passes; consistency 565/0. The DirectStorage half has no dedicated test yet.AI-assisted (Claude Code, Claude Opus 5.5).