DirectStorage: read deferred zero mappings as native inputs #666

Open
Prime1997 wants to merge 1 commit from upstream-pr/671 into main
Prime1997 commented 2026-11-24 03:14:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-24T03:14:09Z.


DirectStorage could reject a valid zero-filled memory source or a physical-page table before its first CPU access. Native reads bypass XCL's first-touch handler.

What is in it

  • Prepare fully reserved pages tracked by kernelx, then retry the existing read or readability check once. A concurrent first touch can satisfy the retry. Committed protections and unrelated reservations retain their existing behavior.
  • Six synthetic cases cover ordinary memory sources, snapshots spanning two pages, untracked reservations, access protections, partial commitments and concurrent first touch. The deferred snapshot remains owned by the request.
  • This extends the native reads introduced in #322. Related #509, #549 and #561 cover a late table update, queue submission timing and concurrent unmapping respectively.

Tested

  • Windows 11 build 26200, Intel Core i5-10400, GeForce RTX 3060 Ti, driver 32.0.16.1714, Rust 1.100.0. Release workspace build succeeded.
  • cargo test --locked --workspace -- --test-threads=4 --nocapture on the PR head, debug, 696 passed, 0 failed, 41 ignored. Two GPU tests emitted SKIPPED because this adapter lacks wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • On dd2ae9a the untouched memory source and zero-filled page-table tests both failed with E_ACCESS_VIOLATION. On d9a96fd all 19 DirectStorage tests and both existing kernelx lazy-page tests passed.
  • Paired offline retail startup runs used the same adapter and compiler DLLs, 60 seconds each, with no menu input. Each run used a fresh title-data directory and the same initial shader-cache contents.

Regression run

Official main:

xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 239 (PresentX 240)
presents per 2 s (last 3): 9 11 16
device removals: 0
crashes: 0
peak commit: 15399 MB

PR head:

xcl-smoke v1
commit: d9a96fd1fd57314b516b452d7eb1ef7315b698e9
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 268 (PresentX 268)
presents per 2 s (last 3): 11 11 10
device removals: 0
crashes: 0
peak commit: 15799 MB

Not tested

  • The retail comparison covers startup. A separate player-controlled run on our integration containing this change and #567 still hit the world-loading watchdog. The cause of individual retail storage failures remains unverified. Hardware coverage was limited to the RTX 3060 Ti. Optional RPF, TTPF and AWC sample fixtures were unset during the workspace tests.

AI use

  • OpenAI Codex (GPT-6) investigated the bug, implemented and reviewed the change, ran the tests and prepared this description.

I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord

<!-- greyfinch-sync:ivall/xcl:issue:5465396852 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-24T03:14:09Z. --- DirectStorage could reject a valid zero-filled memory source or a physical-page table before its first CPU access. Native reads bypass XCL's first-touch handler. **What is in it** - Prepare fully reserved pages tracked by kernelx, then retry the existing read or readability check once. A concurrent first touch can satisfy the retry. Committed protections and unrelated reservations retain their existing behavior. - Six synthetic cases cover ordinary memory sources, snapshots spanning two pages, untracked reservations, access protections, partial commitments and concurrent first touch. The deferred snapshot remains owned by the request. - This extends the native reads introduced in #322. Related #509, #549 and #561 cover a late table update, queue submission timing and concurrent unmapping respectively. **Tested** - Windows 11 build 26200, Intel Core i5-10400, GeForce RTX 3060 Ti, driver 32.0.16.1714, Rust 1.100.0. Release workspace build succeeded. - `cargo test --locked --workspace -- --test-threads=4 --nocapture` on the PR head, debug, 696 passed, 0 failed, 41 ignored. Two GPU tests emitted `SKIPPED` because this adapter lacks wave64: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. - On dd2ae9a the untouched memory source and zero-filled page-table tests both failed with `E_ACCESS_VIOLATION`. On d9a96fd all 19 DirectStorage tests and both existing kernelx lazy-page tests passed. - Paired offline retail startup runs used the same adapter and compiler DLLs, 60 seconds each, with no menu input. Each run used a fresh title-data directory and the same initial shader-cache contents. **Regression run** Official main: ``` xcl-smoke v1 commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95 gpu: NVIDIA GeForce RTX 3060 Ti title: 419239bf seconds: 60 exit: 0x0 frames shown: 239 (PresentX 240) presents per 2 s (last 3): 9 11 16 device removals: 0 crashes: 0 peak commit: 15399 MB ``` PR head: ``` xcl-smoke v1 commit: d9a96fd1fd57314b516b452d7eb1ef7315b698e9 gpu: NVIDIA GeForce RTX 3060 Ti title: 419239bf seconds: 60 exit: 0x0 frames shown: 268 (PresentX 268) presents per 2 s (last 3): 11 11 10 device removals: 0 crashes: 0 peak commit: 15799 MB ``` **Not tested** - The retail comparison covers startup. A separate player-controlled run on our integration containing this change and #567 still hit the world-loading watchdog. The cause of individual retail storage failures remains unverified. Hardware coverage was limited to the RTX 3060 Ti. Optional RPF, TTPF and AWC sample fixtures were unset during the workspace tests. **AI use** - OpenAI Codex (GPT-6) investigated the bug, implemented and reviewed the change, ran the tests and prepared this description. I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. [Test coordination on Discord](https://discord.gg/gK3y7WRRY)
thehollowedone commented 2026-11-24 07:05:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T03:30:35Z.


