DirectStorage: resolve GPU-view addresses to their paired CPU view #979

Open
github-bot wants to merge 1 commit from github-bot/gh-979 into main AGit
Owner

@⁠n-romanovich on GitHub · 2026-11-24 09:50 UTC · original
n-romanovich:dstorage/gpu-view-mirrors → main · +327 −33 · 3 files · 1 commits · open

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.

What is in it

  • crates/xcl/src/hle/kernelx.rs: add mirrors::overlaps_gpu_view and mirrors::resolve for GPU-view reservations without a page mapped of their own (physical_page_at or MEM_COMMIT).
  • crates/xcl/src/hle/dstorage.rs: add per-64 KiB-page for_each_mirror_run / mirror_writable / write_virtual_destination / read_virtual_source so multi-page and mixed-view spans, execute (including snapshot_page_array and late zero-entry re-reads), and bcpack_fill resolve GPU-view addresses and re-check/write via NtWriteVirtualMemory.
  • crates/xcl/src/hle/dstorage/parallel.rs: route file-backed zlib parallel decompression checks and writes through mirror_writable and write_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 (with runner::skip_test if unavailable), and file-backed zlib via parallel.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 ignored
  • cargo test --workspace -- --test-threads=4: 892 passed; 0 failed; 42 ignored
    • SKIPPED: 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 (5478c4a7c1ae5adba127c8d27018d7fdbf3a8725):

xcl-smoke v1
commit: 5478c4a7c1ae5adba127c8d27018d7fdbf3a8725
gpu: NVIDIA GeForce RTX 5060 Ti
title: FILES
seconds: 60
exit: 0x0
frames shown: 1541 (PresentX 1541)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15701 MB

PR (063c281f879e53fb081fc335fcaaefd573f30d28):

xcl-smoke v1
commit: 063c281f879e53fb081fc335fcaaefd573f30d28
gpu: NVIDIA GeForce RTX 5060 Ti
title: FILES
seconds: 60
exit: 0x0
frames shown: 1532 (PresentX 1532)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14704 MB

Not tested

  • macOS / Linux (crate targets Windows only).
  • AMD / wave64-capable GPU.

AI use

  • Antigravity (model name not provided): implemented the fix and unit tests, ran the test suite and smoke.ps1 runs.
