D3D12.X: skip ExecuteIndirect with two-pass mesh/GS pipelines #1124

Closed
github-bot wants to merge 1 commit from gh-pr/1124/head into gh-pr/1124/base
Owner

@⁠spidermodders on GitHub · 2026-11-24 12:08 UTC · original
spidermodders:fix/execute-indirect-two-pass → main · +48 −2 · 2 files · 1 commits · closed without merging

Two-pass mesh and ES+GS pipelines are built with XCL's mesh root signature and registered in TWO_PASS rather than TRANSLATED_GRAPHICS. In execute_indirect, XCL checked translated graphics/compute pipelines and pending async PSOs, but did not check real::two_pass_of(pso). A two-pass PSO therefore fell through to the PC ExecuteIndirect path with the title's graphics root signature and zeroed root descriptors, causing an immediate GPU page fault at VA 0x0 (0x887a0006).

This adds a 1-line guard to skip ExecuteIndirect when real::two_pass_of(pso).is_some(), matching the existing guard for pending async PSOs. (Complementary to / superseded by full two-pass mesh shader execution in #724; this is a minimal crash fix so main stops removing the device in the meantime.)

What is in it

  • crates/xcl/src/hle/d3d12x/bind.rs: skip execute_indirect when super::real::two_pass_of(pso).is_some() alongside pso_async::is_pending(...), and add unit test execute_indirect_with_a_two_pass_pipeline_is_skipped.
  • crates/xcl/src/hle/d3d12x/real.rs: add #[cfg(test)] register_two_pass_for_test helper matching the existing register_translated_*_for_test helpers.

Tested

  • Hardware / OS / Rust: NVIDIA GeForce RTX 3060 (driver 32.0.16.2124), AMD Ryzen 7 5800X, Windows 11 Home 10.0.26300, rustc 1.100.0 (0ef1bc386 2026-11-09), debug (test suite) and release (scripts/smoke.ps1).
  • cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored.
  • SKIPPED GPU tests (2):
    • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64)
    • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)
  • Retail title (ProjectAmericas, loading Story Mode 3D world on RTX 3060): before this fix, 8/8 runs hit 0x887a0006 (nvlddmkm Event ID 13 Graphics SM Warp Exception: MMU Fault, DRED page fault at GPU VA 0x0); after this fix, 0/6 runs hit 0x887a0006 and the title progressed into rendering 3D world geometry.

Regression run
main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: ProjectAmericas
seconds: 60
exit: 0x0
frames shown: 1646 (PresentX 1646)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14797 MB

PR head:

xcl-smoke v1
commit: 4248e64a6e31ac3a50dd157ea229583676b0317f
gpu: NVIDIA GeForce RTX 3060
title: ProjectAmericas
seconds: 60
exit: 0x0
frames shown: 1601 (PresentX 1601)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14893 MB

Not tested

  • AMD GPUs and wave64-capable hardware (the two wave64 GPU tests were skipped on this RTX 3060).
  • The 60 s scripts/smoke.ps1 regression run stays in the title menu and does not enter the 3D world path that issues ExecuteIndirect with a two-pass PSO; that crash path was verified separately by loading Story Mode (reported under Tested) and by the new unit test.

AI use

  • Antigravity (exact model name not given to the agent) assisted with root-cause investigation, writing the fix, unit test, and PR description, and running the test suite and smoke runs.