Tested

I tested a legal cross-page memory request through XCL’s DirectStorage queue, including enqueue, submit, worker execution, and the completion status. The first 48 bytes came from committed memory filled with 0x5a. The next 48 bytes came from a tracked zero page that was still reserved after enqueue.

  • main at 91f9a5e completed with E_ACCESS_VIOLATION and left all 96 destination bytes unchanged.
  • With d9a96fd integrated onto that baseline, the same queued request completed with S_OK and returned the expected 48 patterned and 48 zero bytes.

cargo test --offline --locked -p xcl --lib hle::dstorage -- --nocapture --test-threads=1 passed 14/14 on the baseline and 20/20 with the patch. Each count includes the scratch queue fixture and its revision-specific assertion.

Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug. This was a CPU-side synthetic check.

Not tested

Retail streaming, GPU timing, and the full workspace suite.

AI use

Codex with GPT-6.2 Sol wrote the scratch fixture, ran the tests, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7121164840 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/671#issuecomment-7121164840). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T03:30:35Z. --- **Tested** I tested a legal cross-page memory request through XCL’s DirectStorage queue, including enqueue, submit, worker execution, and the completion status. The first 48 bytes came from committed memory filled with `0x5a`. The next 48 bytes came from a tracked zero page that was still reserved after enqueue. - [`main` at `91f9a5e`](https://github.com/ivall/xcl/commit/91f9a5e9f03156ea82dc55a18f7704862da7a5db) completed with `E_ACCESS_VIOLATION` and left all 96 destination bytes unchanged. - With [`d9a96fd`](https://github.com/ivall/xcl/commit/d9a96fd1fd57314b516b452d7eb1ef7315b698e9) integrated onto that baseline, the same queued request completed with `S_OK` and returned the expected 48 patterned and 48 zero bytes. `cargo test --offline --locked -p xcl --lib hle::dstorage -- --nocapture --test-threads=1` passed 14/14 on the baseline and 20/20 with the patch. Each count includes the scratch queue fixture and its revision-specific assertion. Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug. This was a CPU-side synthetic check. **Not tested** Retail streaming, GPU timing, and the full workspace suite. **AI use** Codex with GPT-6.2 Sol wrote the scratch fixture, ran the tests, and drafted this report.
JoaoPauluu commented 2026-11-24 07:06:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T04:27:02Z.


Test report: #671 under Wine (Linux, NVIDIA): one new test fails on Wine's ReadProcessMemory with a guard page; GTA VI regression pair

Setup

  • CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06
  • Proton Experimental experimental-11.0-20261112 (wine-11.0), vkd3d-proton v3.1 (4522cc1a) + the patch from #257, DXVK from Proton, DXC 1.9.2609, DXVK_CONFIG="dxgi.hideNvidiaGpu = False"
  • Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64-gcc 16.2.0); debug for the tests, release for the runs
  • Commits: this PR's head d9a96fd and its merge base main dd2ae9a

Unit tests (lib test binary under Wine, --test-threads=1, filter dstorage): 18 passed, 1 failed, in 2 of 2 runs.

hle::dstorage::lazy_input_tests::deferred_read_preparation_preserves_explicit_page_protections
panicked at crates/xcl/src/hle/dstorage_lazy_input_tests.rs:176:17:
  left: Ok([0])
 right: Err(-1994129399)