**@⁠n-romanovich** on GitHub · 2026-11-24 09:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/979) `n-romanovich:dstorage/gpu-view-mirrors` → `main` · +327 −33 · 3 files · 1 commits · open 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`. **What is in it** - `crates/xcl/src/hle/kernelx.rs`: add `mirrors::overlaps_gpu_view` and `mirrors::resolve` for GPU-view reservations without a page mapped of their own (`physical_page_at` or `MEM_COMMIT`). - `crates/xcl/src/hle/dstorage.rs`: add per-64 KiB-page `for_each_mirror_run` / `mirror_writable` / `write_virtual_destination` / `read_virtual_source` so multi-page and mixed-view spans, `execute` (including `snapshot_page_array` and late zero-entry re-reads), and `bcpack_fill` resolve GPU-view addresses and re-check/write via `NtWriteVirtualMemory`. - `crates/xcl/src/hle/dstorage/parallel.rs`: route file-backed zlib parallel decompression checks and writes through `mirror_writable` and `write_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 (with `runner::skip_test` if unavailable), and file-backed zlib via `parallel.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 ignored` - `cargo test --workspace -- --test-threads=4`: `892 passed; 0 failed; 42 ignored` - - `SKIPPED`: `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 (`5478c4a7c1ae5adba127c8d27018d7fdbf3a8725`): ``` xcl-smoke v1 commit: 5478c4a7c1ae5adba127c8d27018d7fdbf3a8725 gpu: NVIDIA GeForce RTX 5060 Ti title: FILES seconds: 60 exit: 0x0 frames shown: 1541 (PresentX 1541) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15701 MB ``` PR (`063c281f879e53fb081fc335fcaaefd573f30d28`): ``` xcl-smoke v1 commit: 063c281f879e53fb081fc335fcaaefd573f30d28 gpu: NVIDIA GeForce RTX 5060 Ti title: FILES seconds: 60 exit: 0x0 frames shown: 1532 (PresentX 1532) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14704 MB ``` **Not tested** - macOS / Linux (crate targets Windows only). - AMD / wave64-capable GPU. **AI use** - Antigravity (model name not provided): implemented the fix and unit tests, ran the test suite and `smoke.ps1` runs.
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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:38:58 +00:00
Author
Owner

@⁠raylitebull on GitHub · 2026-11-24 10:40 UTC · original

Code/CI review only (not independently runtime-tested by me): clean merge and PR description green (just awaiting CI workflow approval). Cleanly resolves DirectStorage GPU-view addresses to their paired CPU view. Recommend approving CI and merging, @⁠ivall.

**@⁠raylitebull** on GitHub · 2026-11-24 10:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7129094356) Code/CI review only (not independently runtime-tested by me): clean merge and `PR description` green (just awaiting CI workflow approval). Cleanly resolves DirectStorage GPU-view addresses to their paired CPU view. Recommend approving CI and merging, @⁠ivall.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-24 11:22 UTC · original · edited 2026-11-24 11:46 UTC

I tested b8d21b0 on XCL main 47efa2e plus #640, #793 and #820, using an RTX 5060 Laptop GPU (8 GB, driver 615.78.08) on Bazzite 44 with Proton Experimental 11.0-20261112, the vkd3d-proton 4522cc1 compatibility build from #257 and the #775 dxil-spirv pin.

  • Windows MSVC release build under Proton, hle::dstorage::tests --test-threads=1 (15 tests). Fourteen passed. gpu_view_addresses_read_and_write_their_paired_cpu_view passed the zlib source/destination checks and failed at the BC7 debug-fill assertion. On this main, that BC7 request reaches the decoder, which rejects the malformed stream with E_DECOMPRESSION. The solid-fill branch runs on an enqueue refusal.
  • Offline Series X run with XCL_COHERENT_MB=512, XCL_PAGE_BUDGET_MB=2048, XCL_PSO_WAIT_MS=50 and XCL_BIG_COMPILES=1. Both builds showed unlit silhouettes during loading and exited after a vkAllocateMemory access violation. The run with this PR recorded zero storage failures through 39,196 executed requests. The comparison recorded 44 failures (0x89240009 first on a file request) by 45,904 requests and crashed after 59,883 sampled requests. The patched run ended before it reached a comparable request count, so the retail result is inconclusive for this fix.

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 hle::dstorage::tests --test-threads=1 suite reported 15 passed and 0 failed under Proton.

**@⁠Filip722** on GitHub · 2026-11-24 11:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7130009368) · edited 2026-11-24 11:46 UTC I tested `b8d21b0` on XCL main `47efa2e` plus #640, #793 and #820, using an RTX 5060 Laptop GPU (8 GB, driver 615.78.08) on Bazzite 44 with Proton Experimental `11.0-20261112`, the vkd3d-proton `4522cc1` compatibility build from #257 and the #775 dxil-spirv pin. - Windows MSVC release build under Proton, `hle::dstorage::tests --test-threads=1` (15 tests). Fourteen passed. `gpu_view_addresses_read_and_write_their_paired_cpu_view` passed the zlib source/destination checks and failed at the BC7 debug-fill assertion. On this main, that BC7 request reaches the decoder, which rejects the malformed stream with `E_DECOMPRESSION`. The solid-fill branch runs on an enqueue refusal. - Offline Series X run with `XCL_COHERENT_MB=512`, `XCL_PAGE_BUDGET_MB=2048`, `XCL_PSO_WAIT_MS=50` and `XCL_BIG_COMPILES=1`. Both builds showed unlit silhouettes during loading and exited after a `vkAllocateMemory` access violation. The run with this PR recorded zero storage failures through 39,196 executed requests. The comparison recorded 44 failures (`0x89240009` first on a file request) by 45,904 requests and crashed after 59,883 sampled requests. The patched run ended before it reached a comparable request count, so the retail result is inconclusive for this fix. 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 `hle::dstorage::tests --test-threads=1` suite reported 15 passed and 0 failed under Proton.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 11:55 UTC · original

Linux / AMD RDNA3 run: the new GPU-view/CPU-view pairing test fails deterministically under Wine.

Merged state: head onto main (a027808 lane merge), clean merge, full suite 729 passed / 13 failed / 41 ignored: the known Wine-lane set from #42, this rig's mirror flake, and the xapu_connect_returns_oom... flake from my #943 footnote. The one that does not clear in isolation:

  • hle::dstorage::tests::gpu_view_addresses_read_and_write_their_paired_cpu_view - fails 2/2 isolated, panic at crates/xcl/src/hle/dstorage.rs:2603: after filling through the GPU view, the paired CPU view's 16-byte chunks don't match the source block (slice::from_raw_parts(fill_dst_cpu...).chunks(16).all(...) is false).

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 multi_stage... and requests_are_checked... tests included).

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 x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 11:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7130726294) Linux / AMD RDNA3 run: the new GPU-view/CPU-view pairing test fails deterministically under Wine. **Merged state:** head onto main (`a027808` lane merge), clean merge, full suite 729 passed / 13 failed / 41 ignored: the known Wine-lane set from #42, this rig's mirror flake, and the `xapu_connect_returns_oom...` flake from my #943 footnote. The one that does **not** clear in isolation: - `hle::dstorage::tests::gpu_view_addresses_read_and_write_their_paired_cpu_view` - fails 2/2 isolated, panic at `crates/xcl/src/hle/dstorage.rs:2603`: after filling through the GPU view, the paired CPU view's 16-byte chunks don't match the source block (`slice::from_raw_parts(fill_dst_cpu...).chunks(16).all(...)` is false). 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 `multi_stage...` and `requests_are_checked...` tests included). 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 `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 12:27 UTC · original

