DirectStorage: read a physical-page list again when its request runs #1405

Manually merged
github merged 1 commit from gh-pr/1405/head into gh-pr/1405/base 2026-11-26 04:53:00 +00:00
Owner

@⁠mgrein on GitHub · 2026-11-24 15:39 UTC · original
mgrein:dstorage-page-lists-at-execution → main · +132 −6 · 2 files · 1 commits · merged 2026-11-25 16:29 UTC

A retail title keeps its DirectStorage destination page lists in slots of its own table and writes a slot's pages after EnqueueRequest. At enqueue, a slot can still name the pages of its previous request. execute() wrote to the snapshot taken then, so the data went into pages the title had since reused. #289 rereads only the entries that are 0 at enqueue (since #509 through read_own), so it does not catch a stale nonzero entry. The console reads the list when it runs the request; this PR does the same, except for a list on the enqueuing thread's stack.

On a new retail game this was more than 16 000 requests per run. The title's own objects got garbage pointers and it crashed about 20 s into world loading, at a different site each run, mostly reads through non-canonical addresses. When the old pages had been freed, the request failed with E_ACCESS_VIOLATION (0x89240009).

What is in it

  • crates/xcl/src/hle/dstorage.rs, execute: the destination page list is read again when the request runs, with read_own as at enqueue. It replaces the snapshot when it differs and every page in it is allocated. #289/#509's reread of 0 entries is unchanged and runs after it.
  • Same file, after review: queue_enqueue_request records whether the list lies on the calling thread's stack (GetCurrentThreadStackLimits), and such a list keeps its snapshot. That memory is reused once the call returns, so a page ID written there since can belong to another live allocation.
  • crates/xcl/src/hle/kernelx.rs: physical_pages_live, true when every page of a list is allocated now.
  • Test a_destination_page_rewritten_after_enqueue: a slot in a heap table names one page at enqueue and another before Submit; the data must land in the second page and leave the first alone. The same list on the test thread's stack, rewritten with the other (live) page, must keep its snapshot. Each case fails without its part of the change.

Tested

  • NVIDIA GeForce RTX 4070 12 GB (32-lane waves), AMD Ryzen 5 5600X, 32 GB RAM, Windows 11 25H2 (build 26200), Rust 1.94.1 MSVC, DXC 1.9.2602.17. Debug for the tests, release for the runs.
  • cargo test --workspace -- --test-threads=4 at bb27ed6 (rebased onto main 3da2abb): 1112 passed, 0 failed, 46 ignored (20 test binaries). SKIPPED (25): 20 GPU subtests that need wave64 (gpu::recomp::lower / lower_dxil program families, gpu_wave32_program_in_wave64_hardware, gpu_geometry_wave32_prefix_count_over_a_mask), 3 wave32 per-lane f16 subtests of lower_dxil::tests (refused: unsupported f16 instructions), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode is off).
  • The test without the stack check: its stack case fails (the data goes to the page written on the stack after enqueue). Without the reread: its heap case fails (checked before the rebase).
  • Earlier, on a local branch (main 47efa2e plus other open PRs, before the stack check), 400 s scripted world-load runs of a new retail game with the same settings:
    • A temporary diagnostic compared each list at enqueue with the list at execution. More than 2 000 requests had a nonzero entry that changed in between by 108 s of one run. All were one-page lists from the title's own table, and the enqueue-time page was an older allocation.
    • Without the change: 7 runs crashed between 118 and 132 s on garbage pointers in the title's objects, each at a different site. One crashed at 177 s, and 4 hung.
    • With the change: 2 runs, no crash in 400 s; the log counted more than 16 000 lists taken at execution.
  • An independent run by @⁠maephisto666 on an RTX 5090 (comment below; their tree, not main + this PR) with this head bb27ed6: "≥ 16 384" lists taken at execution by 124 s, as with the version before the stack check, so the retail title's lists are not on the enqueuing thread's stack. Their measurement, quoted here, not ours.

Regression run

The same title for 100 s on each build, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1, warm shader caches.

main:

xcl-smoke v1
commit: 3da2abb81606df622610e009f0430de99aa9881c
gpu: NVIDIA GeForce RTX 4070
title: 5c412a26
seconds: 100
exit: 0x0
frames shown: 2744 (PresentX 2745)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16238 MB

This PR:

xcl-smoke v1
commit: bb27ed6d661148177e7aa3b77e88735803d9ac12
gpu: NVIDIA GeForce RTX 4070
title: 5c412a26
seconds: 100
exit: 0x0
frames shown: 2757 (PresentX 2757)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16420 MB

Not tested

  • My regression runs do not reach the rewritten lists: the PR run logged no list taken at execution (9 766 DirectStorage requests in 100 s). On current main the title stops before the world load where they happened, with a GPU hang at about 113 s on both builds (DXGI_ERROR_DEVICE_HUNG later), which is unrelated to this change. The stack check against the retail title rests on the independent run above.
  • A list on the heap that the title frees and reuses before its request runs is still read at execution.
  • AMD GPUs, Linux / Wine.
  • Interaction with #549 (holding a half-full queue until Submit): it changes neighbouring lines and would need a rebase whichever lands second.

AI use

  • Claude Code with Claude Opus 5.5: found the cause from the runs' logs and the diagnostic, wrote the change, the stack check after review, the test and this description, and ran the tests and the runs on the hardware above.

🤖 Generated with Claude Code

