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

Open
n-romanovich wants to merge 1 commit from upstream-pr/979 into main
n-romanovich commented 2026-11-24 09:50:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by n-romanovich on 2026-11-24T09:50:09Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5469838134 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979). Originally posted by [n-romanovich](https://github.com/n-romanovich) on 2026-11-24T09:50:09Z. --- 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.
raylitebull commented 2026-11-24 11:05:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-24T10:40:29Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7129094356 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/979#issuecomment-7129094356). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-24T10:40:29Z. --- 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.
Filip722 commented 2026-11-24 12:05:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-24T11:22:16Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7130009368 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/979#issuecomment-7130009368). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-24T11:22:16Z. --- 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.
SlopTart commented 2026-11-24 12:05:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T11:55:29Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7130726294 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/979#issuecomment-7130726294). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T11:55:29Z. --- 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.
pvfreis commented 2026-11-24 12:26:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T12:26:16Z.

Review: COMMENTED


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.

  1. 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 into main 47efa2e without a textual conflict, but main now unpacks BCPack BC7 (8cad517). There Request::check accepts 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, and execute returns E_DECOMPRESSION. The solid fill is only done for an Entry::Refused from 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.

<!-- greyfinch-sync:ivall/xcl:review:6039159471 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#pullrequestreview-6039159471). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T12:26:16Z. **Review:** COMMENTED --- 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`. 1. **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 into `main` `47efa2e` without a textual conflict, but `main` now unpacks BCPack BC7 (`8cad517`). There `Request::check` accepts 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, and `execute` returns `E_DECOMPRESSION`. The solid fill is only done for an `Entry::Refused` from 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.
DavidM1911 commented 2026-11-24 13:03:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T12:27:30Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7131466854 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/979#issuecomment-7131466854). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T12:27:30Z. --- 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.
SlopTart commented 2026-11-24 13:03:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T12:44:31Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7131855807 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/979#issuecomment-7131855807). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T12:44:31Z. --- 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.
einfachama commented 2026-11-24 15:06:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by einfachama on 2026-11-24T14:49:40Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7135013644 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/979#issuecomment-7135013644). Originally posted by [einfachama](https://github.com/einfachama) on 2026-11-24T14:49:40Z. --- 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.
crastinator commented 2026-11-24 15:44:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T15:44:17Z.

Review: COMMENTED


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-spirv 53aac418 from #775), DXVK v3.1.1-209 dxgi, 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 b8d21b0 itself: hle::dstorage::tests::gpu_view_addresses_read_and_write_their_paired_cpu_view passes 2/2.
  • Merged onto main 930e8b4 (no textual conflict): it fails 3/3 at dstorage.rs:2603, the fill check of step 2. The destination still holds the 0xCD the test wrote, and the log says BCPack 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. On main, bcpack_fill only runs for Entry::Refused, so step 2 never fills.
  • Using a mode main still refuses, as main's own fill test does with mode 2, makes it pass 3/3 on the merged tree, and all 15 hle::dstorage tests pass:
    -                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();
    
    That holds only while mode 2 stays undecoded on main. A rebase onto main would 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 on main.

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 on main. No hle::dstorage test fails, and gpu_view_addresses_read_and_write_their_paired_cpu_view passes (the BC2 subcase included). The 14 are the Wine-lane set main has here.
  • Read for_each_mirror_run / mirror_writable / write_virtual_destination and the parallel.rs change. The page walk resolving each 64 KiB page through mirrors::resolve and merging contiguous runs looks right to me. One leftover from the conflict resolution: the doc comment above for_each_mirror_run starts "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_*).
<!-- greyfinch-sync:ivall/xcl:review:6042508442 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#pullrequestreview-6042508442). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-24T15:44:17Z. **Review:** COMMENTED --- 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-spirv `53aac418` from #775), DXVK v3.1.1-209 `dxgi`, 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 `b8d21b0` itself: `hle::dstorage::tests::gpu_view_addresses_read_and_write_their_paired_cpu_view` passes 2/2. - Merged onto `main` `930e8b4` (no textual conflict): it fails 3/3 at `dstorage.rs:2603`, the fill check of step 2. The destination still holds the `0xCD` the test wrote, and the log says `BCPack 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. On `main`, `bcpack_fill` only runs for `Entry::Refused`, so step 2 never fills. - Using a mode `main` still refuses, as `main`'s own fill test does with mode 2, makes it pass 3/3 on the merged tree, and all 15 `hle::dstorage` tests pass: ```diff - 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(); ``` That holds only while mode 2 stays undecoded on `main`. A rebase onto `main` would 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 on `main`. **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 on `main`. No `hle::dstorage` test fails, and `gpu_view_addresses_read_and_write_their_paired_cpu_view` passes (the BC2 subcase included). The 14 are the Wine-lane set `main` has here. - Read `for_each_mirror_run` / `mirror_writable` / `write_virtual_destination` and the `parallel.rs` change. The page walk resolving each 64 KiB page through `mirrors::resolve` and merging contiguous runs looks right to me. One leftover from the conflict resolution: the doc comment above `for_each_mirror_run` starts "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_*`).
n-romanovich commented 2026-11-24 18:09:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by n-romanovich on 2026-11-24T18:04:04Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7140108476 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7140108476). Originally posted by [n-romanovich](https://github.com/n-romanovich) on 2026-11-24T18:04:04Z. --- 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!
pvfreis commented 2026-11-24 19:07:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T18:19:49Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7140490304 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7140490304). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T18:19:49Z. --- 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.
crastinator commented 2026-11-24 21:09:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T20:59:57Z.