Independent verification — the PR's own new test fails standalone on its head b480ae7 (which already contains a main merge), and identically after merging current main 384f7f7 locally.

Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.

  • cargo test -p xcl --lib dstorage: 14 passed, 1 failed — gpu_view_addresses_read_and_write_their_paired_cpu_view.
  • Failure detail: the test's BCPack BC7 fill request fails with E_DECOMPRESSION (packed=16, dst=32 — "the stream ends early or is corrupt"), so fill_dst_cpu never receives the expected block and the chunks(16) == block assertion at dstorage.rs:2603 fails. The paired GPU→CPU view resolution itself looks right (the request reaches the queue with the resolved destination); the fixture stream appears too short for the destination size, or the test needs the bcpack decode path to accept it.

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

**@⁠DavidM1911** on GitHub · 2026-11-24 12:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7131466854) Independent verification — the PR's own new test **fails standalone** on its head `b480ae7` (which already contains a `main` merge), and identically after merging current `main` `384f7f7` locally. **Machine:** Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug. - `cargo test -p xcl --lib dstorage`: 14 passed, **1 failed** — `gpu_view_addresses_read_and_write_their_paired_cpu_view`. - Failure detail: the test's BCPack BC7 fill request fails with `E_DECOMPRESSION` (`packed=16, dst=32` — "the stream ends early or is corrupt"), so `fill_dst_cpu` never receives the expected block and the `chunks(16) == block` assertion at `dstorage.rs:2603` fails. The paired GPU→CPU view resolution itself looks right (the request reaches the queue with the resolved destination); the fixture stream appears too short for the destination size, or the test needs the `bcpack` decode path to accept it. AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 12:44 UTC · original