**@⁠mgrein** on GitHub · 2026-11-24 15:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405) `mgrein:dstorage-page-lists-at-execution` → `main` · +132 −6 · 2 files · 1 commits · merged 2026-11-25 16:29 UTC A retail title keeps its DirectStorage destination page lists in slots of its own table and writes a slot's pages after `EnqueueRequest`. At enqueue, a slot can still name the pages of its previous request. `execute()` wrote to the snapshot taken then, so the data went into pages the title had since reused. #289 rereads only the entries that are `0` at enqueue (since #509 through `read_own`), so it does not catch a stale nonzero entry. The console reads the list when it runs the request; this PR does the same, except for a list on the enqueuing thread's stack. On a new retail game this was more than 16 000 requests per run. The title's own objects got garbage pointers and it crashed about 20 s into world loading, at a different site each run, mostly reads through non-canonical addresses. When the old pages had been freed, the request failed with `E_ACCESS_VIOLATION` (`0x89240009`). **What is in it** - `crates/xcl/src/hle/dstorage.rs`, `execute`: the destination page list is read again when the request runs, with `read_own` as at enqueue. It replaces the snapshot when it differs and every page in it is allocated. #289/#509's reread of `0` entries is unchanged and runs after it. - Same file, after review: `queue_enqueue_request` records whether the list lies on the calling thread's stack (`GetCurrentThreadStackLimits`), and such a list keeps its snapshot. That memory is reused once the call returns, so a page ID written there since can belong to another live allocation. - `crates/xcl/src/hle/kernelx.rs`: `physical_pages_live`, true when every page of a list is allocated now. - Test `a_destination_page_rewritten_after_enqueue`: a slot in a heap table names one page at enqueue and another before `Submit`; the data must land in the second page and leave the first alone. The same list on the test thread's stack, rewritten with the other (live) page, must keep its snapshot. Each case fails without its part of the change. **Tested** - NVIDIA GeForce RTX 4070 12 GB (32-lane waves), AMD Ryzen 5 5600X, 32 GB RAM, Windows 11 25H2 (build 26200), Rust 1.94.1 MSVC, DXC 1.9.2602.17. Debug for the tests, release for the runs. - `cargo test --workspace -- --test-threads=4` at `bb27ed6` (rebased onto `main` `3da2abb`): 1112 passed, 0 failed, 46 ignored (20 test binaries). SKIPPED (25): 20 GPU subtests that need wave64 (`gpu::recomp::lower` / `lower_dxil` program families, `gpu_wave32_program_in_wave64_hardware`, `gpu_geometry_wave32_prefix_count_over_a_mask`), 3 wave32 per-lane f16 subtests of `lower_dxil::tests` (refused: unsupported f16 instructions), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows), `pso_measurement_compiles_an_exact_synthetic_record` (Windows Developer Mode is off). - The test without the stack check: its stack case fails (the data goes to the page written on the stack after enqueue). Without the reread: its heap case fails (checked before the rebase). - Earlier, on a local branch (`main` `47efa2e` plus other open PRs, before the stack check), 400 s scripted world-load runs of a new retail game with the same settings: - A temporary diagnostic compared each list at enqueue with the list at execution. More than 2 000 requests had a nonzero entry that changed in between by 108 s of one run. All were one-page lists from the title's own table, and the enqueue-time page was an older allocation. - Without the change: 7 runs crashed between 118 and 132 s on garbage pointers in the title's objects, each at a different site. One crashed at 177 s, and 4 hung. - With the change: 2 runs, no crash in 400 s; the log counted more than 16 000 lists taken at execution. - An independent run by @⁠maephisto666 on an RTX 5090 (comment below; their tree, not `main` + this PR) with this head `bb27ed6`: "≥ 16 384" lists taken at execution by 124 s, as with the version before the stack check, so the retail title's lists are not on the enqueuing thread's stack. Their measurement, quoted here, not ours. **Regression run** The same title for 100 s on each build, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1`, warm shader caches. main: ``` xcl-smoke v1 commit: 3da2abb81606df622610e009f0430de99aa9881c gpu: NVIDIA GeForce RTX 4070 title: 5c412a26 seconds: 100 exit: 0x0 frames shown: 2744 (PresentX 2745) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16238 MB ``` This PR: ``` xcl-smoke v1 commit: bb27ed6d661148177e7aa3b77e88735803d9ac12 gpu: NVIDIA GeForce RTX 4070 title: 5c412a26 seconds: 100 exit: 0x0 frames shown: 2757 (PresentX 2757) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16420 MB ``` **Not tested** - My regression runs do not reach the rewritten lists: the PR run logged no list taken at execution (9 766 DirectStorage requests in 100 s). On current `main` the title stops before the world load where they happened, with a GPU hang at about 113 s on both builds (`DXGI_ERROR_DEVICE_HUNG` later), which is unrelated to this change. The stack check against the retail title rests on the independent run above. - A list on the heap that the title frees and reuses before its request runs is still read at execution. - AMD GPUs, Linux / Wine. - Interaction with #549 (holding a half-full queue until `Submit`): it changes neighbouring lines and would need a rebase whichever lands second. **AI use** - Claude Code with Claude Opus 5.5: found the cause from the runs' logs and the diagnostic, wrote the change, the stack check after review, the test and this description, and ran the tests and the runs on the hardware above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A retail title keeps its destination page lists in slots of its own
table and writes a slot's pages after EnqueueRequest. At enqueue such a
slot can still name the pages of the slot's previous request, and the
snapshot taken then is what execute() wrote to (#289 rereads only the
entries that are 0). Over 16 000 requests a run were written into pages
the title had since reused: its objects got garbage pointers and it
crashed about 20 s into world loading; when the old pages were freed,
the request failed with E_ACCESS_VIOLATION.

The console reads the list when it runs the request. execute() now
reads it again (through read_own, as the snapshot) and takes it when it
differs and every page in it is allocated (kernelx::physical_pages_live).
A list that was on the enqueuing thread's stack keeps the snapshot: that
memory is reused once the call returns, and a page ID written there
since can belong to another live allocation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:52:58 +00:00
github manually merged commit bb27ed6d66 into gh-pr/1405/base 2026-11-26 04:53:00 +00:00
Author
Owner

@⁠certified-retart on GitHub · 2026-11-24 17:00 UTC · original

Two notes that connect directly to this PR:

  1. This likely explains the world-load assert in #1164 (0x80000003 at game+0x4da6315):

    • +0x4da62d0 is the resource pointer-fixup chunk lookup (src_base <= ptr < src_base + size over the 24-byte { src_base, dst_base, size } entries at rcx + 0x10, trapping on int3 at +0x4da6315 when no chunk matches). All three #1164 crash dumps (including a run with #549 merged and 0 DirectStorage failures) show non-pointer bytes in [rsi] inside a valid destination chunk — the exact failure mode of a reused non-zero page-list slot written after EnqueueRequest.
  2. Remaining auto-submit race in dstorage.rs (DSTORAGE_QUEUE_OPTIONS::AutoSubmitDisabled):

    • In crates/xcl/src/hle/dstorage.rs, factory_create_queue1 (IDStorageFactoryX2::CreateQueue1, slot 10) already logs u64 @0x18 = 1 from the retail title's DSTORAGE_QUEUE_DESC1 and ignores it.
    • Per the Xbox GDK dstorage_xs.h spec, offset 0x18 is DSTORAGE_QUEUE_OPTIONS Options, where bit 0 (0x1) is AutoSubmitDisabled.
    • Because enqueue / enqueue_numbered still auto-submit at capacity / 2, a request enqueued when the queue hits half capacity can reach execute() before the title returns from EnqueueRequest to overwrite the stale non-zero slot and call Submit(). In that window, rereading the list in execute() still sees the old pages.
    • Honoring AutoSubmitDisabled in factory_create_queue1 (skipping the capacity / 2 auto-submit when bit 0 is set) closes that race cleanly for both this PR and #549.

Not tested: live retail run on this branch (static analysis of dstorage.rs, #1164 crash dumps, and GDK docs only).

AI use: Antigravity (gemini-4-neon) analyzed the #1164 crash site, audited dstorage.rs, and drafted this comment; reviewed before posting.

**@⁠certified-retart** on GitHub · 2026-11-24 17:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7138543239) Two notes that connect directly to this PR: 1. **This likely explains the world-load assert in #1164 (`0x80000003` at `game+0x4da6315`):** - `+0x4da62d0` is the resource pointer-fixup chunk lookup (`src_base <= ptr < src_base + size` over the 24-byte `{ src_base, dst_base, size }` entries at `rcx + 0x10`, trapping on `int3` at `+0x4da6315` when no chunk matches). All three #1164 crash dumps (including a run with #549 merged and 0 DirectStorage failures) show non-pointer bytes in `[rsi]` inside a valid destination chunk — the exact failure mode of a reused non-zero page-list slot written after `EnqueueRequest`. 2. **Remaining auto-submit race in `dstorage.rs` (`DSTORAGE_QUEUE_OPTIONS::AutoSubmitDisabled`):** - In `crates/xcl/src/hle/dstorage.rs`, `factory_create_queue1` (`IDStorageFactoryX2::CreateQueue1`, slot 10) already logs `u64 @0x18 = 1` from the retail title's `DSTORAGE_QUEUE_DESC1` and ignores it. - Per the Xbox GDK `dstorage_xs.h` spec, offset `0x18` is `DSTORAGE_QUEUE_OPTIONS Options`, where bit 0 (`0x1`) is `AutoSubmitDisabled`. - Because `enqueue` / `enqueue_numbered` still auto-submit at `capacity / 2`, a request enqueued when the queue hits half capacity can reach `execute()` *before* the title returns from `EnqueueRequest` to overwrite the stale non-zero slot and call `Submit()`. In that window, rereading the list in `execute()` still sees the old pages. - Honoring `AutoSubmitDisabled` in `factory_create_queue1` (skipping the `capacity / 2` auto-submit when bit 0 is set) closes that race cleanly for both this PR and #549. **Not tested:** live retail run on this branch (static analysis of `dstorage.rs`, #1164 crash dumps, and GDK docs only). **AI use:** Antigravity (`gemini-4-neon`) analyzed the #1164 crash site, audited `dstorage.rs`, and drafted this comment; reviewed before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 17:08 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 17:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7138745737) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
Author
Owner

@⁠oz-stanislav-zhukov on GitHub · 2026-11-24 17:39 UTC · original

Test report on GTA VI 1.0.2.1 (Windows, NVIDIA). With this PR, the title's 0x80000003 at +0x4da6315 (#1164) did not come back in two runs. On the same tree without it, the same assert came back in the scene. Only three runs, so this is a data point, not proof.

Tested at 7f15632 cherry-picked onto main 9e3831e (local commit 4491b86), together with other open PRs: #751, #688, #1123, #488, #789 (ported by hand), #1195, #1428 (cf6cc59), #1323, plus two local xg CopyFromSubresource fixes. #549 conflicts with this tree, so it is not in it.

Hardware: NVIDIA GeForce RTX 5060 Ti 16 GB, driver 621.24, Agility SDK 1.620.2. CPU i7-14700KF, 64 GB RAM, Windows 10 22H2 (19045). Rust 1.88.0, release.

Env for all three runs: XCL_HEAP_WINDOWS=1 XCL_PSO_WAIT_MS=50 XCL_GPU_CULPRIT=1 XCL_ACTIVITY=1. I also had local diagnostics on (register memory dump at a crash, a thread dump on a commit jump, a cap on concurrent driver compiles); they don't touch DirectStorage.

run #1405 ended unhandled exception DirectStorage requests / failed
1 no 168 s 0x80000003 at +0x4da6315, rdx=0xaaaaaaaa 110 952 / 0
2 yes 427 s none; I stopped it at 55 GB of commit (see below) 128 255 / 0
3 yes 253 s none; I stopped it at 70 GB of commit 113 358 / 21
  • Run 1: the field the fixup read held 0xaaaaaaaa, and the destination page around it was filled with aaaaaaaa-high qwords. The resource map itself was a normal one (0x50000000 → 0x8823f0000, size 0x1e0000). This matches the stale-page-list explanation in #1164.
  • Earlier runs on main b7aa9f3 with the same stack minus this PR and #680 died within the first minutes of the scene. The sites were different each run: +0x4da6315 twice, plus +0x50705fc, +0x540abf5 and +0x4fdbe43, each reading a garbage pointer (e.g. 0xffffffffffffffff, 0x7243fff448c00be0). That is the pattern the description names.
  • Run 2 reached the world: the HUD (compass, minimap frame, subtitles) is drawn, while the 3D is still black because many pipelines are not built yet. No crash in 427 s.

Not this PR's issue, but it ended both runs: the process commit grows by 5–9 GB per 2 s while the NVIDIA compiler builds big compute pipelines (270–810 KB DXIL in the heap form). It goes from ~32 GB to over 55–70 GB within a minute, and I stopped the runs there. That's tracked in #156 / #1307.

Not tested:

  • this PR alone on main;
  • more than two runs with it;
  • other GPUs and AMD;
  • the full test suite on this tree;
  • scripts/smoke.ps1.

AI use: runs, log analysis and this report by Claude Code (Claude Opus 5.5); posted at the request of the person running the tests.

**@⁠oz-stanislav-zhukov** on GitHub · 2026-11-24 17:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7139524663) Test report on GTA VI 1.0.2.1 (Windows, NVIDIA). With this PR, the title's `0x80000003` at `+0x4da6315` (#1164) did not come back in two runs. On the same tree without it, the same assert came back in the scene. Only three runs, so this is a data point, not proof. **Tested at** `7f15632` cherry-picked onto `main` `9e3831e` (local commit `4491b86`), together with other open PRs: #751, #688, #1123, #488, #789 (ported by hand), #1195, #1428 (`cf6cc59`), #1323, plus two local `xg` CopyFromSubresource fixes. #549 conflicts with this tree, so it is not in it. **Hardware:** NVIDIA GeForce RTX 5060 Ti 16 GB, driver 621.24, Agility SDK 1.620.2. CPU i7-14700KF, 64 GB RAM, Windows 10 22H2 (19045). Rust 1.88.0, release. **Env for all three runs:** `XCL_HEAP_WINDOWS=1 XCL_PSO_WAIT_MS=50 XCL_GPU_CULPRIT=1 XCL_ACTIVITY=1`. I also had local diagnostics on (register memory dump at a crash, a thread dump on a commit jump, a cap on concurrent driver compiles); they don't touch DirectStorage. | run | #1405 | ended | `unhandled exception` | DirectStorage requests / failed | |---|---|---|---|---| | 1 | no | 168 s | `0x80000003` at `+0x4da6315`, `rdx=0xaaaaaaaa` | 110 952 / 0 | | 2 | yes | 427 s | none; I stopped it at 55 GB of commit (see below) | 128 255 / 0 | | 3 | yes | 253 s | none; I stopped it at 70 GB of commit | 113 358 / 21 | - **Run 1:** the field the fixup read held `0xaaaaaaaa`, and the destination page around it was filled with `aaaaaaaa`-high qwords. The resource map itself was a normal one (`0x50000000 → 0x8823f0000`, size `0x1e0000`). This matches the stale-page-list explanation in #1164. - **Earlier runs on `main` `b7aa9f3`** with the same stack minus this PR and #680 died within the first minutes of the scene. The sites were different each run: `+0x4da6315` twice, plus `+0x50705fc`, `+0x540abf5` and `+0x4fdbe43`, each reading a garbage pointer (e.g. `0xffffffffffffffff`, `0x7243fff448c00be0`). That is the pattern the description names. - **Run 2** reached the world: the HUD (compass, minimap frame, subtitles) is drawn, while the 3D is still black because many pipelines are not built yet. No crash in 427 s. **Not this PR's issue, but it ended both runs:** the process commit grows by 5–9 GB per 2 s while the NVIDIA compiler builds big compute pipelines (270–810 KB DXIL in the heap form). It goes from ~32 GB to over 55–70 GB within a minute, and I stopped the runs there. That's tracked in #156 / #1307. **Not tested:** - this PR alone on `main`; - more than two runs with it; - other GPUs and AMD; - the full test suite on this tree; - `scripts/smoke.ps1`. **AI use:** runs, log analysis and this report by Claude Code (Claude Opus 5.5); posted at the request of the person running the tests.
Author
Owner

@⁠tylerstraub on GitHub · 2026-11-24 19:16 UTC · original · edited 2026-11-24 19:18 UTC

I independently tested mgrein’s change at 7f15632 on Linux with Proton Experimental and an RTX 5090 (NVIDIA 595.99.02). I applied it to my instrumented XCL control (f7c412a, resulting local candidate 8787543) so I could observe the destination pages in both runs.

The focused test hle::dstorage::tests::a_destination_page_rewritten_after_enqueue failed on my control. With the change, all 256 expected bytes reached the replacement page and the original page retained its sentinel. The existing physical-page destination/source and queued remapping tests also passed.

On a matched cold-cache story load, 4,934 of 34,610 traced physical-page requests used a destination entry that was already nonzero at enqueue and had changed by execution. This count excludes entries that were zero at enqueue. Both runs opened the same seven story paths, reached loading artwork, then stopped after device removal on a dark screen. The page-selection fix is independently reproducible here. I saw no visible gameplay improvement in this comparison.

I ran the Windows lib-test binary under Proton with the filter a_destination_page_rewritten_after_enqueue --test-threads=1 --nocapture. I used Codex (GPT-6) to run the comparison and prepare this report.

**@⁠tylerstraub** on GitHub · 2026-11-24 19:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7141857879) · edited 2026-11-24 19:18 UTC I independently tested mgrein’s change at `7f15632` on Linux with Proton Experimental and an RTX 5090 (NVIDIA 595.99.02). I applied it to my instrumented XCL control (`f7c412a`, resulting local candidate `8787543`) so I could observe the destination pages in both runs. The focused test `hle::dstorage::tests::a_destination_page_rewritten_after_enqueue` failed on my control. With the change, all 256 expected bytes reached the replacement page and the original page retained its sentinel. The existing physical-page destination/source and queued remapping tests also passed. On a matched cold-cache story load, 4,934 of 34,610 traced physical-page requests used a destination entry that was already nonzero at enqueue and had changed by execution. This count excludes entries that were zero at enqueue. Both runs opened the same seven story paths, reached loading artwork, then stopped after device removal on a dark screen. The page-selection fix is independently reproducible here. I saw no visible gameplay improvement in this comparison. I ran the Windows lib-test binary under Proton with the filter `a_destination_page_rewritten_after_enqueue --test-threads=1 --nocapture`. I used Codex (GPT-6) to run the comparison and prepare this report.
Author
Owner

@⁠3L1A5-1 on GitHub · 2026-11-24 20:56 UTC · original

Test report for 7f15632 on an 8 GB NVIDIA card with 16 GB RAM in the retail title: #1164's assert (+0x4da6315) did not come back in 3 of 3 runs (it ended 1 of 3 runs without this PR), and the runs went 30–170 s further. They now end on running out of memory or on the watchdog.

Tested

  • RTX 2060 SUPER 8 GB (driver 617.14), i5-9400F, 16 GB RAM, fixed 32 GB page file (commit limit 49 GB, 4095 MB coherent window in every run), Windows 11 26300, rustc 1.100.0 MSVC, release. Retail 1.0.2.1, Series X. XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PAGE_BUDGET_MB=3072, A pressed by XCL_PRESS_A_AT=40,45,…,120, 600 s runs.
  • Tree (local, not for upstream): main 930e8b4 + #1182, #1055, #1102, #759, #1273, #1278, #562, #1288, #1515, #640 (5d6fac8), #929 (b3a969b), revert of b8b1f49 (#1307), plus local logging diagnostics. The A/B is that tree with and without this PR (merged cleanly), 3 runs each, back to back on the same evening.
  • cargo test -p xcl --lib -- a_destination_page_rewritten_after_enqueue: 1 passed.
without this PR with this PR
end of run 1 / 2 / 3 262.5 / 331.1 / 363.6 s 393.5 / 502.5 / 415.0 s
how they end xboxbvhbuilder.dll+0x15078 access violation; +0x4da6315 (#1164); watchdog +0x23cf683 list Close → 0x8007000e, title int3 +0x72ac; watchdog +0x23cf683; Close → 0x8007000e, +0x72ac
device removals 0 0
textures mapped again after eviction (#640), at 260 s 2 019 / 1 350 / 1 094 2 090 / 2 522 / 3 125
  • With this PR more evicted textures are mapped again by the same time (row above), and by the end local video memory reaches 9.0–9.25 GB against a DXGI budget of ~7.2 GB. I read the two 0x8007000e ends as this machine's memory limit (in run 1 free RAM was also down to 0.37 GB), not as something this PR breaks, but I haven't shown that.
  • The reread is used a lot here: "32768 page lists written after their request was enqueued" by ~219 s in every run (the line is logged at powers of two).
  • Failed DirectStorage requests (sum of the activity lines' failed) don't drop clearly on this tree: 397 / 28 / 213 without this PR, 1 / 231 / 397 with it. So I can't confirm here the drop @⁠joeypercia measured.

Not tested: this PR alone on main; AMD; Linux.

AI use: Claude Code (Claude Opus 5.5) ran the runs, compared the logs and wrote this.

**@⁠3L1A5-1** on GitHub · 2026-11-24 20:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7144254398) **Test report for `7f15632` on an 8 GB NVIDIA card with 16 GB RAM in the retail title: #1164's assert (`+0x4da6315`) did not come back in 3 of 3 runs (it ended 1 of 3 runs without this PR), and the runs went 30–170 s further. They now end on running out of memory or on the watchdog.** **Tested** - RTX 2060 SUPER 8 GB (driver 617.14), i5-9400F, 16 GB RAM, fixed 32 GB page file (commit limit 49 GB, 4095 MB coherent window in every run), Windows 11 26300, rustc 1.100.0 MSVC, release. Retail 1.0.2.1, Series X. `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PAGE_BUDGET_MB=3072`, A pressed by `XCL_PRESS_A_AT=40,45,…,120`, 600 s runs. - Tree (local, not for upstream): `main` `930e8b4` + #1182, #1055, #1102, #759, #1273, #1278, #562, #1288, #1515, #640 (`5d6fac8`), #929 (`b3a969b`), revert of `b8b1f49` (#1307), plus local logging diagnostics. The A/B is that tree with and without this PR (merged cleanly), 3 runs each, back to back on the same evening. - `cargo test -p xcl --lib -- a_destination_page_rewritten_after_enqueue`: 1 passed. | | without this PR | with this PR | |---|---|---| | end of run 1 / 2 / 3 | 262.5 / 331.1 / 363.6 s | 393.5 / 502.5 / 415.0 s | | how they end | `xboxbvhbuilder.dll+0x15078` access violation; **`+0x4da6315` (#1164)**; watchdog `+0x23cf683` | list `Close` → `0x8007000e`, title int3 `+0x72ac`; watchdog `+0x23cf683`; `Close` → `0x8007000e`, `+0x72ac` | | device removals | 0 | 0 | | textures mapped again after eviction (#640), at 260 s | 2 019 / 1 350 / 1 094 | 2 090 / 2 522 / 3 125 | - With this PR more evicted textures are mapped again by the same time (row above), and by the end local video memory reaches 9.0–9.25 GB against a DXGI budget of ~7.2 GB. I read the two `0x8007000e` ends as this machine's memory limit (in run 1 free RAM was also down to 0.37 GB), not as something this PR breaks, but I haven't shown that. - The reread is used a lot here: "32768 page lists written after their request was enqueued" by ~219 s in every run (the line is logged at powers of two). - Failed DirectStorage requests (sum of the activity lines' `failed`) don't drop clearly on this tree: 397 / 28 / 213 without this PR, 1 / 231 / 397 with it. So I can't confirm here the drop @⁠joeypercia measured. **Not tested:** this PR alone on `main`; AMD; Linux. **AI use:** Claude Code (Claude Opus 5.5) ran the runs, compared the logs and wrote this.
Author
Owner

@⁠joeypercia on GitHub · 2026-11-24 20:45 UTC · original · edited 2026-11-24 20:57 UTC

Where the failures that remain with this PR come from, on an RTX 4070 Ti. I added a local log line to every E_ACCESS_VIOLATION return in dstorage.rs (diagnostic only, not proposed).

Tested: RTX 4070 Ti (driver 616.56), Ryzen 7 7800X3D, 32 GB RAM, Windows 11 Pro 26200, release, retail 1.0.2.1 from an NVMe SSD, XCL_HEAP_WINDOWS=1, A scripted with XCL_PRESS_AT. Tree: main 9e3831e + #1288 + #742 + #1464 + #1448 (with #1321) + the diagnostic, then the same plus this PR (7f15632; its conflict with #1464 resolved by doing this PR's reread first and #1464's wait for zero entries after it).

without this PR with this PR
failed requests (0x89240009) one about every 50 ms from 91.9 s on 4, all between 86.9 s and 87.1 s
refusing check all at the write_physical_pages call of execute (destination physical pages) the same check
"page lists written after their request was enqueued" – 16 384 by 95 s

So the reread fixes nearly all of them here. The few left fail at the same physical-page write, all within 0.2 s on G:\data\ttdb\vfx\ttdb_vfx.ttpf. That fits a list being rewritten at the moment its request runs: the snapshot's pages are already freed, and the current list is not yet entirely live, so neither this PR's reread (all pages live) nor #1464's wait (entries that were 0 at enqueue) applies. That is a reading, not measured: I did not log the page numbers.

Not tested: this PR without #1464; more than one run with each tree; AMD.

AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the title on my machine, and wrote this comment.

Note on comparing counts (re @⁠3L1A5-1's report above): my tree had #1464 as well, and the two fixes cover different entries. #1464 waits for entries that were 0 at enqueue, and this PR rereads entries that were nonzero and changed. A tree without #1464 still fails on late-filled 0 entries, which this PR does not cover. My numbers also come from one run each, counted from the diagnostic's log lines (capped at 64), not from the activity lines' failed sum, so they are not directly comparable with a 3-run total.

**@⁠joeypercia** on GitHub · 2026-11-24 20:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7144009817) · edited 2026-11-24 20:57 UTC Where the failures that remain with this PR come from, on an RTX 4070 Ti. I added a local log line to every `E_ACCESS_VIOLATION` return in `dstorage.rs` (diagnostic only, not proposed). **Tested**: RTX 4070 Ti (driver 616.56), Ryzen 7 7800X3D, 32 GB RAM, Windows 11 Pro 26200, release, retail 1.0.2.1 from an NVMe SSD, `XCL_HEAP_WINDOWS=1`, A scripted with `XCL_PRESS_AT`. Tree: `main` `9e3831e` + #1288 + #742 + #1464 + #1448 (with #1321) + the diagnostic, then the same plus this PR (`7f15632`; its conflict with #1464 resolved by doing this PR's reread first and #1464's wait for zero entries after it). | | without this PR | with this PR | |---|---|---| | failed requests (`0x89240009`) | one about every 50 ms from 91.9 s on | 4, all between 86.9 s and 87.1 s | | refusing check | all at the `write_physical_pages` call of `execute` (destination physical pages) | the same check | | "page lists written after their request was enqueued" | – | 16 384 by 95 s | So the reread fixes nearly all of them here. The few left fail at the same physical-page write, all within 0.2 s on `G:\data\ttdb\vfx\ttdb_vfx.ttpf`. That fits a list being rewritten at the moment its request runs: the snapshot's pages are already freed, and the current list is not yet entirely live, so neither this PR's reread (all pages live) nor #1464's wait (entries that were 0 at enqueue) applies. That is a reading, not measured: I did not log the page numbers. **Not tested**: this PR without #1464; more than one run with each tree; AMD. **AI use**: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the title on my machine, and wrote this comment. **Note on comparing counts** (re @⁠3L1A5-1's report above): my tree had #1464 as well, and the two fixes cover different entries. #1464 waits for entries that were `0` at enqueue, and this PR rereads entries that were nonzero and changed. A tree without #1464 still fails on late-filled `0` entries, which this PR does not cover. My numbers also come from one run each, counted from the diagnostic's log lines (capped at 64), not from the activity lines' `failed` sum, so they are not directly comparable with a 3-run total.
Author
Owner

@⁠jordi-vancuijlenborg-vinci on GitHub · 2026-11-24 21:16 UTC · original · edited 2026-11-24 22:24 UTC

I reproduced the #1164 crash (0x80000003 at +0x4da6315) on Windows 11 with an RTX 3080, on b9b6ea6 with XCL_PSO_WAIT_MS=50. I can test this PR on the same setup. Is there a specific revision or scenario you’d like me to cover?

Update after testing #1405 alone. Both builds hit 0xc0000005 at game+0x23cf683 in the story load. Neither reproduced the earlier #1164 breakpoint. The patched run reread at least 8,192 page lists and recorded zero failed DirectStorage requests in the activity log.

Tested

Windows 11 25H2 (26200.9974), i7-9700F, RTX 3080 10 GB, driver 621.01, Rust 1.100.0 MSVC, release. Control b9b6ea62080cc62fc19e212033372d01c6214e5c. Candidate used the same base with only 7f15632548f0127457877798d291868c967c8ca5 applied (matching Git patch ID).

xcl run <game-folder> on GTA VI 1.0.2.1, Series X, once per build. Both used independent copies of the same save and warm shader cache, XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_PSO_WAIT_MS=50, XCL_PRESS_A_AT=52,65 and XCL_RUN_SECONDS=720.

Build First unhandled exception DirectStorage requests / failed
Control +0x23cf683 at 356.770 s 84,147 / 213
With #1405 +0x23cf683 at 385.457 s 65,818 / 0

Counts are sums of the recorded two-second activity samples. The two runs processed different numbers of requests. Neither logged a D3D12 device removal. Both processes remained alive after the exception and the launcher stopped them at its 765 s deadline. A preliminary control needed a late manual profile selection and is excluded from the comparison.

cargo test --locked --offline --release -p xcl --lib -- --exact hle::dstorage::tests::a_destination_page_rewritten_after_enqueue --nocapture --test-threads=1 on the candidate: 1 passed, 0 failed, 0 ignored, 0 skipped, 862 filtered out.

Not tested

The effect on #1164 remains open on this machine. One matched pair, no full test suite or smoke.ps1 run for this comparison.

OpenAI Codex (GPT-6.2 Sol High) ran the tests and helped draft this comment.

**@⁠jordi-vancuijlenborg-vinci** on GitHub · 2026-11-24 21:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7144714233) · edited 2026-11-24 22:24 UTC I reproduced the #1164 crash (`0x80000003` at `+0x4da6315`) on Windows 11 with an RTX 3080, on `b9b6ea6` with `XCL_PSO_WAIT_MS=50`. I can test this PR on the same setup. Is there a specific revision or scenario you’d like me to cover? **Update after testing #1405 alone.** Both builds hit `0xc0000005` at `game+0x23cf683` in the story load. Neither reproduced the earlier #1164 breakpoint. The patched run reread at least 8,192 page lists and recorded zero failed DirectStorage requests in the activity log. **Tested** Windows 11 25H2 (26200.9974), i7-9700F, RTX 3080 10 GB, driver 621.01, Rust 1.100.0 MSVC, release. Control `b9b6ea62080cc62fc19e212033372d01c6214e5c`. Candidate used the same base with only `7f15632548f0127457877798d291868c967c8ca5` applied (matching Git patch ID). `xcl run <game-folder>` on GTA VI 1.0.2.1, Series X, once per build. Both used independent copies of the same save and warm shader cache, `XCL_NETWORK=0`, `XCL_ACTIVITY=1`, `XCL_PSO_WAIT_MS=50`, `XCL_PRESS_A_AT=52,65` and `XCL_RUN_SECONDS=720`. | Build | First unhandled exception | DirectStorage requests / failed | |---|---|---:| | Control | `+0x23cf683` at 356.770 s | 84,147 / 213 | | With #1405 | `+0x23cf683` at 385.457 s | 65,818 / 0 | Counts are sums of the recorded two-second activity samples. The two runs processed different numbers of requests. Neither logged a D3D12 device removal. Both processes remained alive after the exception and the launcher stopped them at its 765 s deadline. A preliminary control needed a late manual profile selection and is excluded from the comparison. `cargo test --locked --offline --release -p xcl --lib -- --exact hle::dstorage::tests::a_destination_page_rewritten_after_enqueue --nocapture --test-threads=1` on the candidate: 1 passed, 0 failed, 0 ignored, 0 skipped, 862 filtered out. **Not tested** The effect on #1164 remains open on this machine. One matched pair, no full test suite or `smoke.ps1` run for this comparison. OpenAI Codex (GPT-6.2 Sol High) ran the tests and helped draft this comment.
Author
Owner

@⁠jessenic on GitHub · 2026-11-24 23:54 UTC · original

Test report: with this PR (and #1464), the CPU access violations that ended Series S story loads around 90–110 s are gone in 3 of 3 runs, against 6 of 10 runs without them. The same setup and the same warm caches on both sides.

Setup: RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, 32 GB, Windows 11 Pro 26300, rustc 1.97.0, release. Retail title, Series S profile (device_type = "lockhart"), story load with scripted A presses, 400 s per run, XCL_HEAP_WINDOWS=1, all compute pipelines precompiled.

Tree: a local integration branch on b7aa9f3 (#1288, #751, #684, #680, #1315/#1316, #1321, #1110, #495, #242, #615, #1697, #1323), plus local diagnostics that do not touch DirectStorage. One of them, XCL_X_DEAD_STOP=1, was on in every run on both sides: it ends a split-wave64 wave's loops after a meet timeout. Of the 10 runs without this PR, 4 had only that, 3 also had #1143 + #1221, and 3 had #1143 + #1221 + #765. The 3 runs with it had all three, plus this PR's 7f15632 and #1464's 3b7d329 (head b132ead, plus the same uncommitted diagnostics).

runs ended by a title access violation (0xc0000005 in the title or vcruntime140) ended by device removal
without #1405/#1464 10 6 (5 at 101–108 s, 1 at 542 s; a different offset each run) 4
with #1405 + #1464 3 0 3 (110–115 s)
  • The faults this removes: reads through garbage pointers in title objects, at a different offset every run. In one run six title threads faulted in the same millisecond, four of them in memcpy. A disassembly of the fault sites (local, offsets only) showed bad values loaded from whole objects of the wrong kind of data, inside the title's physical-page memory. That matches what this PR describes.
  • The PR's re-read fires a lot here: every run with it logged DirectStorage: 16384 page lists written after their request was enqueued by 93–97 s. The line is logged at powers of two, so it is at least 16,384 per run.
  • The Series X profile without the PRs had no access violations in 2 runs (the Series S profile maps about twice the physical pages).
  • What still ends every run: the GPU stall that is tracked in #505 / #675 (split-wave64 compute programs on 32-lane NVIDIA).

Not tested: #1405 and #1464 separately, so the effect is not split between them; plain main; AMD; Series X with the PRs; more than 3 runs with them. The local diagnostics (XCL_X_DEAD_STOP, a page-event log, #1323's tracer) are not in any PR.

AI use: Claude Code (Claude Opus 5.5) ran the runs on the machine above, analysed the logs and wrote this report.

**@⁠jessenic** on GitHub · 2026-11-24 23:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7147926878) **Test report: with this PR (and #1464), the CPU access violations that ended Series S story loads around 90–110 s are gone in 3 of 3 runs, against 6 of 10 runs without them.** The same setup and the same warm caches on both sides. **Setup:** RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, 32 GB, Windows 11 Pro 26300, rustc 1.97.0, release. Retail title, Series S profile (`device_type = "lockhart"`), story load with scripted A presses, 400 s per run, `XCL_HEAP_WINDOWS=1`, all compute pipelines precompiled. **Tree:** a local integration branch on `b7aa9f3` (#1288, #751, #684, #680, #1315/#1316, #1321, #1110, #495, #242, #615, #1697, #1323), plus local diagnostics that do not touch DirectStorage. One of them, `XCL_X_DEAD_STOP=1`, was on in every run on both sides: it ends a split-wave64 wave's loops after a meet timeout. Of the 10 runs without this PR, 4 had only that, 3 also had #1143 + #1221, and 3 had #1143 + #1221 + #765. The 3 runs with it had all three, plus this PR's `7f15632` and #1464's `3b7d329` (head `b132ead`, plus the same uncommitted diagnostics). | | runs | ended by a title access violation (`0xc0000005` in the title or `vcruntime140`) | ended by device removal | |---|---|---|---| | without #1405/#1464 | 10 | **6** (5 at 101–108 s, 1 at 542 s; a different offset each run) | 4 | | with #1405 + #1464 | 3 | **0** | 3 (110–115 s) | - **The faults this removes:** reads through garbage pointers in title objects, at a different offset every run. In one run six title threads faulted in the same millisecond, four of them in `memcpy`. A disassembly of the fault sites (local, offsets only) showed bad values loaded from whole objects of the wrong kind of data, inside the title's physical-page memory. That matches what this PR describes. - **The PR's re-read fires a lot here:** every run with it logged `DirectStorage: 16384 page lists written after their request was enqueued` by 93–97 s. The line is logged at powers of two, so it is at least 16,384 per run. - **The Series X profile without the PRs** had no access violations in 2 runs (the Series S profile maps about twice the physical pages). - **What still ends every run:** the GPU stall that is tracked in #505 / #675 (split-wave64 compute programs on 32-lane NVIDIA). **Not tested:** #1405 and #1464 separately, so the effect is not split between them; plain `main`; AMD; Series X with the PRs; more than 3 runs with them. The local diagnostics (`XCL_X_DEAD_STOP`, a page-event log, #1323's tracer) are not in any PR. **AI use:** Claude Code (Claude Opus 5.5) ran the runs on the machine above, analysed the logs and wrote this report.
Author
Owner

@⁠CharlyRien on GitHub · 2026-11-25 02:34 UTC · original

Test report on an RTX 3090 with the world running above 1 frame per second: garbage-pointer faults in 8 of 8 runs without this change, 0 of 9 with it. Two things for the PR: it now conflicts with the merged #509, which does not cover this case; and a second fault showed up behind it, in title_textures.

Setup

  • Tree: main 9e3831e merged locally with #1288, #1448, #684, #889, #1323, #929, #640, #1326, #1327, #1329, #1791 (by hand) and three allocator-lifetime commits from wondercrash/xcl (150e635, 761ada5, 9b70233), plus local diagnostics and a local readback change in sparse.rs (one fence per title queue, see #1329). For the last three runs: #509 as merged, then this PR's head 7f15632 rebased onto it by hand (same lines).
  • Run: release, XCL_UMA_SHADOW=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1, warm caches, no XCL_PSO_WAIT_MS, 200 s. With that set the title presents 1.2 – 1.5 world frames per second from about 100 s on, which is what makes the fault systematic here. Local switches: the title's own stall watchdog is neutralised; three compute programs of 4 MB of DXIL or more are not handed to the driver. Windows TdrDelay 30 s.
  • RTX 3090 24 GB (driver 616.56), Ryzen 9 5950X, 32 GB RAM + 32 GB page file, Windows 11 22631.

Results

runs title faults on a bad pointer world frames per second
snapshot kept (as 9e3831e) 8 8 (118 – 183 s, a different site each run: +0x4da6315 int3, +0x4ed80c0, +0x54e9d82, +0x4e8b4be in 8 threads, a memcpy, …) 1.2 – 1.6 until the fault
list re-read at execution (a local equivalent of this PR) 6 0 1.30 – 1.53
#509 + this PR rebased onto it 3 0 (three clean 200 s runs) 1.19 – 1.40

More than 16 384 destination lists per run differ from their enqueue-time snapshot, from 21.6 s on.

Evidence for the mechanism (local page-history log of every map / unmap / DirectStorage write per 64 KiB page, dumped at the fault): in a snapshot run the faulting object's page shows 165.5872 map-from-home, then 167.1743 a 64 KiB DirectStorage write whose list had changed since enqueue, then nothing until the fault at 183.0 s on a pointer loaded from that page (0xaaaaaaaa7c1f83ff). The bytes are streamed asset data, not GPU-written: these pages are in the title's reservation outside the unified-memory windows.

About #509 (merged): it makes the late re-read of entries that were 0 at enqueue fault-safe. It does not re-read a nonzero entry the title rewrote after enqueue, which is the case here, so main still has this crash; this PR needs a rebase onto it (the conflict is in the same lines of execute).

A second fault behind it, not covered by this PR: once the title survives, one run in six died inside XCL in title_textures::refresh at 159 s, reading in place a page that another title thread had unmapped 2 ms earlier (shown by the same page history). shader::readable says yes for the whole window. Reading in place only in the coherent window and copying through ReadProcessMemory elsewhere removed it in the 6 runs since, at the same frame rate. I can post that diff (65 lines) or open an issue if preferred.

Not tested: the PR's unit test, #1464, AMD, runs without XCL_UMA_SHADOW (the DirectStorage and kernelx code has no dependence on it), current main.

AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the page-history log and the runs) did this and drafted the report.

**@⁠CharlyRien** on GitHub · 2026-11-25 02:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7150898002) **Test report on an RTX 3090 with the world running above 1 frame per second: garbage-pointer faults in 8 of 8 runs without this change, 0 of 9 with it. Two things for the PR: it now conflicts with the merged #509, which does not cover this case; and a second fault showed up behind it, in `title_textures`.** **Setup** - Tree: `main` `9e3831e` merged locally with #1288, #1448, #684, #889, #1323, #929, #640, #1326, #1327, #1329, #1791 (by hand) and three allocator-lifetime commits from `wondercrash/xcl` (`150e635`, `761ada5`, `9b70233`), plus local diagnostics and a local readback change in `sparse.rs` (one fence per title queue, see #1329). For the last three runs: #509 as merged, then this PR's head `7f15632` rebased onto it by hand (same lines). - Run: release, `XCL_UMA_SHADOW=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0 XCL_ACTIVITY=1`, warm caches, no `XCL_PSO_WAIT_MS`, 200 s. With that set the title presents 1.2 – 1.5 world frames per second from about 100 s on, which is what makes the fault systematic here. Local switches: the title's own stall watchdog is neutralised; three compute programs of 4 MB of DXIL or more are not handed to the driver. Windows `TdrDelay` 30 s. - RTX 3090 24 GB (driver 616.56), Ryzen 9 5950X, 32 GB RAM + 32 GB page file, Windows 11 22631. **Results** | | runs | title faults on a bad pointer | world frames per second | |---|---|---|---| | snapshot kept (as `9e3831e`) | 8 | 8 (118 – 183 s, a different site each run: `+0x4da6315` int3, `+0x4ed80c0`, `+0x54e9d82`, `+0x4e8b4be` in 8 threads, a `memcpy`, …) | 1.2 – 1.6 until the fault | | list re-read at execution (a local equivalent of this PR) | 6 | 0 | 1.30 – 1.53 | | #509 + this PR rebased onto it | 3 | 0 (three clean 200 s runs) | 1.19 – 1.40 | More than 16 384 destination lists per run differ from their enqueue-time snapshot, from 21.6 s on. **Evidence for the mechanism** (local page-history log of every map / unmap / DirectStorage write per 64 KiB page, dumped at the fault): in a snapshot run the faulting object's page shows `165.5872 map-from-home`, then `167.1743` a 64 KiB DirectStorage write whose list had changed since enqueue, then nothing until the fault at 183.0 s on a pointer loaded from that page (`0xaaaaaaaa7c1f83ff`). The bytes are streamed asset data, not GPU-written: these pages are in the title's reservation outside the unified-memory windows. **About #509** (merged): it makes the late re-read of entries that were `0` at enqueue fault-safe. It does not re-read a nonzero entry the title rewrote after enqueue, which is the case here, so `main` still has this crash; this PR needs a rebase onto it (the conflict is in the same lines of `execute`). **A second fault behind it, not covered by this PR**: once the title survives, one run in six died inside XCL in `title_textures::refresh` at 159 s, reading in place a page that another title thread had unmapped 2 ms earlier (shown by the same page history). `shader::readable` says yes for the whole window. Reading in place only in the coherent window and copying through `ReadProcessMemory` elsewhere removed it in the 6 runs since, at the same frame rate. I can post that diff (65 lines) or open an issue if preferred. **Not tested**: the PR's unit test, #1464, AMD, runs without `XCL_UMA_SHADOW` (the DirectStorage and kernelx code has no dependence on it), current `main`. **AI use**: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the page-history log and the runs) did this and drafted the report.
Author
Owner

@⁠maephisto666 on GitHub · 2026-11-25 03:33 UTC · original

Test report: retail 1.0.2.1 on an RTX 5090 (Windows), #1405 at bb27ed6 and at 7f15632 on a local tree. One failed DirectStorage request per run, the same as a different fix of mine for the same bug. I am dropping mine: this PR covers it. Not a main + #1405 run.

Tested

  • Hardware: NVIDIA GeForce RTX 5090 (driver 32.0.16.2124), Ryzen 9 9950X3D, 64 GB; Windows 11 26100; rustc 1.100.0 MSVC, release.
  • Tree: main 4e3515e + #751, #433, #789, #759 (rebased) and local diagnostics. This PR's diff applies on it without changes, at 7f15632 and at bb27ed6.
  • cargo test -p xcl --lib --release dstorage with bb27ed6: 30 passed, 0 failed, 0 ignored. I did not run the whole suite on this tree.
  • Retail 1.0.2.1, offline, fresh title data, warm caches, no input after the first-boot screens, XCL_PSO_WAIT_MS=50. One run each.
a fix of mine instead of this PR #1405 7f15632 #1405 bb27ed6
failed DirectStorage requests 2 (0x89240009, 119–120 s) 1 (0x89240009, 122 s) 1 (0x89240009, 120 s)
page lists taken as written at execution (the PR's log line, at powers of two) – ≥ 16 384 by 127.6 s ≥ 16 384 by 123.9 s
end device hung at 158.8 s device hung at ~163 s device hung at 157.7 s
  • Earlier runs of mine on an older tree, with neither fix, had 330–1 300 failed requests in one burst, so on this setup most of the failures were the stale-list case this PR handles.
  • The three runs end the same way: the driver logs SKEDCHECK23_CONSTANT_BUFFER_SIZE failed, then Illegal Instruction Encoding on many SMs. It is the same with my fix, so it is not caused by this PR. I am looking into it separately.
  • Skipped work was the same on all three: 1 024 draws and 26–64 dispatches by ~155 s.

Not tested

  • main + #1405 alone, so no xcl-smoke pair from me.
  • The whole suite on this tree.
  • AMD; the Series S profile.
  • More than one run per build.
  • Whether the remaining failed request comes from a list on the stack (the case bb27ed6 keeps as snapshotted) or from somewhere else: not examined.

AI use: Claude Code (Claude Opus 5.5) applied the patches, ran the builds, tests and runs, read the logs and wrote this report. The numbers come from those runs.

**@⁠maephisto666** on GitHub · 2026-11-25 03:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7152023250) **Test report: retail 1.0.2.1 on an RTX 5090 (Windows), #1405 at `bb27ed6` and at `7f15632` on a local tree. One failed DirectStorage request per run, the same as a different fix of mine for the same bug. I am dropping mine: this PR covers it. Not a `main` + #1405 run.** **Tested** - Hardware: NVIDIA GeForce RTX 5090 (driver 32.0.16.2124), Ryzen 9 9950X3D, 64 GB; Windows 11 26100; rustc 1.100.0 MSVC, release. - Tree: `main` `4e3515e` + #751, #433, #789, #759 (rebased) and local diagnostics. This PR's diff applies on it without changes, at `7f15632` and at `bb27ed6`. - `cargo test -p xcl --lib --release dstorage` with `bb27ed6`: **30 passed, 0 failed, 0 ignored**. I did not run the whole suite on this tree. - Retail 1.0.2.1, offline, fresh title data, warm caches, no input after the first-boot screens, `XCL_PSO_WAIT_MS=50`. One run each. | | a fix of mine instead of this PR | #1405 `7f15632` | #1405 `bb27ed6` | |---|---|---|---| | failed DirectStorage requests | 2 (`0x89240009`, 119–120 s) | 1 (`0x89240009`, 122 s) | 1 (`0x89240009`, 120 s) | | page lists taken as written at execution (the PR's log line, at powers of two) | – | ≥ 16 384 by 127.6 s | ≥ 16 384 by 123.9 s | | end | device hung at 158.8 s | device hung at ~163 s | device hung at 157.7 s | - Earlier runs of mine on an older tree, with neither fix, had 330–1 300 failed requests in one burst, so on this setup most of the failures were the stale-list case this PR handles. - The three runs end the same way: the driver logs `SKEDCHECK23_CONSTANT_BUFFER_SIZE failed`, then `Illegal Instruction Encoding` on many SMs. It is the same with my fix, so it is not caused by this PR. I am looking into it separately. - Skipped work was the same on all three: 1 024 draws and 26–64 dispatches by ~155 s. **Not tested** - `main` + #1405 alone, so no `xcl-smoke` pair from me. - The whole suite on this tree. - AMD; the Series S profile. - More than one run per build. - Whether the remaining failed request comes from a list on the stack (the case `bb27ed6` keeps as snapshotted) or from somewhere else: not examined. **AI use:** Claude Code (Claude Opus 5.5) applied the patches, ran the builds, tests and runs, read the logs and wrote this report. The numbers come from those runs.
Author
Owner

@⁠shortside on GitHub · 2026-11-25 09:42 UTC · original

Test report from macOS (CrossOver, D3DMetal): the garbage-pointer crashes in world loading are gone with this change, 0 of 3 runs against 3 of 6 without it.

Tested

  • MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, Rosetta 2; CrossOver 26.3, D3DMetal; release, cross-built for x86_64-pc-windows-msvc.
  • Tree: @⁠Ahmet-Dedeler's Mac port mac7 (dbd9d09, on main 930e8b4) with #615 and two branches of mine (see #258). This PR does not apply there (dstorage.rs has moved on), so I ported its change by hand: the reread in execute, on_callers_stack, the dest_on_stack flag and physical_pages_live. Not its unit test.
  • The retail title, Series S profile, a warm data root, the same scripted pad presses, 330 s per run, default settings.
  • Without the change: 6 runs, 3 ended between 158 and 169 s with the title reading through garbage pointers out of its streaming pool (a different site each time), 3 reached world entry.
  • With it: 3 runs, none ended that way. Each logged "16384 page lists written after their request was enqueued" or more, and each reached world entry at about 170 s, where this host stops for another reason (a compute program of XboxBvhBuilder.dll, see #258).

Not tested

  • The PR's own commit on main; Windows; its unit test; any other title.

AI use

  • Claude Code with Claude Fable 5.2 ported the change, ran the runs and wrote this report on my machine.
**@⁠shortside** on GitHub · 2026-11-25 09:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7158698893) Test report from macOS (CrossOver, D3DMetal): the garbage-pointer crashes in world loading are gone with this change, 0 of 3 runs against 3 of 6 without it. **Tested** - MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, Rosetta 2; CrossOver 26.3, D3DMetal; release, cross-built for `x86_64-pc-windows-msvc`. - Tree: @⁠Ahmet-Dedeler's Mac port `mac7` (`dbd9d09`, on `main` `930e8b4`) with #615 and two branches of mine (see #258). This PR does not apply there (`dstorage.rs` has moved on), so I ported its change by hand: the reread in `execute`, `on_callers_stack`, the `dest_on_stack` flag and `physical_pages_live`. Not its unit test. - The retail title, Series S profile, a warm data root, the same scripted pad presses, 330 s per run, default settings. - Without the change: 6 runs, 3 ended between 158 and 169 s with the title reading through garbage pointers out of its streaming pool (a different site each time), 3 reached world entry. - With it: 3 runs, none ended that way. Each logged "16384 page lists written after their request was enqueued" or more, and each reached world entry at about 170 s, where this host stops for another reason (a compute program of `XboxBvhBuilder.dll`, see #258). **Not tested** - The PR's own commit on `main`; Windows; its unit test; any other title. **AI use** - Claude Code with Claude Fable 5.2 ported the change, ran the runs and wrote this report on my machine.
Author
Owner

@⁠4usphs on GitHub · 2026-11-25 11:52 UTC · original

AMD run on the exact head bb27ed6 (bb27ed6d66), as pushed on its base 3da2abb (not merged onto current main), on two AMD adapters with native 64-lane waves: RDNA4 and the console's generation, RDNA2.

Tested

  • Ryzen 7 9800X3D, Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug, clean checkout, XCL_TRANSLATED_CACHE=0; adapter picked with XCL_ADAPTER.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:
    • AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: 1110 passed, 2 failed, 46 ignored
    • AMD Radeon(TM) Graphics, the 9800X3D's iGPU (RDNA2, gfx1036), driver 32.0.21045.29003: 1111 passed, 1 failed, 46 ignored
  • SKIPPED on both: the per-lane-form subcases of lower_dxil::tests::f16_programs_on_the_gpu / f32_programs_on_the_gpu (refused), pso_measurement_compiles_an_exact_synthetic_record (driver cache), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows). No no wave64 skips.
  • This PR's test a_destination_page_rewritten_after_enqueue runs and passes on both adapters.
  • The failures are the AMD fuzz seeds of #2115, not this PR: RX 9070 XT fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599; iGPU fuzz_validate_and_gpu_1 seed 540. cargo test -p xcl --lib gpu::dxil::fuzz_tests on the base 3da2abb fails the same way on each adapter (same seeds, same values).

Not tested

  • smoke or a retail title (I have none), a release build, Linux.

AI use

  • Claude Code (Claude Opus 5.5) read the diff, ran the tests and the base-commit controls on my PC and wrote this report. I have not reviewed the code.
**@⁠4usphs** on GitHub · 2026-11-25 11:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7161624576) AMD run on the exact head `bb27ed6` (bb27ed6d661148177e7aa3b77e88735803d9ac12), as pushed on its base `3da2abb` (not merged onto current `main`), on two AMD adapters with native 64-lane waves: RDNA4 and the console's generation, RDNA2. **Tested** - Ryzen 7 9800X3D, Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug, clean checkout, `XCL_TRANSLATED_CACHE=0`; adapter picked with `XCL_ADAPTER`. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: - AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: **1110 passed, 2 failed, 46 ignored** - AMD Radeon(TM) Graphics, the 9800X3D's iGPU (RDNA2, `gfx1036`), driver 32.0.21045.29003: **1111 passed, 1 failed, 46 ignored** - `SKIPPED` on both: the per-lane-form subcases of `lower_dxil::tests::f16_programs_on_the_gpu` / `f32_programs_on_the_gpu` (refused), `pso_measurement_compiles_an_exact_synthetic_record` (driver cache), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). No `no wave64` skips. - This PR's test `a_destination_page_rewritten_after_enqueue` runs and passes on both adapters. - The failures are the AMD fuzz seeds of #2115, not this PR: RX 9070 XT `fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599; iGPU `fuzz_validate_and_gpu_1` seed 540. `cargo test -p xcl --lib gpu::dxil::fuzz_tests` on the base `3da2abb` fails the same way on each adapter (same seeds, same values). **Not tested** - smoke or a retail title (I have none), a release build, Linux. **AI use** - Claude Code (Claude Opus 5.5) read the diff, ran the tests and the base-commit controls on my PC and wrote this report. I have not reviewed the code.
Author
Owner

