Repository navigation
Conversation
title_textures::read_committed checked VirtualQuery and then ran raw copy_nonoverlapping over the returned region. When a streaming thread concurrently unmapped or decommitted pages (e.g. MapTitlePhysicalPages / VirtualFree) mid-copy, xcl.exe faulted with 0xC0000005 in VCRUNTIME140.dll!memcpy. Use ReadProcessMemory on non-coherent regions and skip past any concurrently unreadable 4 KiB page (leaving it zeroed) instead of faulting. Add a unit test exercising holes and concurrent commit/decommit. Assisted-by: Antigravity (Gemini 4 Neon)
|
Tested RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, Pass: 677 passed, 0 failed, 41 ignored. SKIPPED: only the 2 Run and written with Claude Code (Claude Opus 5.5). |
|
Test report on AMD RDNA3: RX 7800 XT (16 GB, wave32 and wave64), driver 32.0.32015.7029, Ryzen 7 9800X3D, Windows 11 Pro 10.0.26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug build. No retail data was used. The PR's own runs are all on NVIDIA, so this adds an AMD GPU with 64-lane waves. Tested: the PR head
Not tested: a regression run on a title, a release build, the head merged onto current AI use: Claude Code ran the commands and drafted this comment; the runs are real runs on the hardware above. |
|
An RDNA4 run, next to the RDNA3 one above. The crash is fixed, but the page skip zeroes readable pages, and the new test catches that now and then: it failed 2 of 50 runs here. Tested:
Why. On this Windows build, when
One possible fix: when a read fails, copy that range one page at a time. Not tested: smoke or a retail title, a release build, whether a title ever reads the zeroed pages. AI use: Claude Code (Claude Opus 5.5) ran the tests and the local probes on my PC and wrote this comment. I have not reviewed the code; the measurements are from runs on my PC. Update:
Overlap with #484. Not tested: smoke or a retail title, a release build, the full suite on AI use: Claude Code (Claude Opus 5.5) ran the tests and the control on my PC and wrote this update. I have not reviewed the code. |
When ReadProcessMemory crosses an unreadable hole after VirtualQuery, Windows can return ERROR_PARTIAL_COPY with read == 0. Advancing by a page from cur + read skipped readable leading pages and left them zero. Retry the uncopied remainder one page at a time so every readable page before and after a hole is preserved, and cover fixed holes (aligned and unaligned) directly in the unit test. Assisted-by: Antigravity (Gemini 4 Neon)
|
Thanks @4usphs for catching that! Fixed in 1b02162: when ReadProcessMemory fails with ERROR_PARTIAL_COPY, copy_readable_range now advances past any confirmed bytes and retries the remainder one 4 KiB page at a time so readable leading pages before a hole are preserved even when Windows returns |
|
Retested the new head
Run and written with Claude Code (Claude Opus 5.5). |
|
Closing as a duplicate of #484, which has already been merged into |
What is in it
std::ptr::copy_nonoverlappinginhle::d3d12x::title_textures::read_committedwithcopy_readable_rangebacked byReadProcessMemoryon the current process so concurrent physical page decommits / unmaps betweenVirtualQueryand the copy leave unmapped pages zeroed instead of raisingSTATUS_ACCESS_VIOLATION(0xC0000005).ReadProcessMemorypartial failure (ERROR_PARTIAL_COPY), advance past any confirmed bytes and retry the remainder one 4 KiB page at a time so readable leading pages before a hole are preserved even when Windows reportsread == 0.read_committed'sVirtualQueryloop (saturating_addandend <= pcheck).read_committed_skips_unmapped_holes_and_survives_concurrent_decommitcovering non-page-aligned holes, directcopy_readable_rangeover fixed holes at aligned and unaligned offsets, and a 1,000-iteration concurrent commit/decommit stress loop.Tested
32.0.16.1714, wave32-only), DXC1.9.2609.5.cargo test -p xcl --lib read_committed_skips_unmapped_holes_and_survives_concurrent_decommit: 11/11 consecutive runs passed (1,000 concurrent iterations each + fixed-hole assertions at+0,+0x7b,+0x104d).cargo test -p xcl --lib title_textures: 8 passed, 0 failed.cargo test --workspace -- --test-threads=4(lib, on base2018c67): 636 passed, 1 failed (hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory, pre-existing failure in this environment; confirmed passing on RDNA3/Blackwell by reviewers), 21 ignored; 2 GPU tests reportedSKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64andgpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64.cargo test --workspace --test "*" -- --test-threads=4: 40 passed, 0 failed across all 12 integration test binaries.Regression run
Not tested
hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memoryfailed in this environment (unrelated to this PR).AI use