Re-check on the updated head: re-merged b8d21b0 onto current main (lane merge 568cb1a) and gpu_view_addresses_read_and_write_their_paired_cpu_view still fails, same panic site dstorage.rs:2603 (chunks(16) comparison against the expected BC7 block), same as my comment above and same as the Windows reproduction from DavidM1911 (E_DECOMPRESSION on the BCPack fill, packed=16, dst=32).

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 x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 12:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7131855807) Re-check on the updated head: re-merged `b8d21b0` onto current main (lane merge `568cb1a`) and `gpu_view_addresses_read_and_write_their_paired_cpu_view` still fails, same panic site `dstorage.rs:2603` (`chunks(16)` comparison against the expected BC7 block), same as my comment above and same as the Windows reproduction from DavidM1911 (`E_DECOMPRESSION` on the BCPack fill, `packed=16, dst=32`). 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 `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠einfachama on GitHub · 2026-11-24 14:49 UTC · original

Test report for #979 at b8d21b0, merged locally onto main 47efa2e (no conflicts), on my retail title's world load. Short version: on this title, #979 doesn't change the 0x89240009 failures. They come in both builds, at the same time in the load, from the same package files and in about the same numbers.

Setup

  • NVIDIA GeForce RTX 4060 8 GB (driver 621.24), Ryzen 7 5800X, 32 GB RAM, commit limit 63.9 GB, Windows 11 Pro 26300, Rust 1.100.0, release builds (cargo build --release -p xcl).
  • Builds: main 47efa2e; main + #979 (b8d21b0 merged locally).
  • Runs: my retail title, XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_RUN_SECONDS=100, A pressed at 26 s and 30 s. The title then starts its world load by itself at about 66 s.
  • 8 runs, alternating main / #979 / #979 / main / main / #979 / #979 / main, with the same shader caches.
  • Failed requests are the sum of the DirectStorage … failed counts in the XCL_ACTIVITY 2 s lines.

Results

run build failed requests first failure exit peak commit
1 main 44 70.2 s 0x0 26 886 MB
2 #979 70 70.3 s 0x887a0006 at 83.5 s 24 946 MB
3 #979 249 75.0 s 0x0 27 750 MB
4 main 754 73.5 s 0x0 27 830 MB
5 main 17 68.9 s 0x0 27 956 MB
6 #979 104 66.9 s 0x0 28 407 MB
7 #979 4 054 70.6 s 0x0 28 013 MB
8 main 346 68.1 s 0x0 28 345 MB
  • The same failures in both builds. Every run has some: main 17–754 (median 195), #979 70–4 054 (median 177). All of them are 0x89240009, on file-source reads from the title's package files, in one or two 2 s bursts 1–9 s into the world load.
  • The spread inside each build is larger than any difference between them. I see no effect of #979 on this title.
  • What the failing requests are: I ran main + #816 (2ffb5a4) twice with XCL_DSTORAGE_FAILURE_DETAILS=1. All 10 records it wrote are submit=HalfFull stage=DestinationPages destination=pages, and the destination page array still has its one entry at 0, also on the late reread (dst-snapshot=[1 total/1 zero] … late-reread=Read). These destinations are physical-page arrays, not virtual GPU-view addresses, so #979's change doesn't reach them. That matches what #549 describes. Those records come from main + #816 runs, not from #979 runs, so I'm inferring that #979's failures are the same kind from their code, timing and files.
  • Device hang in run 2: 0x887a0006 (device hung) at 83.5 s, while presents were coming back after the load. In the same session, 1 of 2 main + #816 runs also hung, at 65.3 s. None of the 6 main runs hung (the 4 above and 2 later controls), and neither did 4 main + #549 runs. With 2 hangs in 16 runs, spread over two different PRs, I can't attribute it to #979.
  • For comparison, #549 (1870880, merged locally), in the same session and with the same settings: 0 failed requests in 4 of 4 runs. Its 2 interleaved main controls had 7 and 1 009.
  • Apart from run 2's device-removal lines: no crash lines and no E_OUTOFMEMORY. In every run of both builds, the only WARN kind that first shows up after the load starts is the a request failed line. Commit and video memory are the same within the noise: peak commit 26.9–28.4 GB at 96–98 s.

Not tested

  • Whether #979 fixes requests that really target GPU-view addresses in another title, or later in this one: none of the requests I can classify here are of that kind.
  • Past 100 s, AMD, other titles. The unit test (gpu_view_addresses_read_and_write_their_paired_cpu_view) and cargo test --workspace were not run on this merge.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and runs, counted the results from the logs and wrote this report; I checked it before posting.
**@⁠einfachama** on GitHub · 2026-11-24 14:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7135013644) Test report for #979 at `b8d21b0`, merged locally onto `main` `47efa2e` (no conflicts), on my retail title's world load. Short version: on this title, #979 doesn't change the `0x89240009` failures. They come in both builds, at the same time in the load, from the same package files and in about the same numbers. **Setup** - NVIDIA GeForce RTX 4060 8 GB (driver 621.24), Ryzen 7 5800X, 32 GB RAM, commit limit 63.9 GB, Windows 11 Pro 26300, Rust 1.100.0, release builds (`cargo build --release -p xcl`). - Builds: `main` `47efa2e`; `main` + #979 (`b8d21b0` merged locally). - Runs: my retail title, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, `XCL_RUN_SECONDS=100`, A pressed at 26 s and 30 s. The title then starts its world load by itself at about 66 s. - 8 runs, alternating `main` / #979 / #979 / `main` / `main` / #979 / #979 / `main`, with the same shader caches. - Failed requests are the sum of the `DirectStorage … failed` counts in the `XCL_ACTIVITY` 2 s lines. **Results** | run | build | failed requests | first failure | exit | peak commit | |---|---|---:|---:|---|---:| | 1 | `main` | 44 | 70.2 s | 0x0 | 26 886 MB | | 2 | #979 | 70 | 70.3 s | `0x887a0006` at 83.5 s | 24 946 MB | | 3 | #979 | 249 | 75.0 s | 0x0 | 27 750 MB | | 4 | `main` | 754 | 73.5 s | 0x0 | 27 830 MB | | 5 | `main` | 17 | 68.9 s | 0x0 | 27 956 MB | | 6 | #979 | 104 | 66.9 s | 0x0 | 28 407 MB | | 7 | #979 | 4 054 | 70.6 s | 0x0 | 28 013 MB | | 8 | `main` | 346 | 68.1 s | 0x0 | 28 345 MB | - **The same failures in both builds.** Every run has some: `main` 17–754 (median 195), #979 70–4 054 (median 177). All of them are `0x89240009`, on file-source reads from the title's package files, in one or two 2 s bursts 1–9 s into the world load. - **The spread inside each build is larger than any difference between them.** I see no effect of #979 on this title. - **What the failing requests are:** I ran `main` + #816 (`2ffb5a4`) twice with `XCL_DSTORAGE_FAILURE_DETAILS=1`. All 10 records it wrote are `submit=HalfFull stage=DestinationPages destination=pages`, and the destination page array still has its one entry at 0, also on the late reread (`dst-snapshot=[1 total/1 zero] … late-reread=Read`). These destinations are physical-page arrays, not virtual GPU-view addresses, so #979's change doesn't reach them. That matches what #549 describes. Those records come from `main` + #816 runs, not from #979 runs, so I'm inferring that #979's failures are the same kind from their code, timing and files. - **Device hang in run 2:** `0x887a0006` (device hung) at 83.5 s, while presents were coming back after the load. In the same session, 1 of 2 `main` + #816 runs also hung, at 65.3 s. None of the 6 `main` runs hung (the 4 above and 2 later controls), and neither did 4 `main` + #549 runs. With 2 hangs in 16 runs, spread over two different PRs, I can't attribute it to #979. - **For comparison, #549** (`1870880`, merged locally), in the same session and with the same settings: **0 failed requests in 4 of 4 runs**. Its 2 interleaved `main` controls had 7 and 1 009. - Apart from run 2's device-removal lines: no crash lines and no `E_OUTOFMEMORY`. In every run of both builds, the only WARN kind that first shows up after the load starts is the `a request failed` line. Commit and video memory are the same within the noise: peak commit 26.9–28.4 GB at 96–98 s. **Not tested** - Whether #979 fixes requests that really target GPU-view addresses in another title, or later in this one: none of the requests I can classify here are of that kind. - Past 100 s, AMD, other titles. The unit test (`gpu_view_addresses_read_and_write_their_paired_cpu_view`) and `cargo test --workspace` were not run on this merge. **AI use** - Claude Code (Claude Opus 5.5) ran the builds and runs, counted the results from the logs and wrote this report; I checked it before posting.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-24 18:04 UTC · original

Thanks for the reviews and test reports (@⁠pvfreis, @⁠SlopTart, @⁠DavidM1911, @⁠Filip722, @⁠einfachama).

Rebased onto main (9e3831e) and updated the PR:

  1. BCPack BC7 → BC2 in subcase 2: Switched gpu_view_addresses_read_and_write_their_paired_cpu_view subcase 2 from mode 7 (now decoded on main since 8cad517) to mode 2 (BC2, with assert!(!crate::hle::bcpack::can_decode(2))), so bcpack_fill exercises the enqueue-refusal path as intended.
  2. skip_test for subcase 3: Added crate::gpu::recomp::runner::skip_test(...) when unified memory or title physical pages are unavailable instead of silently skipping.
  3. Parallel mirror-size isolation: Changed the test's fallback reservation size from 24 GiB to 26 GiB + 64 KiB so it does not collide in global kernelx::mirrors with title_textures tests under --test-threads=4.

Verified on Windows 11 (RTX 5060 Ti):

  • Fails without mirror_address (0x89240009), passes with it (dstorage::tests: 18 passed, 0 failed).
  • cargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignored (3 consecutive runs).
  • Updated both xcl-smoke blocks in the PR description for 9e3831e and ce8acc5.

@⁠einfachama: thanks for tracing the 0x89240009 burst in your run — indeed, DestinationPages zero-entry arrays are separate from virtual GPU-view addresses (handled by #549).

Ready for re-review!

**@⁠n-romanovich** on GitHub · 2026-11-24 18:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7140108476) Thanks for the reviews and test reports (@⁠pvfreis, @⁠SlopTart, @⁠DavidM1911, @⁠Filip722, @⁠einfachama). Rebased onto `main` (`9e3831e`) and updated the PR: 1. **BCPack BC7 → BC2 in subcase 2:** Switched `gpu_view_addresses_read_and_write_their_paired_cpu_view` subcase 2 from mode 7 (now decoded on `main` since `8cad517`) to mode 2 (`BC2`, with `assert!(!crate::hle::bcpack::can_decode(2))`), so `bcpack_fill` exercises the enqueue-refusal path as intended. 2. **`skip_test` for subcase 3:** Added `crate::gpu::recomp::runner::skip_test(...)` when unified memory or title physical pages are unavailable instead of silently skipping. 3. **Parallel mirror-size isolation:** Changed the test's fallback reservation size from `24 GiB` to `26 GiB + 64 KiB` so it does not collide in global `kernelx::mirrors` with `title_textures` tests under `--test-threads=4`. Verified on Windows 11 (RTX 5060 Ti): - Fails without `mirror_address` (`0x89240009`), passes with it (`dstorage::tests`: 18 passed, 0 failed). - `cargo test --workspace -- --test-threads=4`: 777 passed, 0 failed, 41 ignored (3 consecutive runs). - Updated both `xcl-smoke` blocks in the PR description for `9e3831e` and `ce8acc5`. @⁠einfachama: thanks for tracing the `0x89240009` burst in your run — indeed, `DestinationPages` zero-entry arrays are separate from virtual GPU-view addresses (handled by `#549`). Ready for re-review!
Author
Owner