@⁠xpatfussy69x on GitHub · 2026-11-25 11:57 UTC · original

Test report for head bb27ed6 as pushed (not merged onto current main) – NVIDIA, wave32.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 1112 passed, 0 failed, 46 ignored
  • SKIPPED GPU tests on this adapter: 24 – 20 × no wave64, 1 × no heap windows, 3 × wave32 per-lane form refused (V_CVT_F16_F32 / V_MUL_F16 / V_PK_MUL_F16 – the per-lane form's DIFFERS_ON_1426 list, unrelated to this PR)
  • this PR's test a_destination_page_rewritten_after_enqueue ran and passed
  • no XCL_SAMPLE_* data set (game-data tests not run)

Not tested

  • DirectStorage reads from a title; AMD / native wave64; release build; the head merged onto current main

AI use

  • Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
**@⁠xpatfussy69x** on GitHub · 2026-11-25 11:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7161740838) Test report for head `bb27ed6` as pushed (not merged onto current `main`) – NVIDIA, wave32. **Tested** - NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5 - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 1112 passed, 0 failed, 46 ignored - SKIPPED GPU tests on this adapter: 24 – 20 × no wave64, 1 × no heap windows, 3 × wave32 per-lane form refused (V_CVT_F16_F32 / V_MUL_F16 / V_PK_MUL_F16 – the per-lane form's `DIFFERS_ON_1426` list, unrelated to this PR) - this PR's test `a_destination_page_rewritten_after_enqueue` ran and passed - no `XCL_SAMPLE_*` data set (game-data tests not run) **Not tested** - DirectStorage reads from a title; AMD / native wave64; release build; the head merged onto current `main` **AI use** - Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
Author
Owner

@⁠ClosetPie107 on GitHub · 2026-11-25 12:28 UTC · original · edited 2026-11-25 15:05 UTC

Linux / AMD RDNA4 (RADV) test report for head bb27ed6 merged locally onto main 1a0bbe3 (clean merge).

Environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton v3.1 (#257 + dxil-spirv 53aac418) for unit tests; vkd3d-proton master ec207194 (3.2.0) + dxil-spirv 694cc674 + relaxed-vtable patch (-Db_ndebug=true) for the retail A/B below; DXVK v3.1.1-209, DXC 1.9.2609.5, x86_64-pc-windows-gnu cross-compile

Tested (debug test binary under Wine, --test-threads=1 --nocapture)

  • hle::dstorage::tests: 19 passed, 0 failed, 0 ignored, 0 skipped (0.15 s), including a_destination_page_rewritten_after_enqueue and a_destination_page_filled_in_after_enqueue.

Retail title (1.0.2.1) A/B on main 06c9f55 + #2306 (XCL_TEXTURE_LEVEL_PAGES=1)
Same warm PSO/vkd3d cache and flags (XCL_DIRECT_DXIL=1, XCL_PSO_WAIT_MS=50, XCL_SPLIT_MIDLIST_WAIT=0, XCL_COHERENT_MB=1024, VKD3D_CONFIG=ignore_shared_fence, XCL_PSO_PRELOAD=0, XCL_NETWORK=0), single run each:

  • Without #1405: crashed at 111 s with 0x80000003 at game_scarlett_master.exe+0x4da6315 (#1164 / #2140), after 49,111 draws / 114,950 dispatches.
  • With #1405 (bb27ed6): no +0x4da6315 crash — ran cleanly to 302 s (exit=0, stopped by our 2 GiB host RAM guard), reaching 81,435 draws, 341,544 dispatches, 14,862 chained split-compute dispatches, and world-scene graphics PSOs (#3457–#3470), with 0 crashes and 0 device removals.

Not tested: full workspace suite, repeated multi-run statistics for +0x4da6315, native Windows.

AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests and retail A/B on this machine, and drafted this report.

**@⁠ClosetPie107** on GitHub · 2026-11-25 12:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7162414839) · edited 2026-11-25 15:05 UTC Linux / AMD RDNA4 (RADV) test report for head `bb27ed6` merged locally onto `main` `1a0bbe3` (clean merge). **Environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS - Proton Experimental (`experimental-11.0-20261112`), vkd3d-proton v3.1 (`#257` + `dxil-spirv` `53aac418`) for unit tests; `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `694cc674` + relaxed-vtable patch (`-Db_ndebug=true`) for the retail A/B below; DXVK `v3.1.1-209`, DXC `1.9.2609.5`, `x86_64-pc-windows-gnu` cross-compile **Tested** (debug test binary under Wine, `--test-threads=1 --nocapture`) - `hle::dstorage::tests`: **19 passed, 0 failed, 0 ignored, 0 skipped** (0.15 s), including `a_destination_page_rewritten_after_enqueue` and `a_destination_page_filled_in_after_enqueue`. **Retail title (1.0.2.1) A/B on `main` `06c9f55` + `#2306` (`XCL_TEXTURE_LEVEL_PAGES=1`)** Same warm PSO/vkd3d cache and flags (`XCL_DIRECT_DXIL=1`, `XCL_PSO_WAIT_MS=50`, `XCL_SPLIT_MIDLIST_WAIT=0`, `XCL_COHERENT_MB=1024`, `VKD3D_CONFIG=ignore_shared_fence`, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`), single run each: - **Without `#1405`:** crashed at **111 s** with `0x80000003` at `game_scarlett_master.exe+0x4da6315` (`#1164` / `#2140`), after `49,111` draws / `114,950` dispatches. - **With `#1405` (`bb27ed6`):** **no `+0x4da6315` crash** — ran cleanly to **302 s** (`exit=0`, stopped by our 2 GiB host RAM guard), reaching **81,435 draws**, **341,544 dispatches**, **14,862 chained split-compute dispatches**, and world-scene graphics PSOs (`#3457`–`#3470`), with **0 crashes and 0 device removals**. **Not tested:** full workspace suite, repeated multi-run statistics for `+0x4da6315`, native Windows. **AI use:** T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests and retail A/B on this machine, and drafted this report.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 16:29 UTC · original

Merged into main (65fc114), no conflicts.

  • Tested: AMD RDNA4, Windows, DXC 1.8.2502.11, merged tree: suite 1279 passed, 2 failed (#2115, as on main), 46 ignored.
  • In a title: a retail title in Series S mode (a tree with other open PRs): more than 16 000 stale page lists re-read in the first 70 s. The run before it crashed while the world loaded, reading through non-canonical pointers as you describe; with this PR it got to rendering the world and later ended otherwise, so I cannot say it was the only cause.
  • For #2307 / #2308: physical_pages_live asks page_home, which does not know the aliasing form's pages, so with XCL_PAGE_ALIAS=1 the new branch never runs. Your test fails there until the check asks the alias table (it passes in my tree that does).

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 16:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7168063270) Merged into `main` (`65fc114`), no conflicts. - **Tested:** AMD RDNA4, Windows, DXC 1.8.2502.11, merged tree: suite 1279 passed, 2 failed (#2115, as on `main`), 46 ignored. - **In a title:** a retail title in Series S mode (a tree with other open PRs): more than 16 000 stale page lists re-read in the first 70 s. The run before it crashed while the world loaded, reading through non-canonical pointers as you describe; with this PR it got to rendering the world and later ended otherwise, so I cannot say it was the only cause. - **For #2307 / #2308:** `physical_pages_live` asks `page_home`, which does not know the aliasing form's pages, so with `XCL_PAGE_ALIAS=1` the new branch never runs. Your test fails there until the check asks the alias table (it passes in my tree that does). AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this on the maintainer's behalf.
Author
Owner

@⁠humsterbumster on GitHub · 2026-11-25 17:02 UTC · original

A Linux/NVIDIA data point for this, alongside #2140.

Box: RTX 5090 32 GB, driver 620.73.04, Wine 11 / Proton 11, vkd3d-proton master ec20719 (3.2.0 + the two-hunk relaxed-vtable change, -Db_ndebug=true), XCL main 3f4495a, retail title 1.0.2.1, cold profile, one A press.

Without this PR: D3D12 device removed: 0x887a0005 at 349 s, one log line after 1 writes after the GPU so far done although their queue had not got there after 10000 ms (fence at 4741, wanted 4742).
With this PR and #684: no device removal in 684 s (run stopped by hand), and 16 DirectStorage: N page lists written after their request was enqueued: the pages named at execution are used lines in the log.

It is not a cure on its own: a third leg carrying this PR plus #541 and #1803 still lost the device at 344 s. But it is the one difference between the 684 s run and the 349 s run on the same machine, and the page-list re-reads it logs are the behaviour the doc comment says the title relies on.

AI-assisted (omp / DeepSeek V4.1 Flash 1017), nv-linux class. No game data attached.

**@⁠humsterbumster** on GitHub · 2026-11-25 17:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7168909910) A Linux/NVIDIA data point for this, alongside #2140. Box: RTX 5090 32 GB, driver 620.73.04, Wine 11 / Proton 11, vkd3d-proton master `ec20719` (3.2.0 + the two-hunk relaxed-vtable change, `-Db_ndebug=true`), XCL `main` `3f4495a`, retail title 1.0.2.1, cold profile, one A press. Without this PR: `D3D12 device removed: 0x887a0005` at 349 s, one log line after `1 writes after the GPU so far done although their queue had not got there after 10000 ms (fence at 4741, wanted 4742)`. With this PR and #684: **no device removal in 684 s** (run stopped by hand), and 16 `DirectStorage: N page lists written after their request was enqueued: the pages named at execution are used` lines in the log. It is not a cure on its own: a third leg carrying this PR plus #541 and #1803 still lost the device at 344 s. But it is the one difference between the 684 s run and the 349 s run on the same machine, and the page-list re-reads it logs are the behaviour the doc comment says the title relies on. *AI-assisted (omp / DeepSeek V4.1 Flash 1017), nv-linux class. No game data attached.*
Author
Owner

@⁠Dezmonius on GitHub · 2026-11-25 18:38 UTC · original

RTX 5070 verification of #1405

The exact PR head used at least 16,384 execution-time destination page lists during a retail title run. The 0x89240009 requests still occurred, and both builds stopped presenting at the same loading illustration.

Tested

  • Parent 3da2abb81606df622610e009f0430de99aa9881c and exact PR head bb27ed6d661148177e7aa3b77e88735803d9ac12. Release builds from the unmodified commit snapshots with separate Cargo target directories.
  • RTX 5070 12 GiB, NVIDIA 610.88 (32.0.16.1088), Core i7-7700K, 32 GiB RAM, Windows 10 Home build 19045, Rust 1.100.0 MSVC.
  • cargo test --locked --offline --release -j 4 -p xcl --lib hle::dstorage:: -- --show-output --test-threads=1: parent 30 passed, 0 failed, 0 ignored. PR 31 passed, 0 failed, 0 ignored. The added a_destination_page_rewritten_after_enqueue passed. No skips reported by either run.
  • Retail title 1.0.2.1 on 2026-11-25. One run per build, parent then PR, via the local harness invoking xcl run <retail-title-folder>. Both used the same 420 s internal timer, independent copies of the same starting profile and warm DXIL cache, the same scripted A presses, Direct DXIL, heap windows, sparse coherent heaps (sparse:16), two DXC threads, PSO preload off, DRED enabled and XCL networking disabled.
Build Timer exit (wall time) PresentX calls Last Present window Sampled DirectStorage requests / failures Min. available RAM
Parent 0x0 (425.2 s) 824 ~192 s 87,662 / 2,047 3.96 GiB
PR 0x0 (425.3 s) 828 ~186 s 87,845 / 2,062 4.43 GiB

The first logged request failure was 0x89240009 on both builds. Both ran to the timer without resuming presentation. The last saved frame was a loading illustration on each build. The logs showed no D3D12 device removal, DRED page fault or unhandled CPU exception.

Not tested

  • Full workspace suite, combined behavior with #1464, and which check returned the remaining request failures. This is one pair on one machine with a shared system driver cache. The prologue was not observed.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable in this session) built the snapshots, ran the tests and title pair, checked the logs and saved frames, and wrote the report.

**@⁠Dezmonius** on GitHub · 2026-11-25 18:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7171184740) **RTX 5070 verification of #1405** The exact PR head used at least 16,384 execution-time destination page lists during a retail title run. The `0x89240009` requests still occurred, and both builds stopped presenting at the same loading illustration. **Tested** - Parent `3da2abb81606df622610e009f0430de99aa9881c` and exact PR head `bb27ed6d661148177e7aa3b77e88735803d9ac12`. Release builds from the unmodified commit snapshots with separate Cargo target directories. - RTX 5070 12 GiB, NVIDIA 610.88 (32.0.16.1088), Core i7-7700K, 32 GiB RAM, Windows 10 Home build 19045, Rust 1.100.0 MSVC. - `cargo test --locked --offline --release -j 4 -p xcl --lib hle::dstorage:: -- --show-output --test-threads=1`: parent 30 passed, 0 failed, 0 ignored. PR 31 passed, 0 failed, 0 ignored. The added `a_destination_page_rewritten_after_enqueue` passed. No skips reported by either run. - Retail title 1.0.2.1 on 2026-11-25. One run per build, parent then PR, via the local harness invoking `xcl run <retail-title-folder>`. Both used the same 420 s internal timer, independent copies of the same starting profile and warm DXIL cache, the same scripted A presses, Direct DXIL, heap windows, sparse coherent heaps (`sparse:16`), two DXC threads, PSO preload off, DRED enabled and XCL networking disabled. | Build | Timer exit (wall time) | PresentX calls | Last Present window | Sampled DirectStorage requests / failures | Min. available RAM | | --- | --- | ---: | ---: | ---: | ---: | | Parent | `0x0` (425.2 s) | 824 | ~192 s | 87,662 / 2,047 | 3.96 GiB | | PR | `0x0` (425.3 s) | 828 | ~186 s | 87,845 / 2,062 | 4.43 GiB | The first logged request failure was `0x89240009` on both builds. Both ran to the timer without resuming presentation. The last saved frame was a loading illustration on each build. The logs showed no D3D12 device removal, DRED page fault or unhandled CPU exception. **Not tested** - Full workspace suite, combined behavior with #1464, and which check returned the remaining request failures. This is one pair on one machine with a shared system driver cache. The prologue was not observed. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable in this session) built the snapshots, ran the tests and title pair, checked the logs and saved frames, and wrote the report.
@ -930,0 +945,4 @@
let pages = if !dest_on_stack
&& read_own(r.destination as usize, current.as_mut_ptr() as *mut u8, std::mem::size_of_val(pages))
&& current[..] != pages[..]
&& crate::hle::kernelx::physical_pages_live(&current)
Author
Owner