@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.

<!-- greyfinch-sync:ivall/xcl:comment:7144339019 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7144339019). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-24T20:59:57Z. --- @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.
n-romanovich commented 2026-11-24 21:09:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by n-romanovich on 2026-11-24T20:45:19Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7144012650 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7144012650). Originally posted by [n-romanovich](https://github.com/n-romanovich) on 2026-11-24T20:45:19Z. --- 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.
JJAutoCompare commented 2026-11-25 06:05:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:38:32Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7153990568 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7153990568). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:38:32Z. --- ### 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.
thehollowedone commented 2026-11-25 07:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T07:04:19Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7155456033 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7155456033). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T07:04:19Z. --- 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.
pvfreis commented 2026-11-25 22:06:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-25T22:00:56Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7175827023 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7175827023). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-25T22:00:56Z. --- 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.
DavidM1911 commented 2026-11-26 01:05:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:23:14Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7178701442 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7178701442). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T00:23:14Z. --- 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
Foniass commented 2026-12-01 04:35:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:35:10Z.


Triage (#1607) – head 063c281

No open or merged PR resolves DirectStorage destinations and memory sources in a GPU view through kernelx::mirrors. Main's dstorage.rs does not use mirrors at all, and the related PRs (#768, #1995, #1055) do this for D3D12.X copies, not DirectStorage.
Notes on the diff: the doc comment above for_each_mirror_run (dstorage.rs) starts with a half sentence ("Where a virtual address in a GPU view ... its own"). Every virtual-destination write in execute and bcpack_fill now goes through NtWriteVirtualMemory instead of a memcpy, and every request takes the mirrors lock in overlaps_gpu_view; both are small per-request costs, but they apply to every title, not only to ones with paired views. The branch conflicts with main.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300884241 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/979#issuecomment-7300884241). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:35:10Z. --- **Triage (#1607)** – head 063c281 No open or merged PR resolves DirectStorage destinations and memory sources in a GPU view through `kernelx::mirrors`. Main's dstorage.rs does not use `mirrors` at all, and the related PRs (#768, #1995, #1055) do this for D3D12.X copies, not DirectStorage. Notes on the diff: the doc comment above `for_each_mirror_run` (dstorage.rs) starts with a half sentence ("Where a virtual address in a GPU view ... its own"). Every virtual-destination write in `execute` and `bcpack_fill` now goes through `NtWriteVirtualMemory` instead of a memcpy, and every request takes the `mirrors` lock in `overlaps_gpu_view`; both are small per-request costs, but they apply to every title, not only to ones with paired views. The branch conflicts with main. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/979:upstream-pr/979'
git switch 'upstream-pr/979'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/979'
git switch 'upstream-pr/979'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/979'
git switch 'upstream-pr/979'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/979'
git switch 'main'
git merge --squash 'upstream-pr/979'
git switch 'main'
git merge --ff-only 'upstream-pr/979'
git switch 'main'
git merge 'upstream-pr/979'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!973
No description provided.