To see which protection it is, I printed each case locally (test file restored afterwards):

protect copy_from snapshot_page_array Protect afterwards
PAGE_READONLY (0x2) Ok, zeros Ok([0]) 0x2
PAGE_NOACCESS (0x1) Err, destination untouched Err(E_ACCESS_VIOLATION) 0x1
PAGE_READWRITE | PAGE_GUARD (0x104) Err, destination untouched Ok([0]) 0x4

So only the guard-page case differs: ReadProcessMemory(GetCurrentProcess(), …) under this Wine reads a guard page and the guard is gone afterwards, so the test's last assert (Protect == protect) would fail too. read_own on main makes the same ReadProcessMemory call; the PR only adds the retry around it, so this looks like a Wine difference that the new test exposes, not something the PR changes. I didn't check other Wine versions.

GTA VI 1.0.2.1 (my own dump; 60 s runs with scripts/linux/smoke.sh from #257, XCL_NETWORK=0, alternating base / PR / PR / base)

build frames shown DirectStorage requests / MB / failed removals / crashes
dd2ae9a 960, 1012 9764 / 650 / 0; 9767 / 650 / 0 0 / 0
d9a96fd 1014, 985 9767 / 650 / 0; 9767 / 650 / 0 0 / 0
xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 960 (PresentX 960)
presents per 2 s (last 3): 42 49 0
device removals: 0
crashes: 0
peak commit: 0 MB
xcl-smoke v1
commit: d9a96fd1fd57314b516b452d7eb1ef7315b698e9
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1014 (PresentX 1014)
presents per 2 s (last 3): 56 2 21
device removals: 0
crashes: 0
peak commit: 0 MB

(The first pair. peak commit: 0 MB is XCL reading 0 MB committed under Wine, see #257.) GTA VI's requests all succeed on both builds, so these runs don't show whether it ever hits the deferred-zero-page case.

Not tested

  • Windows, AMD; other Wine versions for the guard-page case; the other test filters on this branch

AI use: Claude Code (Claude Opus 5.5) built both commits, ran everything above on the machine above and wrote this report. The blocks, counts and the panic are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.

<!-- greyfinch-sync:ivall/xcl:comment:7122030184 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/671#issuecomment-7122030184). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T04:27:02Z. --- ### Test report: #671 under Wine (Linux, NVIDIA): one new test fails on Wine's `ReadProcessMemory` with a guard page; GTA VI regression pair **Setup** - CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06 - Proton Experimental `experimental-11.0-20261112` (wine-11.0), vkd3d-proton v3.1 (`4522cc1a`) + the patch from #257, DXVK from Proton, DXC 1.9.2609, `DXVK_CONFIG="dxgi.hideNvidiaGpu = False"` - Rust 1.100.0, `x86_64-pc-windows-gnu` (mingw-w64-gcc 16.2.0); debug for the tests, release for the runs - Commits: this PR's head `d9a96fd` and its merge base `main` `dd2ae9a` **Unit tests** (lib test binary under Wine, `--test-threads=1`, filter `dstorage`): 18 passed, 1 failed, in 2 of 2 runs. ``` hle::dstorage::lazy_input_tests::deferred_read_preparation_preserves_explicit_page_protections panicked at crates/xcl/src/hle/dstorage_lazy_input_tests.rs:176:17: left: Ok([0]) right: Err(-1994129399) ``` To see which protection it is, I printed each case locally (test file restored afterwards): | `protect` | `copy_from` | `snapshot_page_array` | `Protect` afterwards | |---|---|---|---| | `PAGE_READONLY` (0x2) | `Ok`, zeros | `Ok([0])` | 0x2 | | `PAGE_NOACCESS` (0x1) | `Err`, destination untouched | `Err(E_ACCESS_VIOLATION)` | 0x1 | | `PAGE_READWRITE \| PAGE_GUARD` (0x104) | `Err`, destination untouched | **`Ok([0])`** | **0x4** | So only the guard-page case differs: `ReadProcessMemory(GetCurrentProcess(), …)` under this Wine reads a guard page and the guard is gone afterwards, so the test's last assert (`Protect == protect`) would fail too. `read_own` on `main` makes the same `ReadProcessMemory` call; the PR only adds the retry around it, so this looks like a Wine difference that the new test exposes, not something the PR changes. I didn't check other Wine versions. **GTA VI 1.0.2.1** (my own dump; 60 s runs with `scripts/linux/smoke.sh` from #257, `XCL_NETWORK=0`, alternating base / PR / PR / base) | build | frames shown | DirectStorage requests / MB / failed | removals / crashes | |---|---|---|---| | `dd2ae9a` | 960, 1012 | 9764 / 650 / 0; 9767 / 650 / 0 | 0 / 0 | | `d9a96fd` | 1014, 985 | 9767 / 650 / 0; 9767 / 650 / 0 | 0 / 0 | ``` xcl-smoke v1 commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 960 (PresentX 960) presents per 2 s (last 3): 42 49 0 device removals: 0 crashes: 0 peak commit: 0 MB ``` ``` xcl-smoke v1 commit: d9a96fd1fd57314b516b452d7eb1ef7315b698e9 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1014 (PresentX 1014) presents per 2 s (last 3): 56 2 21 device removals: 0 crashes: 0 peak commit: 0 MB ``` (The first pair. `peak commit: 0 MB` is XCL reading 0 MB committed under Wine, see #257.) GTA VI's requests all succeed on both builds, so these runs don't show whether it ever hits the deferred-zero-page case. **Not tested** - Windows, AMD; other Wine versions for the guard-page case; the other test filters on this branch **AI use:** Claude Code (Claude Opus 5.5) built both commits, ran everything above on the machine above and wrote this report. The blocks, counts and the panic are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.
MesshM commented 2026-11-24 07:06:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:54:01Z.


Test run of d9a96fd1fd57314b516b452d7eb1ef7315b698e9 on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200 (native Windows, not Wine), Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 707 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 666 passed, 0 failed, 21 ignored
  • 0 SKIPPED; the dstorage and lazy tests pass, the new ones included.

Review: This run is on native Windows; the Wine failure reported above (Wine's ReadProcessMemory on a guard page) does not show up here, so it looks Wine-specific rather than a problem in the change. Preparing the reserved pages kernelx tracks and retrying the read once keeps a valid zero-filled source from being refused before its first touch. I did not trace the concurrent first-touch race the description mentions.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7122439397 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/671#issuecomment-7122439397). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T04:54:01Z. --- Test run of `d9a96fd1fd57314b516b452d7eb1ef7315b698e9` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200 (native Windows, not Wine), Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **707 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 666 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; the `dstorage` and `lazy` tests pass, the new ones included. **Review:** This run is on native Windows; the Wine failure reported above (Wine's `ReadProcessMemory` on a guard page) does not show up here, so it looks Wine-specific rather than a problem in the change. Preparing the reserved pages kernelx tracks and retrying the read once keeps a valid zero-filled source from being refused before its first touch. I did not trace the concurrent first-touch race the description mentions. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
PedroNunes11 commented 2026-11-24 13:03:42 +00:00 (Migrated from github.com)

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


Native Windows retail-title data point for d9a96fd.

Tested

  • Windows 11 Pro build 26200; Ryzen 7 9800X3D; 32 GB RAM; NVIDIA RTX 4070 Ti SUPER 16 GB, driver 32.0.16.2124; Rust 1.100.0 MSVC; release build.
  • GTA VI 1.0.2.1, Series X profile, XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_UMA_MB=4095, XCL_COHERENT_MB=4095.
  • d9a96fd cherry-picked onto main e50836b (local commit 16e2f17). The tree also had a four-line local XCL_NO_SYSTEM_XGAMERUNTIME opt-out because the system XGameRuntime crashes on this machine; that change is outside DirectStorage.
  • cargo test -p xcl --lib deferred -- --test-threads=1: 7 passed, 0 failed (including the five new deferred-input tests selected by the filter).

The PR removes the deferred physical-page failures this title hits. On the immediately preceding main baseline (d208e14, the only later main change was README), with unsupported BCPack destinations filled and reported as successful, the activity log had 1,893 failed DirectStorage requests in one 2 s interval, with representative status 0x89240009. With d9a96fd integrated and the same local BCPack diagnostic, every activity interval reported 0 failed requests, including the heavy world-streaming intervals.

It does not remove the later world-loading stall on this machine:

58.020 s: 6 presents; DirectStorage 5325 requests, 298 MB, 0 failed
64.023 s: 16 presents; DirectStorage 3635 requests, 179 MB, 0 failed
66.023 s: 0 presents; DirectStorage 162 requests, 15 MB, 0 failed
66.535 s: Wait64BitValueX timed out
94.402 s: null write at game_scarlett_master.exe+0x23cf683
peak process commit: 30.65 GB; peak local video memory: 14.21 GB

The local BCPack diagnostic filled unsupported blocks and reported those requests as successful; it is not proposed as a fix. Its purpose here was to isolate the remaining stall after both known DirectStorage failure classes were suppressed. The result supports d9a96fd fixing the lazy-input failures, but shows that those failures are not the only cause of the GTA VI stall tracked in #232.

Not tested

  • Full workspace suite, AMD, or an unmodified system-XGameRuntime path.
  • This is not a clean PR smoke block because of the disclosed XGameRuntime opt-out and BCPack diagnostic; the timings above are copied from the real run log, not presented as a merge-gating regression run.

AI use

OpenAI Codex with GPT-5 built the branches, ran the tests and title, analyzed the logs, and drafted this report. The account owner requested that the useful results be posted.

<!-- greyfinch-sync:ivall/xcl:comment:7131786287 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/671#issuecomment-7131786287). Originally posted by [PedroNunes11](https://github.com/PedroNunes11) on 2026-11-24T12:41:26Z. --- Native Windows retail-title data point for `d9a96fd`. **Tested** - Windows 11 Pro build 26200; Ryzen 7 9800X3D; 32 GB RAM; NVIDIA RTX 4070 Ti SUPER 16 GB, driver 32.0.16.2124; Rust 1.100.0 MSVC; release build. - GTA VI 1.0.2.1, Series X profile, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, `XCL_UMA_MB=4095`, `XCL_COHERENT_MB=4095`. - `d9a96fd` cherry-picked onto `main` `e50836b` (local commit `16e2f17`). The tree also had a four-line local `XCL_NO_SYSTEM_XGAMERUNTIME` opt-out because the system XGameRuntime crashes on this machine; that change is outside DirectStorage. - `cargo test -p xcl --lib deferred -- --test-threads=1`: **7 passed, 0 failed** (including the five new deferred-input tests selected by the filter). The PR removes the deferred physical-page failures this title hits. On the immediately preceding `main` baseline (`d208e14`, the only later `main` change was README), with unsupported BCPack destinations filled and reported as successful, the activity log had **1,893 failed DirectStorage requests** in one 2 s interval, with representative status `0x89240009`. With `d9a96fd` integrated and the same local BCPack diagnostic, every activity interval reported **0 failed** requests, including the heavy world-streaming intervals. It does not remove the later world-loading stall on this machine: ```text 58.020 s: 6 presents; DirectStorage 5325 requests, 298 MB, 0 failed 64.023 s: 16 presents; DirectStorage 3635 requests, 179 MB, 0 failed 66.023 s: 0 presents; DirectStorage 162 requests, 15 MB, 0 failed 66.535 s: Wait64BitValueX timed out 94.402 s: null write at game_scarlett_master.exe+0x23cf683 peak process commit: 30.65 GB; peak local video memory: 14.21 GB ``` The local BCPack diagnostic filled unsupported blocks and reported those requests as successful; it is not proposed as a fix. Its purpose here was to isolate the remaining stall after both known DirectStorage failure classes were suppressed. The result supports `d9a96fd` fixing the lazy-input failures, but shows that those failures are not the only cause of the GTA VI stall tracked in #232. **Not tested** - Full workspace suite, AMD, or an unmodified system-XGameRuntime path. - This is not a clean PR smoke block because of the disclosed XGameRuntime opt-out and BCPack diagnostic; the timings above are copied from the real run log, not presented as a merge-gating regression run. **AI use** OpenAI Codex with GPT-5 built the branches, ran the tests and title, analyzed the logs, and drafted this report. The account owner requested that the useful results be posted.
JJAutoCompare commented 2026-11-25 07:05:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:24:43Z.


Empirical test report (d9a96fd1)

Hardware / environment

  • PR #671, commit d9a96fd1fd57314b516b452d7eb1ef7315b698e9.
  • Windows 11 Enterprise Evaluation x64, build 26200.9974. AMD CPU reported as AMD64 Family 23 Model 113 Stepping 0, approximately 3.9 GHz, with 12 logical processors visible to the session.
  • Rust and Cargo 1.100.0, host x86_64-pc-windows-msvc. DXC 1.9.2609.5 (01b62ad47). CPU-only execution with XCL_ADAPTER=NONE_CPU_ONLY. No GPU adapter used.

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test executables. Compilation only.
  • cargo test -p xcl --lib hle::dstorage::lazy_input_tests:: -- --test-threads=1 exited 0 with RUST_TEST_NOCAPTURE=1. The captured result was 6 passed, 0 failed, 0 ignored, and 671 filtered out. The log contained 0 case-sensitive lines beginning with SKIPPED .

Observed behavior

  • A DirectStorage memory read committed a tracked deferred mapping and copied 64 zero-valued bytes. A page-array snapshot spanning two deferred pages retained its original zero entries after the source was overwritten, and a new snapshot saw the new entries.
  • An untracked reservation and an overflowing page-array address were rejected. Preparation left the reserved portion of a partly committed page uncommitted and preserved read-only, no-access, and guard protections.
  • After another thread materialized the page, both read paths succeeded on the second attempt and the native copy returned zero-filled data.

Not tested

The full GPU workspace suite and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr671-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7154762663 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7154762663). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T06:24:43Z. --- ### Empirical test report (d9a96fd1) **Hardware / environment** - PR #671, commit `d9a96fd1fd57314b516b452d7eb1ef7315b698e9`. - Windows 11 Enterprise Evaluation x64, build 26200.9974. AMD CPU reported as AMD64 Family 23 Model 113 Stepping 0, approximately 3.9 GHz, with 12 logical processors visible to the session. - Rust and Cargo 1.100.0, host `x86_64-pc-windows-msvc`. DXC 1.9.2609.5 (01b62ad47). CPU-only execution with `XCL_ADAPTER=NONE_CPU_ONLY`. No GPU adapter used. **Commands and results** - `cargo test --workspace --no-run` exited 0 and built the workspace test executables. Compilation only. - `cargo test -p xcl --lib hle::dstorage::lazy_input_tests:: -- --test-threads=1` exited 0 with `RUST_TEST_NOCAPTURE=1`. The captured result was 6 passed, 0 failed, 0 ignored, and 671 filtered out. The log contained 0 case-sensitive lines beginning with `SKIPPED `. **Observed behavior** - A DirectStorage memory read committed a tracked deferred mapping and copied 64 zero-valued bytes. A page-array snapshot spanning two deferred pages retained its original zero entries after the source was overwritten, and a new snapshot saw the new entries. - An untracked reservation and an overflowing page-array address were rejected. Preparation left the reserved portion of a partly committed page uncommitted and preserved read-only, no-access, and guard protections. - After another thread materialized the page, both read paths succeeded on the second attempt and the native copy returned zero-filled data. **Not tested** The full GPU workspace suite and game smoke runs were omitted. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr671-focused.log and published.
DavidM1911 commented 2026-11-25 13:05:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T12:22:58Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7162297250 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7162297250). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T12:22:58Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
thehollowedone commented 2026-11-27 16:58:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T16:58:47Z.