@⁠gut0to on GitHub · 2026-11-24 19:05 UTC · original

This proves only that the replacement page IDs are currently allocated; it does not prove the list is a persistent title table. If a stack-backed list is overwritten after enqueue with the ID of another still-live allocation, read_own succeeds and this check redirects the request from the snapshotted page p1 to unrelated page p2, potentially corrupting its owner. This conflicts with the stated fallback for overwritten stack arrays. Could the late reread require a positively identified persistent page-table range, and otherwise keep the snapshot? AI-assisted review; I verified this with the existing page-list flow.

**@⁠gut0to** on GitHub · 2026-11-24 19:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#discussion_r4685113175) This proves only that the replacement page IDs are currently allocated; it does not prove the list is a persistent title table. If a stack-backed list is overwritten after enqueue with the ID of another still-live allocation, `read_own` succeeds and this check redirects the request from the snapshotted page `p1` to unrelated page `p2`, potentially corrupting its owner. This conflicts with the stated fallback for overwritten stack arrays. Could the late reread require a positively identified persistent page-table range, and otherwise keep the snapshot? AI-assisted review; I verified this with the existing page-list flow.
@ -930,0 +945,4 @@
let pages = if !dest_on_stack
&& read_own(r.destination as usize, current.as_mut_ptr() as *mut u8, std::mem::size_of_val(pages))
&& current[..] != pages[..]
&& crate::hle::kernelx::physical_pages_live(&current)
Author
Owner