@⁠pvfreis on GitHub · 2026-11-24 18:19 UTC · original

Thanks. Checked at ce8acc5 (read in full): the BCPack subcase uses mode 2 and asserts can_decode(2) is false, and the two skips print. On an RTX 3060, merged onto main 9e3831e (clean), cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4: 776 passed, 1 failed, 41 ignored (main: 775 / 1 / 41). The one added test is gpu_view_addresses_read_and_write_their_paired_cpu_view, which passes; the one failure is the e2e test, which fails the same way on main here (no display in this session). SKIPPED: the two wave64 tests and heap_window_out_of_memory_falls_back_to_the_switch_form. Finding 1 of the review is fixed. Not tested: AMD, a retail title.

Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.

**@⁠pvfreis** on GitHub · 2026-11-24 18:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7140490304) Thanks. Checked at `ce8acc5` (read in full): the BCPack subcase uses mode 2 and asserts `can_decode(2)` is false, and the two skips print. On an RTX 3060, merged onto `main` `9e3831e` (clean), `cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4`: 776 passed, 1 failed, 41 ignored (`main`: 775 / 1 / 41). The one added test is `gpu_view_addresses_read_and_write_their_paired_cpu_view`, which passes; the one failure is the e2e test, which fails the same way on `main` here (no display in this session). SKIPPED: the two wave64 tests and `heap_window_out_of_memory_falls_back_to_the_switch_form`. Finding 1 of the review is fixed. Not tested: AMD, a retail title. Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.
Author
Owner