merge-check
base: 6089122a1c96dff16e93b6fdf04c8ed20cfb6102 (main, checked 2026-11-27)
head: d9a96fd1fd57314b516b452d7eb1ef7315b698e9
merge: clean text merge; one test call is incompatible with current main
build: cargo build --workspace -> ok on the unmodified merge
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> compilation failed on the unmodified merge (E0061 at dstorage_lazy_input_tests.rs:59; no tests ran). After adding only the missing false argument in a disposable local copy, the same command ran: 1,470 passed, 1 failed, 47 ignored, with 25 SKIPPED GPU notices. All six new deferred-input tests passed. The failure was gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (cached_only console_mesh hit: "DXIL not compiled yet"). The exact focused test also failed on untouched base 6089122 (0 passed, 1 failed).
review: the test helper calls execute(&request, None, None, None), but current main added the dest_on_stack: bool parameter before src_pages. This test uses a virtual destination, so false matches its setup. I found no further issue in the merged source path for deferred preparation or owned page snapshots.
performance: successful native reads retain one read and do not acquire the lazy-page lock. A failed read tries preparation under that lock and retries once; this path is limited to failed/first-touch reads. Frame-time and memory effects were not measured.
verdict: not yet. Update the fixture call on the PR head and rerun the required checks against current main; then the merge result can be checked again.
hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA RTX 3080 Ti 12 GB / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11. Codex (GPT-6.2 Sol) ran the builds/tests and checked the merge; Codex (GPT-6.2 Astra) independently traced the source path.