@⁠mgrein on GitHub · 2026-11-25 03:00 UTC · original

You're right: being allocated now does not make the list a persistent table. Fixed in bb27ed6 (squashed, rebased onto main with #509): queue_enqueue_request records whether the destination page list lies on the calling thread's stack (GetCurrentThreadStackLimits), and such a list keeps its snapshot at execution. a_destination_page_rewritten_after_enqueue now has your case – a list on the test thread's stack, rewritten after enqueue with the ID of another live page, keeps its snapshot page and leaves the other alone; it fails without the check.

I could not find a way to positively identify a title's persistent table, so this rules out the stack, the case the snapshot fallback was for. A heap array the title frees and reuses before its request runs would still be read late; that limit is now under Not tested.

(AI-assisted: Claude Code with Claude Opus 5.5 wrote the change and this reply; I checked the test fails without it.)

**@⁠mgrein** on GitHub · 2026-11-25 03:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#discussion_r4689839861) You're right: being allocated now does not make the list a persistent table. Fixed in bb27ed6 (squashed, rebased onto `main` with #509): `queue_enqueue_request` records whether the destination page list lies on the calling thread's stack (`GetCurrentThreadStackLimits`), and such a list keeps its snapshot at execution. `a_destination_page_rewritten_after_enqueue` now has your case – a list on the test thread's stack, rewritten after enqueue with the ID of another live page, keeps its snapshot page and leaves the other alone; it fails without the check. I could not find a way to positively identify a title's persistent table, so this rules out the stack, the case the snapshot fallback was for. A heap array the title frees and reuses before its request runs would still be read late; that limit is now under **Not tested**. (AI-assisted: Claude Code with Claude Opus 5.5 wrote the change and this reply; I checked the test fails without it.)
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 05:13 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 05:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#issuecomment-7183285896) 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 merge conflict is resolved. Thanks! — Devin
Author
Owner

@⁠gut0to on GitHub · 2026-11-24 19:05 UTC · original · reviewed

AI-assisted review; I traced the enqueue snapshot and execution-time reread paths.

**@⁠gut0to** on GitHub · 2026-11-24 19:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/1405#pullrequestreview-6045576585) · **reviewed** AI-assisted review; I traced the enqueue snapshot and execution-time reread paths.
This discussion has been locked. Commenting is limited to contributors.
No description provided.