Repository navigation
DirectStorage: resolve GPU-view addresses to their paired CPU view - #979
n-romanovich wants to merge 1 commit into
Conversation
|
Code/CI review only (not independently runtime-tested by me): clean merge and |
|
I tested
AI assistance by OpenAI Codex for the build, test and report. Model GPT-6.2-Sol (high). Visual follow-up: a later run rendered the full loading artwork. The earlier silhouette frames did not establish entry into the playable world. Focused retest: changing the debug-fill subcase to BC2 exercises the enqueue refusal on current main. With that test-only adjustment, the same |
|
Linux / AMD RDNA3 run: the new GPU-view/CPU-view pairing test fails deterministically under Wine. Merged state: head onto main (
Diagnosis lead, not a verdict: on this rig all D3D12.X heaps come through vkd3d-proton's translated/host-visible path rather than real device-memory aliasing, so "resolve GPU-view address to its paired CPU view" has different coherence semantics here than on native Windows or NVIDIA's d3d12-on-Wine lanes. Either the test assumes console-style paired views that vkd3d-proton can't provide (then it should gate like #983's atomics skip), or the pairing code returns a stale/duplicate CPU address on the translated path. Worth one isolated run on a Windows lane to split those two. Everything else dstorage-related is green in-lane (the batch's Counts only, no game data. Not tested: retail titles (none here), Windows, RDNA4. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
There was a problem hiding this comment.
Review of b8d21b0 against its merge base 077ce40, by reading the code; nothing was built or run here. The runtime change is small and I found no crash or memory-safety defect in it: the resolved address goes through the same writable / readable checks as before, so the worst case is still a refused request. The problems are in the test, which no longer passes on today's main.
- CONFIRMED: the new test fails once the PR is on current
main(crates/xcl/src/hle/dstorage.rs:2397-2409, request at:2404, assertion at:2408). The branch merges intomain47efa2ewithout a textual conflict, butmainnow unpacks BCPack BC7 (8cad517). ThereRequest::checkaccepts mode 7 (can_decode), so the request is no longer refused at enqueue; it runs, the decoder rejects the 16 bytes of zlib data as a BC7 stream, andexecutereturnsE_DECOMPRESSION. The solid fill is only done for anEntry::Refusedfrom enqueue, so the status assertion passes and the fill assertion fails. The Proton report in this thread already says this. In the merged file that assertion is line 2603, the panic line of the Linux/RDNA3 report, so that failure has the same cause: it is not a property of Wine or vkd3d-proton, and the test needs no Wine skip.main's own fill test moved to BC2 for the same reason. Fix: rebase and use a mode without a decoder (2 << BCPACK_SHIFT,bcpack_fill_block(2)) in subcase 2. The smoke block and the counts then need a rerun on the new head.
Also against CONTRIBUTING: subcase 3 is skipped silently when there is no unified memory (dstorage.rs:2413), so on the GPU-less CI the "page mapped in the GPU view" branch of mirror_address is not exercised and nothing prints SKIPPED; AI use names the tool and model but not what it did; Tested gives whole-suite counts only for --test-threads=1. The CI check has not run on this head yet (only PR description is green). The Regression run blocks are present, on the merge base and on this head, and the description says plainly that the 30 s run does not reach the changed code.
Verdict: not ready to merge as it stands; the runtime change looks safe, but the test must be rebased onto the BCPack decoder (finding 1).
Review by Claude Code (written by Claude Fable 5.2, checked and edited with Claude Opus 5.5); each point checked by a person before posting.
|
Independent verification — the PR's own new test fails standalone on its head Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Re-check on the updated head: re-merged So the failure survives the head move and now has three independent confirmations: this Wine/RADV rig, that Windows/NVIDIA rig, on both the old head and the post-main-merge head. It does not look rig-specific or Wine-specific anymore; the destination resolution reaching the queue looks fine on both reports, the decompression/fill step is where the stream dies. Counts only, no game data. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Test report for #979 at Setup
Results
Not tested
AI use
|
There was a problem hiding this comment.
Merged onto current main, the new test fails. That isn't Wine: main has gained BCPack decoding since this PR's base. The test passes at the PR's own head.
Tested (head b8d21b0; base 077ce40 is 49 commits behind main 930e8b4)
- AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5 (CachyOS)
- Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (
-Db_ndebug=true, dxil-spirv53aac418from #775), DXVK v3.1.1-209dxgi, DXC 1.9.2609.5, libopus 1.5.2,XCL_REQUIRE_GPU=wave64,mesh(0 SKIPPED) - cross-built for
x86_64-pc-windows-msvc(clang-cl / lld-link, xwin SDK 10.0.26100), Rust 1.99.1, debug - At
b8d21b0itself:hle::dstorage::tests::gpu_view_addresses_read_and_write_their_paired_cpu_viewpasses 2/2. - Merged onto
main930e8b4(no textual conflict): it fails 3/3 atdstorage.rs:2603, the fill check of step 2. The destination still holds the0xCDthe test wrote, and the log saysBCPack BC7 stream (decode): the stream ends early or is corrupt (packed=16, dst=32); the request fails with E_DECOMPRESSION. - Cause: since 8cad517 ("DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams"), a BC7 request is no longer refused at
EnqueueRequest. It is decoded and fails at execute time. Onmain,bcpack_fillonly runs forEntry::Refused, so step 2 never fills. - Using a mode
mainstill refuses, asmain's own fill test does with mode 2, makes it pass 3/3 on the merged tree, and all 15hle::dstoragetests pass:That holds only while mode 2 stays undecoded on- run(&request(SOURCE_MEMORY_BIT | 7 << BCPACK_SHIFT, fill_dst_gpu as u64, 32, gpu_src as u64, 0, 16), 1), + run(&request(SOURCE_MEMORY_BIT | 2 << BCPACK_SHIFT, fill_dst_gpu as u64, 32, gpu_src as u64, 0, 16), 1), ... - let block = bcpack_fill_block(7).unwrap(); + let block = bcpack_fill_block(2).unwrap();
main. A rebase ontomainwould show the failure in this PR's own CI. - The rest of the suite with the PR merged: 743 passed, 9 failed, 41 ignored (
main: 740 / 11 / 41, with the #718 flakes failing in that run). Apart from this test, nothing fails that passes onmain.
Not tested
- Anything that needs game files: no
XCL_SAMPLE_*was set, so the tests that read them (about 66) pass without running. - Windows. The cause doesn't depend on the platform, but I haven't run it there. A retail title.
AI use
- Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
Update: retested 8f7dc3a (rebased on main 4178e88; same RX 6700 XT / RADV 26.3.1 / Proton Experimental Wine; --test-threads=1, compared per test with main 4178e88 on the same build)
- With the PR merged: 878 passed, 14 failed, 42 ignored, against
main's 877 / 14 / 42. The extra pass is this PR's test, and no test fails here that passes onmain. Nohle::dstoragetest fails, andgpu_view_addresses_read_and_write_their_paired_cpu_viewpasses (the BC2 subcase included). The 14 are the Wine-lane setmainhas here. - Read
for_each_mirror_run/mirror_writable/write_virtual_destinationand theparallel.rschange. The page walk resolving each 64 KiB page throughmirrors::resolveand merging contiguous runs looks right to me. One leftover from the conflict resolution: the doc comment abovefor_each_mirror_runstarts "Where a virtual address in a GPU view (kernelx::mirrors) is read or written: its own" and then breaks off into "Walk[va, va + len)…". - Not tested: Windows; a title's DirectStorage traffic (no game data, no
XCL_SAMPLE_*).
b8d21b0 to
ce8acc5
Compare
|
Thanks for the reviews and test reports (@pvfreis, @SlopTart, @DavidM1911, @Filip722, @einfachama). Rebased onto
Verified on Windows 11 (RTX 5060 Ti):
@einfachama: thanks for tracing the Ready for re-review! |
|
Thanks. Checked at Reply by Claude Code (Claude Opus 5.5); checked by a person before posting. |
ce8acc5 to
8f7dc3a
Compare
|
I just rebased onto If |
|
@n-romanovich retested |
Empirical test report (8f7dc3a)PR #979, “DirectStorage: resolve GPU-view addresses to their paired CPU view,” at Hardware / environment
Commands and results
Observed behavior
Not tested The full GPU workspace suite and game smoke runs on main and the PR head were omitted. This run provides focused CPU fixture coverage. AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
A title that reserves paired 64 KiB CPU and GPU views (VirtualAlloc flags 0x20402000: PAGE_READWRITE, then PAGE_NOACCESS | PAGE_GRAPHICS_NOACCESS) maps physical pages into the CPU view while passing GPU-view virtual addresses as DirectStorage request destinations and memory sources. Without resolving those addresses through kernelx::mirrors, writable() and shader::readable() see reserved PAGE_NOACCESS memory and refuse the requests with E_ACCESS_VIOLATION (0x89240009). Resolve virtual destination and memory-source addresses through kernelx::mirrors::source when the GPU view has no page mapped of its own (physical_page_at or MEM_COMMIT), including in bcpack_fill. Assisted-by: Antigravity (Gemini 4 Carbon) Assisted-by: Antigravity (Claude Sonnet 5.5)
8f7dc3a to
b986487
Compare
|
Independent Windows check of b986487. I extended the PR’s fixture with one file-backed zlib write that crossed a 64 KiB boundary, from a GPU view backed by its paired CPU page into a GPU view with a directly mapped physical page. Tested
Not tested AI use |
…pstream PR xcl-dev#979) Cherry-picked from xcl-dev/xcl PR xcl-dev#979. Titles pass GPU-view virtual addresses as DirectStorage destinations/sources; without mirrors::source resolution, writable()/readable() see reserved PAGE_NOACCESS memory and refuse with E_ACCESS_VIOLATION (0x89240009) - the exact failures seen streaming ttdb terrain/vehicles/props. Applied cleanly.
A title that reserves paired 64 KiB CPU and GPU views (
VirtualAllocflags0x20402000:PAGE_READWRITE, thenPAGE_NOACCESS | PAGE_GRAPHICS_NOACCESS) maps physical pages into the CPU view while passing GPU-view virtual addresses as DirectStorage request destinations and memory sources. Without resolving those addresses throughkernelx::mirrors,writableandshader::readablesee reservedPAGE_NOACCESSmemory and refuse the requests withE_ACCESS_VIOLATION(0x89240009).Resolve virtual destination and memory-source addresses through
kernelx::mirrors::sourcewhen the GPU view has no page mapped of its own (physical_page_atorMEM_COMMIT), including inbcpack_fill.What is in it
crates/xcl/src/hle/kernelx.rs: addmirrors::overlaps_gpu_viewandmirrors::resolvefor GPU-view reservations without a page mapped of their own (physical_page_atorMEM_COMMIT).crates/xcl/src/hle/dstorage.rs: add per-64 KiB-pagefor_each_mirror_run/mirror_writable/write_virtual_destination/read_virtual_sourceso multi-page and mixed-view spans,execute(includingsnapshot_page_arrayand late zero-entry re-reads), andbcpack_fillresolve GPU-view addresses and re-check/write viaNtWriteVirtualMemory.crates/xcl/src/hle/dstorage/parallel.rs: route file-backed zlib parallel decompression checks and writes throughmirror_writableandwrite_virtual_destination.gpu_view_addresses_read_and_write_their_paired_cpu_view: tests zlib memory-source/destination mirror resolution,XCL_DSTORAGE_BCPACK_FILL(mode 2 / BC2), direct physical-page mappings + cross-page mixed-view reads (withrunner::skip_testif unavailable), and file-backed zlib viaparallel.rs.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.
cargo test -p xcl --lib dstorage -- --test-threads=4:30 passed; 0 failed; 0 ignoredcargo test --workspace -- --test-threads=4:892 passed; 0 failed; 42 ignoredSKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is required),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
Main (
4178e888c0b5be50a2887eda45cdb832763b68a4):PR (
8f7dc3a057001c698bc007ef8432ff40d0f9e39d):Not tested
vkd3d-proton).XCL_SAMPLE_*opt-in game-data corpus tests (unset duringcargo test).bcpack_fillare verified by the unit test.AI use