@⁠crastinator on GitHub · 2026-11-24 20:59 UTC · original

@⁠n-romanovich retested 8f7dc3a under Wine on RDNA2. No regression against main 4178e88, and the new test passes. Details are in my review above (edited), with one leftover doc line from the conflict resolution. I can't merge (I'm not a maintainer), so that's up to the maintainer's batch.

**@⁠crastinator** on GitHub · 2026-11-24 20:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7144339019) @⁠n-romanovich retested `8f7dc3a` under Wine on RDNA2. No regression against `main` `4178e88`, and the new test passes. Details are in my review above (edited), with one leftover doc line from the conflict resolution. I can't merge (I'm not a maintainer), so that's up to the maintainer's batch.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-24 20:45 UTC · original · edited 2026-11-24 21:08 UTC

I just rebased onto main (4178e88) after #819 landed (and wired parallel.rs + multi-page mixed-view handling into 8f7dc3a while resolving the conflict). Since dstorage.rs is getting heavy traffic right now, keeping this open much longer will likely force another rebase and re-review cycle for all of us.

If 8f7dc3a looks good, ready for a quick approval/merge while the branch is clean so I can move on to the next DirectStorage issues.

**@⁠n-romanovich** on GitHub · 2026-11-24 20:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7144012650) · edited 2026-11-24 21:08 UTC I just rebased onto `main` (`4178e88`) after `#819` landed (and wired `parallel.rs` + multi-page mixed-view handling into `8f7dc3a` while resolving the conflict). Since `dstorage.rs` is getting heavy traffic right now, keeping this open much longer will likely force another rebase and re-review cycle for all of us. If `8f7dc3a` looks good, ready for a quick approval/merge while the branch is clean so I can move on to the next DirectStorage issues.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 05:38 UTC · original