One-line test compatibility adjustment used for the verification run
-    execute(&request, None, None, None)
+    execute(&request, None, None, false, None)
<!-- greyfinch-sync:ivall/xcl:comment:7223888221 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7223888221). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-27T16:58:47Z. --- merge-check base: [`6089122a1c96dff16e93b6fdf04c8ed20cfb6102`](https://github.com/xcl-dev/xcl/commit/6089122a1c96dff16e93b6fdf04c8ed20cfb6102) (`main`, checked 2026-11-27) head: [`d9a96fd1fd57314b516b452d7eb1ef7315b698e9`](https://github.com/xcl-dev/xcl/commit/d9a96fd1fd57314b516b452d7eb1ef7315b698e9) merge: clean text merge; one test call is incompatible with current `main` build: `cargo build --workspace` -> ok on the unmodified merge tests: `cargo test --workspace --no-fail-fast -- --test-threads=4` -> compilation failed on the unmodified merge (E0061 at `dstorage_lazy_input_tests.rs:59`; no tests ran). After adding only the missing `false` argument in a disposable local copy, the same command ran: **1,470 passed, 1 failed, 47 ignored**, with 25 `SKIPPED` GPU notices. All six new deferred-input tests passed. The failure was `gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`cached_only console_mesh hit: "DXIL not compiled yet"`). The exact focused test also failed on untouched base `6089122` (0 passed, 1 failed). review: the test helper calls `execute(&request, None, None, None)`, but current `main` added the `dest_on_stack: bool` parameter before `src_pages`. This test uses a virtual destination, so `false` matches its setup. I found no further issue in the merged source path for deferred preparation or owned page snapshots. performance: successful native reads retain one read and do not acquire the lazy-page lock. A failed read tries preparation under that lock and retries once; this path is limited to failed/first-touch reads. Frame-time and memory effects were not measured. verdict: **not yet**. Update the fixture call on the PR head and rerun the required checks against current `main`; then the merge result can be checked again. hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA RTX 3080 Ti 12 GB / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11. Codex (GPT-6.2 Sol) ran the builds/tests and checked the merge; Codex (GPT-6.2 Astra) independently traced the source path. <details><summary>One-line test compatibility adjustment used for the verification run</summary> ```diff - execute(&request, None, None, None) + execute(&request, None, None, false, None) ``` </details>
throny commented 2026-11-27 19:13:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T19:13:08Z.


merge-check claim
head: d9a96fd1fd

<!-- greyfinch-sync:ivall/xcl:comment:7226307687 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7226307687). Originally posted by [throny](https://github.com/throny) on 2026-11-27T19:13:08Z. --- merge-check claim head: d9a96fd1fd57314b516b452d7eb1ef7315b698e9
throny commented 2026-11-27 19:24:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T19:24:10Z.


merge-check
base: 6089122a
head: d9a96fd1fd
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> does not compile: E0061 in crates/xcl/src/hle/dstorage_lazy_input_tests.rs:59, execute takes 5 arguments on current main (a bool before the source pages), the test passes 4. No test ran. Base alone: 1465 passed, 0 failed, 47 ignored.
review: apart from that, nothing blocking. prepare_read checks the range for overflow, holds the write lock and commits only tracked pages whose whole 64 KiB is still reserved; its lock order matches the fault handler's. read_own now also prepares pages for its other callers (late-fill compare, file-vtable read): harmless, but not in the description. The test's VirtualAlloc / VirtualProtect touch only its own reservation.
performance: a read that succeeds is unchanged; only a failed read takes the write lock and retries once (reasoned).
verdict: not yet: add the new argument to the test call (the first check says false), rebase on current main; I will rerun the suite on the new head.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7226491550 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7226491550). Originally posted by [throny](https://github.com/throny) on 2026-11-27T19:24:10Z. --- merge-check base: 6089122a head: d9a96fd1fd57314b516b452d7eb1ef7315b698e9 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> does not compile: E0061 in crates/xcl/src/hle/dstorage_lazy_input_tests.rs:59, `execute` takes 5 arguments on current main (a `bool` before the source pages), the test passes 4. No test ran. Base alone: 1465 passed, 0 failed, 47 ignored. review: apart from that, nothing blocking. prepare_read checks the range for overflow, holds the write lock and commits only tracked pages whose whole 64 KiB is still reserved; its lock order matches the fault handler's. read_own now also prepares pages for its other callers (late-fill compare, file-vtable read): harmless, but not in the description. The test's VirtualAlloc / VirtualProtect touch only its own reservation. performance: a read that succeeds is unchanged; only a failed read takes the write lock and retries once (reasoned). verdict: not yet: add the new argument to the test call (the first check says `false`), rebase on current main; I will rerun the suite on the new head. hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
bmjask commented 2026-11-29 22:46:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T22:46:10Z.

Review: COMMENTED


Critical review of current head d9a96fd1. The deferred-zero input retry is targeted and the cross-page behavior has a direct queue-level Windows test. Current-main test-build blocker: dstorage_lazy_input_tests.rs:59 calls execute with four arguments, while main's signature now takes five; a text-clean merge cannot run the suite until the missing argument is ported. See the merge-check report. Please rebase that fixture and rerun the whole storage test filter; also retain the protection/partial-commit negative cases so the retry does not make unrelated addresses readable. No local Windows run.

<!-- greyfinch-sync:ivall/xcl:review:6105201415 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671#pullrequestreview-6105201415). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-29T22:46:10Z. **Review:** COMMENTED --- Critical review of current head `d9a96fd1`. The deferred-zero input retry is targeted and the cross-page behavior has a direct queue-level Windows test. **Current-main test-build blocker:** `dstorage_lazy_input_tests.rs:59` calls `execute` with four arguments, while main's signature now takes five; a text-clean merge cannot run the suite until the missing argument is ported. See the [merge-check report](https://github.com/xcl-dev/xcl/pull/671). Please rebase that fixture and rerun the whole storage test filter; also retain the protection/partial-commit negative cases so the retry does not make unrelated addresses readable. No local Windows run.
Foniass commented 2026-12-01 06:49:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:49:28Z.


Review (head d9a96fd1, diff read, not a merge-check; it conflicts with main, so not built or run):

  • Overlaps open #2359, which closes the same gap with the existing kernelx::lazy::ensure. The gap is still on main: the memory source is only checked with shader::readable (dstorage.rs ~970) and the page array read with read_own (~811), neither of which commits lazy pages first.
  • prepare_read adds a second version of lazy::commit / ensure (lazy.rs ~38, ~92) instead of reusing them as writable() does (dstorage.rs ~868).
  • On main read_own is pub(crate) and called from bvh_want.rs ~79, list_x.rs ~302 / ~2471 and sparse.rs ~3500, so after a rebase a failed read in any of those would commit lazy pages too, a behaviour change outside DirectStorage.
  • The README row describes an internal detail, and the tests sit in a separate #[path] file instead of dstorage.rs's mod tests.

Fine: the tests cover the protection and partial-commit cases. Recommendation: close in favour of #2359 (moving the protection and partial-commit tests there), or rebase onto lazy::ensure limited to the two DirectStorage reads.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7303322039 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7303322039). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:49:28Z. --- Review (head d9a96fd1, diff read, not a merge-check; it conflicts with main, so not built or run): - **Overlaps open #2359**, which closes the same gap with the existing `kernelx::lazy::ensure`. The gap is still on main: the memory source is only checked with `shader::readable` (`dstorage.rs` ~970) and the page array read with `read_own` (~811), neither of which commits lazy pages first. - `prepare_read` adds a second version of `lazy::commit` / `ensure` (`lazy.rs` ~38, ~92) instead of reusing them as `writable()` does (`dstorage.rs` ~868). - On main `read_own` is `pub(crate)` and called from `bvh_want.rs` ~79, `list_x.rs` ~302 / ~2471 and `sparse.rs` ~3500, so after a rebase a failed read in any of those would commit lazy pages too, a behaviour change outside DirectStorage. - The README row describes an internal detail, and the tests sit in a separate `#[path]` file instead of dstorage.rs's `mod tests`. Fine: the tests cover the protection and partial-commit cases. Recommendation: close in favour of #2359 (moving the protection and partial-commit tests there), or rebase onto `lazy::ensure` limited to the two DirectStorage reads. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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/671:upstream-pr/671'
git switch 'upstream-pr/671'

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/671'
git switch 'upstream-pr/671'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/671'
git switch 'upstream-pr/671'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/671'
git switch 'main'
git merge --squash 'upstream-pr/671'
git switch 'main'
git merge --ff-only 'upstream-pr/671'
git switch 'main'
git merge 'upstream-pr/671'
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!666
No description provided.