**@⁠spidermodders** on GitHub · 2026-11-24 12:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1124) `spidermodders:fix/execute-indirect-two-pass` → `main` · +48 −2 · 2 files · 1 commits · closed without merging Two-pass mesh and ES+GS pipelines are built with XCL's mesh root signature and registered in `TWO_PASS` rather than `TRANSLATED_GRAPHICS`. In `execute_indirect`, XCL checked translated graphics/compute pipelines and pending async PSOs, but did not check `real::two_pass_of(pso)`. A two-pass PSO therefore fell through to the PC `ExecuteIndirect` path with the title's graphics root signature and zeroed root descriptors, causing an immediate GPU page fault at VA `0x0` (`0x887a0006`). This adds a 1-line guard to skip `ExecuteIndirect` when `real::two_pass_of(pso).is_some()`, matching the existing guard for pending async PSOs. (Complementary to / superseded by full two-pass mesh shader execution in #724; this is a minimal crash fix so `main` stops removing the device in the meantime.) **What is in it** - `crates/xcl/src/hle/d3d12x/bind.rs`: skip `execute_indirect` when `super::real::two_pass_of(pso).is_some()` alongside `pso_async::is_pending(...)`, and add unit test `execute_indirect_with_a_two_pass_pipeline_is_skipped`. - `crates/xcl/src/hle/d3d12x/real.rs`: add `#[cfg(test)] register_two_pass_for_test` helper matching the existing `register_translated_*_for_test` helpers. **Tested** - Hardware / OS / Rust: NVIDIA GeForce RTX 3060 (driver `32.0.16.2124`), AMD Ryzen 7 5800X, Windows 11 Home 10.0.26300, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug (test suite) and release (`scripts/smoke.ps1`). - `cargo test --workspace -- --test-threads=4`: 742 passed, 0 failed, 41 ignored. - `SKIPPED` GPU tests (2): - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (`no wave64`) - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`) - Retail title (`ProjectAmericas`, loading Story Mode 3D world on RTX 3060): before this fix, 8/8 runs hit `0x887a0006` (`nvlddmkm` Event ID 13 `Graphics SM Warp Exception: MMU Fault`, DRED page fault at GPU VA `0x0`); after this fix, 0/6 runs hit `0x887a0006` and the title progressed into rendering 3D world geometry. **Regression run** `main`: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 title: ProjectAmericas seconds: 60 exit: 0x0 frames shown: 1646 (PresentX 1646) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14797 MB ``` PR head: ``` xcl-smoke v1 commit: 4248e64a6e31ac3a50dd157ea229583676b0317f gpu: NVIDIA GeForce RTX 3060 title: ProjectAmericas seconds: 60 exit: 0x0 frames shown: 1601 (PresentX 1601) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14893 MB ``` **Not tested** - AMD GPUs and wave64-capable hardware (the two wave64 GPU tests were skipped on this RTX 3060). - The 60 s `scripts/smoke.ps1` regression run stays in the title menu and does not enter the 3D world path that issues `ExecuteIndirect` with a two-pass PSO; that crash path was verified separately by loading Story Mode (reported under **Tested**) and by the new unit test. **AI use** - Antigravity (exact model name not given to the agent) assisted with root-cause investigation, writing the fix, unit test, and PR description, and running the test suite and smoke runs.
Two-pass mesh and ES+GS pipelines are built with XCL's mesh root signature and registered in TWO_PASS rather than TRANSLATED_GRAPHICS. ExecuteIndirect checked translated graphics/compute and pending async PSOs, but not two_pass_of(pso), so a two-pass PSO fell through to the PC path with the title's graphics root signature and zeroed root descriptors, triggering an immediate GPU page fault at VA 0x0 (0x887a0006).

Skip ExecuteIndirect when two_pass_of(pso).is_some(), matching the existing guard for pending async PSOs, and add a unit test covering this path.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:14 +00:00
github-bot closed this pull request 2026-11-26 04:44:14 +00:00
Author
Owner

@⁠AlexandreSchuelter on GitHub · 2026-11-24 12:15 UTC · original

Test report on AMD wave64 hardware (RX 6900 XT, RDNA2): no new failures, and execute_indirect_with_a_two_pass_pipeline_is_skipped passes.

Tested

  • AMD Radeon RX 6900 XT (Navi 21, native wave64), driver 32.0.21045.29003; Ryzen 7 5800X3D; Windows NT 10.0.26300
  • Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17; XCL_NETWORK=0, XCL_REQUIRE_GPU=wave64; no SKIPPED tests
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4:
Tree Passed Failed Ignored
main 47efa2e 738 3 41
this PR 4248e64 (based on 47efa2e) 739 3 41
  • The 3 failures are the same on both trees and come from main: the RDNA2 packed-mip failure in placed_title_textures_share_vram_and_preserve_pixels (fixed by #470 / #1028) and its two PoisonError cascades (#673).
  • All wave64 GPU tests run here (the two that were SKIPPED on the RTX 3060 included) and pass, including the mesh / geometry ones.

Not tested

  • A retail title / scripts/smoke.ps1 (no game here), so not the ExecuteIndirect path a title takes; the new test uses a fake list and does not depend on the GPU
  • Release build

AI use: Claude Code (Claude Opus 5.5) fetched the branch, ran the suite and wrote this report; the runs are real, on the hardware above.

**@⁠AlexandreSchuelter** on GitHub · 2026-11-24 12:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1124#issuecomment-7131188914) Test report on AMD wave64 hardware (RX 6900 XT, RDNA2): no new failures, and `execute_indirect_with_a_two_pass_pipeline_is_skipped` passes. **Tested** - AMD Radeon RX 6900 XT (Navi 21, native wave64), driver 32.0.21045.29003; Ryzen 7 5800X3D; Windows NT 10.0.26300 - Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug; DXC 1.9.2602.17; `XCL_NETWORK=0`, `XCL_REQUIRE_GPU=wave64`; no SKIPPED tests - `cargo build --workspace` + `cargo test --workspace --no-fail-fast -- --test-threads=4`: | Tree | Passed | Failed | Ignored | |---|---|---|---| | `main` `47efa2e` | 738 | 3 | 41 | | this PR `4248e64` (based on `47efa2e`) | 739 | 3 | 41 | - The 3 failures are the same on both trees and come from `main`: the RDNA2 packed-mip failure in `placed_title_textures_share_vram_and_preserve_pixels` (fixed by #470 / #1028) and its two `PoisonError` cascades (#673). - All wave64 GPU tests run here (the two that were SKIPPED on the RTX 3060 included) and pass, including the mesh / geometry ones. **Not tested** - A retail title / `scripts/smoke.ps1` (no game here), so not the `ExecuteIndirect` path a title takes; the new test uses a fake list and does not depend on the GPU - Release build **AI use**: Claude Code (Claude Opus 5.5) fetched the branch, ran the suite and wrote this report; the runs are real, on the hardware above.
Author
Owner

@⁠Aniseto on GitHub · 2026-11-24 12:32 UTC · original

Ran the new ExecuteIndirect test and the whole bind unit set at 4248e64:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=nvidia cargo test -p xcl --lib execute_indirect
3 passed; 0 failed; 0 ignored      (exit 0)

XCL_ADAPTER=nvidia cargo test -p xcl --lib bind::tests
6 passed; 0 failed; 0 ignored      (exit 0)

execute_indirect_with_a_two_pass_pipeline_is_skipped passes, and the two existing ExecuteIndirect tests are unaffected. These are unit-level tests, so the adapter is not the variable; the datapoint is the Windows 11 build 26200 / MSVC 14.44.35207 / DXC 1.9.2609.5 toolchain next to the author's run.

Not tested: a mesh or GS title going through the two-pass path (no unpacked title here), RDNA2/RDNA4 and Intel GPUs, Wine, release profile.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified.

**@⁠Aniseto** on GitHub · 2026-11-24 12:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/1124#issuecomment-7131580168) Ran the new ExecuteIndirect test and the whole `bind` unit set at `4248e64`: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=nvidia cargo test -p xcl --lib execute_indirect 3 passed; 0 failed; 0 ignored (exit 0) XCL_ADAPTER=nvidia cargo test -p xcl --lib bind::tests 6 passed; 0 failed; 0 ignored (exit 0) ``` `execute_indirect_with_a_two_pass_pipeline_is_skipped` passes, and the two existing ExecuteIndirect tests are unaffected. These are unit-level tests, so the adapter is not the variable; the datapoint is the Windows 11 build 26200 / MSVC 14.44.35207 / DXC 1.9.2609.5 toolchain next to the author's run. Not tested: a mesh or GS title going through the two-pass path (no unpacked title here), RDNA2/RDNA4 and Intel GPUs, Wine, release profile. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash 1017** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified.
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-24 13:45 UTC · original · edited 2026-11-24 14:34 UTC

Windows / NVIDIA retail test of 4248e64a6e, on top of main 47efa2e + #684 (e56dbc3f43), all clean merges (tree ef7e61b). #684 is in both builds because without it one of my main runs ended earlier in a VCRUNTIME140 read fault.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves), driver 32.0.16.1742; Ryzen 7 9800X3D, 32 GB RAM; Windows 11 Pro 26300; rustc 1.100.0 MSVC.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug) on ef7e61b: 745 passed, 0 failed, 41 ignored. SKIPPED: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64).
  • Retail title 1.0.2.1, release, 300 s runs into world loading with XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_AT=30:A, the two builds alternated, warm DXIL / driver-blob caches:
build presents end how the run ends dispatches (skipped) queue.Wait … released on CPU warnings
#684 120 s +0x23cf683 write at 0x0, 172.7 s 40,593 (1,027) 45
#684 + this PR 200 s +0x23cf683, 229.6 s 67,349 (4,232) 179
#684 116 s D3D12 device removed: 0x887a0006, 163.6 s 31,861 (779) 29
#684 + this PR 202 s +0x23cf683, 231.6 s 68,635 (4,731) 220
#684 + this PR (a later run) 132 s D3D12 device removed: 0x887a0006, 140.9 s 65,536 (3,349) 3
  • Edit: a later run with this PR ended in 0x887a0006 too (last row; a cargo test --workspace ran alongside part of it), so this PR does not remove it on this card: 1 of 3 runs with it, 2 of 4 with #684 alone, 1 of 10 on main (too few runs to say whether it is rarer).

  • In every run, with and without this PR, the presents stop when the first GPU queue.Wait … did not complete within 5000 ms – released on CPU warning appears (e.g. q3 waiting on q0's 0x70d while q0 has completed 0x709), so the remaining +0x23cf683 stop looks unrelated to this PR.

  • Edit 2: two later runs of the same tree plus #1046 (which changes nothing without its variable) had presents end at 120 and 126 s, one ending in 0x887a0006 at 131.0 s and one in a read fault at game+0x4684e7. Runs of one build vary a lot here, so the 200 s runs above are not a reliable gain.

Not tested: a build with this PR and without #684; more runs (two per build); AMD / Intel; Windows 10. An Idle-priority shader precompile ran alongside all four runs.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠tiagonleal** on GitHub · 2026-11-24 13:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1124#issuecomment-7133295725) · edited 2026-11-24 14:34 UTC Windows / NVIDIA retail test of `4248e64a6e`, on top of `main` `47efa2e` + #684 (`e56dbc3f43`), all clean merges (tree `ef7e61b`). #684 is in both builds because without it one of my `main` runs ended earlier in a `VCRUNTIME140` read fault. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves), driver 32.0.16.1742; Ryzen 7 9800X3D, 32 GB RAM; Windows 11 Pro 26300; rustc 1.100.0 MSVC. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug) on `ef7e61b`: 745 passed, 0 failed, 41 ignored. SKIPPED: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (no wave64). - Retail title 1.0.2.1, release, 300 s runs into world loading with `XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_AT=30:A`, the two builds alternated, warm DXIL / driver-blob caches: | build | presents end | how the run ends | dispatches (skipped) | `queue.Wait … released on CPU` warnings | |---|---|---|---|---| | #684 | 120 s | `+0x23cf683` write at 0x0, 172.7 s | 40,593 (1,027) | 45 | | #684 + this PR | 200 s | `+0x23cf683`, 229.6 s | 67,349 (4,232) | 179 | | #684 | 116 s | `D3D12 device removed: 0x887a0006`, 163.6 s | 31,861 (779) | 29 | | #684 + this PR | 202 s | `+0x23cf683`, 231.6 s | 68,635 (4,731) | 220 | | #684 + this PR (a later run) | 132 s | `D3D12 device removed: 0x887a0006`, 140.9 s | 65,536 (3,349) | 3 | - **Edit:** a later run with this PR ended in `0x887a0006` too (last row; a `cargo test --workspace` ran alongside part of it), so this PR does not remove it on this card: 1 of 3 runs with it, 2 of 4 with #684 alone, 1 of 10 on `main` (too few runs to say whether it is rarer). - In every run, with and without this PR, the presents stop when the first `GPU queue.Wait … did not complete within 5000 ms – released on CPU` warning appears (e.g. q3 waiting on q0's 0x70d while q0 has completed 0x709), so the remaining `+0x23cf683` stop looks unrelated to this PR. - **Edit 2:** two later runs of the same tree plus #1046 (which changes nothing without its variable) had presents end at 120 and 126 s, one ending in `0x887a0006` at 131.0 s and one in a read fault at `game+0x4684e7`. Runs of one build vary a lot here, so the 200 s runs above are not a reliable gain. **Not tested:** a build with this PR and without #684; more runs (two per build); AMD / Intel; Windows 10. An Idle-priority shader precompile ran alongside all four runs. Run and written with Claude Code (Claude Opus 5.5).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 08:15 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 08:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1124#issuecomment-7156812143) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 01:02 UTC · original

Closing because main already covers this, from a7b478ba ("D3D12.X: skip direct draws and unmatched ExecuteIndirect on two-pass MS/GS PSOs"). In bind.rs execute_indirect, main checks two_pass_of(pso) and skips an ExecuteIndirect whose command signature does not match the two-pass pipeline, the case that invalidated the command list. It still runs a matching DispatchMesh indirect. This PR skips every ExecuteIndirect on a two-pass pipeline, so main's version is narrower and keeps draws this one would drop.

Compared at head 4248e64a against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.

**@⁠Prime1997** on GitHub · 2026-11-26 01:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1124#issuecomment-7179360009) Closing because main already covers this, from a7b478ba ("D3D12.X: skip direct draws and unmatched ExecuteIndirect on two-pass MS/GS PSOs"). In `bind.rs` `execute_indirect`, main checks `two_pass_of(pso)` and skips an ExecuteIndirect whose command signature does not match the two-pass pipeline, the case that invalidated the command list. It still runs a matching DispatchMesh indirect. This PR skips every ExecuteIndirect on a two-pass pipeline, so main's version is narrower and keeps draws this one would drop. Compared at head 4248e64a against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.