Repository navigation
fs, dstorage: a ReadFile into first-touch title memory commits the pages and reads again (RT-READFILE-NOACCESS) - #555
Conversation
…ges and reads again (RT-READFILE-NOACCESS) xmem maps the title's physical pages as views of a reserve-only section and commits each page in a vectored handler when user-mode code first faults on it. A kernel write raises no such fault: ReadFile into a page nobody touched yet fails with ERROR_NOACCESS (998). The retail title's file reader treats any error but 6, 0x26 and 0x57 as transient and calls Sleep(1) and ReadFile again forever, so the boot never leaves its first frame loop; DirectStorage reads into the same memory came back as E_DSTORAGE_ACCESS_VIOLATION and the title stopped on an int3. The ReadFile import of the file shims, and DirectStorage's read_file_range, now read one byte of every page of the destination from user mode on ERROR_NOACCESS (the handler commits them) and read again once. file_system_test checks it on a reserve-only section with a first-touch handler: the host ReadFile fails with ERROR_NOACCESS, the shimmed one reads every byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows 11 build 26100.7623 check of 779f901 against main 1c93c86, 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. |
|
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. AI-assisted (Claude Code, Claude Opus 5.5). |
…h title memory commits the pages and reads again (RT-READFILE-NOACCESS)
Claimed 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 (d3d12_xs: the title's XMem hooks, console render-target sizes and resource leases, again (RT-XMEM-LEASE) #375–d3d12_xs: fence slot 12 returns the address of a live completed value, again; the retail boot reaches its frame loop (RT-FENCE12) #432, d3d12_xs: accept Xbox ID3D12GraphicsCommandListX IID in CreateCommandListX #445, d3d12_vulkan_device: accept the console's 0x40-byte D3D12_OPTIONS query (RT-XS-DEVICE-VM-OPTIONS) #360, d3d12_xs: route device slots 86, 101, and 108 to PC Device2/Device5/Device8 (reopens #7201) #219, xg_xs: lay out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER) #461, acphal: ACP message queue and background XMA ring decoding with the Rust XMA2 decoder (RT-ACPHAL-XMA2) #404; see [draft, integration] retail boot to the frame loop on current main (RT-BOOT-INTEGRATION) #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