Empirical test report (8f7dc3a0)

PR #979, “DirectStorage: resolve GPU-view addresses to their paired CPU view,” at 8f7dc3a057001c698bc007ef8432ff40d0f9e39d.

Hardware / environment

  • Windows x64 build 26200, AMD64 Family 23 Model 113 Stepping 0, 12 logical processors.
  • Unoptimized Cargo test profile with debug info and incremental compilation disabled. The fixture exercises Windows virtual memory and emulated title pages on the CPU. It creates no D3D12 device.
  • rustc 1.100.0 (0ef1bc386 2026-11-09). DXC reports 1.9.2609.5 (01b62ad47).

Commands and results

  • cargo test --workspace --no-run built the workspace test executables and exited 0.
  • cargo test -p xcl --lib hle::dstorage::tests::gpu_view_addresses_read_and_write_their_paired_cpu_view -- --exact ran with XCL_ADAPTER=NONE_CPU_ONLY, RUST_TEST_NOCAPTURE=1, and XCL_DSTORAGE_PARALLEL_DECOMPRESS=1. It exited 0 with 1 passed, 0 failed, 0 ignored, 0 SKIPPED lines, and 864 filtered out. Both commands ran outside the Arc test wrapper.

Observed behavior

  • Memory-source zlib read through the GPU-view source and wrote the decoded bytes through the paired CPU destination. The trailing sentinel bytes held.
  • The unsupported BC2 request returned the expected E_DECOMPRESSION (0x89240030) and wrote the fallback blocks through the paired CPU view.
  • A title page mapped directly in the GPU view received the write. The paired CPU page kept its sentinel. A read across the 64 KiB boundary combined the paired CPU page and the directly mapped page.
  • With parallel decompression enabled, file-backed zlib wrote the decoded payload through the paired CPU view and preserved the trailing sentinel bytes.

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 pr979-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 05:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7153990568) ### Empirical test report (8f7dc3a0) PR #979, “DirectStorage: resolve GPU-view addresses to their paired CPU view,” at `8f7dc3a057001c698bc007ef8432ff40d0f9e39d`. **Hardware / environment** - Windows x64 build 26200, AMD64 Family 23 Model 113 Stepping 0, 12 logical processors. - Unoptimized Cargo test profile with debug info and incremental compilation disabled. The fixture exercises Windows virtual memory and emulated title pages on the CPU. It creates no D3D12 device. - `rustc 1.100.0 (0ef1bc386 2026-11-09)`. DXC reports `1.9.2609.5 (01b62ad47)`. **Commands and results** - `cargo test --workspace --no-run` built the workspace test executables and exited 0. - `cargo test -p xcl --lib hle::dstorage::tests::gpu_view_addresses_read_and_write_their_paired_cpu_view -- --exact` ran with `XCL_ADAPTER=NONE_CPU_ONLY`, `RUST_TEST_NOCAPTURE=1`, and `XCL_DSTORAGE_PARALLEL_DECOMPRESS=1`. It exited 0 with 1 passed, 0 failed, 0 ignored, 0 `SKIPPED` lines, and 864 filtered out. Both commands ran outside the Arc test wrapper. **Observed behavior** - Memory-source zlib read through the GPU-view source and wrote the decoded bytes through the paired CPU destination. The trailing sentinel bytes held. - The unsupported BC2 request returned the expected `E_DECOMPRESSION` (`0x89240030`) and wrote the fallback blocks through the paired CPU view. - A title page mapped directly in the GPU view received the write. The paired CPU page kept its sentinel. A read across the 64 KiB boundary combined the paired CPU page and the directly mapped page. - With parallel decompression enabled, file-backed zlib wrote the decoded payload through the paired CPU view and preserved the trailing sentinel bytes. **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 `pr979-focused.log` and published.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 07:04 UTC · original

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

  • Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. With the test-only extension, cargo test --offline --locked -p xcl --lib dstorage -j 3 -- --nocapture --test-threads=1 passed twice (31 passed, 0 failed, 0 ignored, 0 runtime skips each).
  • The request completed with S_OK. Both 512-byte halves matched their distinct expected data. The guard bytes and the second page in the paired CPU view remained intact. The existing BeforeDecode hook recorded one worker decode for this request, confirming the parallel path.

