Repository navigation
DirectStorage: read memory sources and lazy pages through read_own - #2359
safesearch77 wants to merge 1 commit into
Conversation
ReadProcessMemory is a kernel call and fails on uncommitted lazy physical pages (kernelx::lazy) instead of faulting into the vectored handler, unlike dstorage::writable which calls lazy::ensure first. Meanwhile, execute()'s virtual memory-source branch still checked gpu::shader::readable and copied with ptr::copy_nonoverlapping: lazy physical pages and copies above 256 MiB failed with E_ACCESS_VIOLATION (0x89240009), sources above 64 KiB walked regions with VirtualQuery, and a source decommitted while queued faulted in xcl-dstorage. Commit lazy physical pages in read_own before ReadProcessMemory (while preserving 0-byte and wrapping-range rejection) and route virtual memory-source reads through read_own. Assisted-by: Antigravity (Gemini 4 Carbon)
|
Tested commit Environment
Results
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Tested: current PR head merged onto current Not tested: retail titles (no title data on this lane, counts only). AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
bmjask
left a comment
There was a problem hiding this comment.
No concrete code defect found. The change safely commits lazy pages before kernel reads and replaces unsafe worker-thread raw copies with ReadProcessMemory. It is not merge-ready: the current head has no Windows build/test or required smoke-pair evidence, only a failed PR-description check. Please provide those, and consider coverage for multi-page lazy sources, a real >256 MiB source, and byte-integrity assertions during the decommit race.
|
Two contributors checked independently and found that #561 solves the same problem in a different way: #1607, group D115. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
dstorage::writableand the routedReadFilehook commit lazy physical pages (kernelx::lazy::ensure) first because kernel calls fail on uncommitted lazy reservations instead of faulting into the vectored handler, butdstorage::read_own(ReadProcessMemory) did not, andexecute()still read virtual memory sources withgpu::shader::readable+ptr::copy_nonoverlapping. As a result, page arrays or memory sources overlapping untouched lazy physical pages and copies above 256 MiB failed withE_ACCESS_VIOLATION(0x89240009), memory sources above 64 KiB walked regions withVirtualQuery, and a memory source decommitted while queued faulted in thexcl-dstorageworker (0xC0000005).What is in it
crates/xcl/src/hle/dstorage.rs:read_ownchecks for overflow (keeping 0-byte rejection unchanged) and commits lazy physical pages withkernelx::lazy::ensurebeforeReadProcessMemory;executereads virtual memory sources throughread_own.crates/xcl/src/hle/dstorage.rs(tests):a_memory_source_and_page_array_in_lazy_pages_commit_instead_of_failing(deterministic red->green test) anda_memory_source_unmapped_under_the_worker_fails_the_request(decommit/commit race stress test modeled on DirectStorage: a deferred page-array entry is reread without faulting (#476) #509).Tested
x86_64, base0829441, head94fae46) withcargo check --offline --target x86_64-pc-windows-gnu --workspace --tests: 0 errors, 0 warnings indstorage.rs.Not tested
cargo test --workspace -- --test-threads=4counts and pairedscripts/smoke.ps1regression runs are attached).ReadProcessMemory, AMD / Intel GPUs, retail titles.AI use
dstorage.rsfix, unit tests, and description; reviewed with Claude Opus 5.5.