Not tested
Workspace suite, retail streaming, or other adapters. Synthetic input only. I have the fixture as a test-only patch if useful.

AI use
Codex (GPT-6.2 Sol) wrote and ran the test extension and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-25 07:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7155456033) Independent Windows check of [b986487](https://github.com/xcl-dev/xcl/commit/b9864874533e0396fc540710dbc317ea9c2c3288). 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** - Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. With the test-only extension, `cargo test --offline --locked -p xcl --lib dstorage -j 3 -- --nocapture --test-threads=1` passed twice (31 passed, 0 failed, 0 ignored, 0 runtime skips each). - The request completed with `S_OK`. Both 512-byte halves matched their distinct expected data. The guard bytes and the second page in the paired CPU view remained intact. The existing `BeforeDecode` hook recorded one worker decode for this request, confirming the parallel path. **Not tested** Workspace suite, retail streaming, or other adapters. Synthetic input only. I have the fixture as a test-only patch if useful. **AI use** Codex (GPT-6.2 Sol) wrote and ran the test extension and drafted this report.
Author
Owner

@⁠pvfreis on GitHub · 2026-11-25 22:00 UTC · original

Read at 063c281f (nothing run): no defect found. One thing for your next rebase: #1405 added a page-list read in execute with plain read_own(r.destination, …); it needs for_each_mirror_run like your other two.

AI use: Claude Code (Claude Opus 5.5) read it; Claude Fable 5.2 reviewed the text; checked by a person before posting.

**@⁠pvfreis** on GitHub · 2026-11-25 22:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7175827023) Read at `063c281f` (nothing run): no defect found. One thing for your next rebase: #1405 added a page-list read in `execute` with plain `read_own(r.destination, …)`; it needs `for_each_mirror_run` like your other two. **AI use:** Claude Code (Claude Opus 5.5) read it; Claude Fable 5.2 reviewed the text; checked by a person before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:23 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier BCPack fixture failure is fixed.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 00:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7178701442) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier BCPack fixture failure is fixed. Thanks! — Devin
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/979/head:github-bot/gh-979'
git switch 'github-bot/gh-979'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-979'
git switch 'github-bot/gh-979'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-979'
git switch 'github-bot/gh-979'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-979'
git switch 'main'
git merge --squash 'github-bot/gh-979'
git switch 'main'
git merge --ff-only 'github-bot/gh-979'
git switch 'main'
git merge 'github-bot/gh-979'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.