D3D12.X: log a command list submitted while its previous submit runs #2160

Manually merged
github merged 1 commit from gh-pr/2160/head into gh-pr/2160/base 2026-11-26 05:21:13 +00:00
Owner

@⁠throny on GitHub · 2026-11-25 06:34 UTC · original
throny:d3d12x-resubmit-diagnostic → main · +93 −4 · 2 files · 1 commits · merged 2026-11-25 10:42 UTC

PC D3D12 does not allow submitting a command list whose previous execution the GPU has not finished (debug layer id 553, "the command queue fence has not advanced past previous executions of the command list"); a console lets a title do it. During the retail title's world load the debug layer reports id 553 from about 86 s, a few seconds before the device removal of #1452. This logs it without the debug layer: one warning line when a PC list is submitted while its previous submit is still running, saying whether it is the same recording and the same queue. It is what showed the path the fix in the stacked PR takes.

Part of #1452.

What is in it

  • crates/xcl/src/hle/d3d12x/alloc_pool.rs: executed now signals its per-queue fence after every submit (before: only submits of the title lists it tracks), and remembers each PC list's last submit (queue, fence value, recording number). New note_resubmits logs a list whose last submit is still running (the first 8, then at powers of two). Unit/GPU test a_resubmit_while_the_previous_submit_runs_is_noticed.
  • crates/xcl/src/hle/d3d12x/real.rs: q_execute_command_lists calls it before each ExecuteCommandLists chunk.
  • The only change besides the log: that extra fence signal on submits of lists alloc_pool does not track (the PC lists behind console lists).

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on 637b82a (on main 6020a33): 1 155 passed, 0 failed, 46 ignored, first run. SKIPPED (25 lines): the wave64 GPU tests (no wave64), three per-lane forms the per-lane path refuses, heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), pso_measurement_compiles_an_exact_synthetic_record (driver cache cannot be disabled without Developer Mode).
  • On the retail title's world load (warm caches, XCL_DIRECT_DXIL=1, the same commit on top of main 177cd40, where the removal of #1452 is reproducible here): from 89.3 s, 8 lists logged as "a new recording, the same queue", 64+ by 97 s; device removed at 101 s. With the D3D12 debug layer on, the same run shows id 553 at the same point (#1452).

Regression run

scripts/smoke.ps1, the retail title, 60 s, release builds of both commits, main first.

main:

xcl-smoke v1
commit: 6020a33b16ba2de25b3aef5947552f2dc1831f09
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1607 (PresentX 1607)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15841 MB

PR:

xcl-smoke v1
commit: 637b82a72ccad39d365e302e600cdc0b6ca0dbb2
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1609 (PresentX 1609)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15262 MB

Not tested

  • AMD and other vendors; whether the log line fires there.
  • The extra per-submit fence signal's cost was not measured beyond the smoke pair (1 607 vs 1 609 frames).

AI use

  • Claude Code (Claude Opus 5.5): found the path with the debug layer and this log, wrote the change and the test, ran the tests above and wrote this description.

🤖 Generated with Claude Code

**@⁠throny** on GitHub · 2026-11-25 06:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/2160) `throny:d3d12x-resubmit-diagnostic` → `main` · +93 −4 · 2 files · 1 commits · merged 2026-11-25 10:42 UTC PC D3D12 does not allow submitting a command list whose previous execution the GPU has not finished (debug layer id 553, "the command queue fence has not advanced past previous executions of the command list"); a console lets a title do it. During the retail title's world load the debug layer reports id 553 from about 86 s, a few seconds before the device removal of #1452. This logs it without the debug layer: one warning line when a PC list is submitted while its previous submit is still running, saying whether it is the same recording and the same queue. It is what showed the path the fix in the stacked PR takes. Part of #1452. **What is in it** - `crates/xcl/src/hle/d3d12x/alloc_pool.rs`: `executed` now signals its per-queue fence after every submit (before: only submits of the title lists it tracks), and remembers each PC list's last submit (queue, fence value, recording number). New `note_resubmits` logs a list whose last submit is still running (the first 8, then at powers of two). Unit/GPU test `a_resubmit_while_the_previous_submit_runs_is_noticed`. - `crates/xcl/src/hle/d3d12x/real.rs`: `q_execute_command_lists` calls it before each `ExecuteCommandLists` chunk. - The only change besides the log: that extra fence signal on submits of lists `alloc_pool` does not track (the PC lists behind console lists). **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `637b82a` (on `main` `6020a33`): 1 155 passed, 0 failed, 46 ignored, first run. `SKIPPED` (25 lines): the wave64 GPU tests (no wave64), three per-lane forms the per-lane path refuses, `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows), `pso_measurement_compiles_an_exact_synthetic_record` (driver cache cannot be disabled without Developer Mode). - On the retail title's world load (warm caches, `XCL_DIRECT_DXIL=1`, the same commit on top of `main` `177cd40`, where the removal of #1452 is reproducible here): from 89.3 s, 8 lists logged as "a new recording, the same queue", 64+ by 97 s; device removed at 101 s. With the D3D12 debug layer on, the same run shows id 553 at the same point ([#1452](https://git.gtahub.st/github/xcl-dev--xcl/issues/1452)). **Regression run** `scripts/smoke.ps1`, the retail title, 60 s, release builds of both commits, `main` first. main: ``` xcl-smoke v1 commit: 6020a33b16ba2de25b3aef5947552f2dc1831f09 gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1607 (PresentX 1607) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15841 MB ``` PR: ``` xcl-smoke v1 commit: 637b82a72ccad39d365e302e600cdc0b6ca0dbb2 gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1609 (PresentX 1609) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15262 MB ``` **Not tested** - AMD and other vendors; whether the log line fires there. - The extra per-submit fence signal's cost was not measured beyond the smoke pair (1 607 vs 1 609 frames). **AI use** - Claude Code (Claude Opus 5.5): found the path with the debug layer and this log, wrote the change and the test, ran the tests above and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PC D3D12 does not allow submitting a command list whose previous execution
the GPU has not finished (debug layer id 553: "the command queue fence has
not advanced past previous executions of the command list"); a console lets
a title do it. With the debug layer on, the retail title's world load shows
id 553 from 85.8 s, then cross-queue waits that stop one signal short, then
the device removal (#1452).

alloc_pool::executed signalled a per-queue fence after submits of the
lists it tracks (title lists). It now does so after every submit, so the
PC lists behind console lists are covered too, and remembers each list's
last submit (queue, fence value, recording number). note_resubmits, called
before each ExecuteCommandLists chunk, logs a list whose previous submit is
still running: whether it is the same recording and the same queue (the
first 8, then at powers of two). The only change besides the log is that
extra fence signal on submits of untracked lists.

Part of #1452.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:21:11 +00:00
github manually merged commit 637b82a72c into gh-pr/2160/base 2026-11-26 05:21:13 +00:00
Author
Owner

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

Independent Windows x64 + Intel Arc A770 test report on commit 637b82a72ccad39d365e302e600cdc0b6ca0dbb2.

Environment

  • OS: Windows 11 Enterprise Evaluation x64 (build 26200.9974, Session 0)
  • CPU: AMD Ryzen 7 3800X
  • GPU: Intel Arc A770 16 GiB (driver 32.0.101.9175, Tiled Resources Tier 4, Resource Heap Tier 1, DoublePrecisionFloatShaderOps=0)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) (debug build), DXC 1.9.2609.5 (01b62ad47)

Command
Executed under serialized Arc A770 GPU mutex (XCL_ADAPTER=A770) with pre/in/post-mutex executable SHA-256 verified (3A3AB38543C51DE1A34904719F94965BBAB0276568835F4D2AD11338C614B639):

xcl-97fdf2b9ff8e1482.exe --exact --nocapture --test-threads=1 `
  hle::d3d12x::alloc_pool::tests::a_resubmit_while_the_previous_submit_runs_is_noticed

Results

  • Passed: 1, Failed: 0, Ignored: 0, Skipped: 0 (0.15s, exit code 0)
  • Emitted expected resubmit warning: xcl: D3D12.X: a command list is submitted while its previous submit is still on the GPU (the same recording, the same queue; #1 so far) – the PC does not allow it (debug layer id 553).

Not tested

  • Full workspace suite and game smoke run.

AI use

  • Verified and published with T3 Code / Antigravity (gemini-4-neon).
**@⁠JJAutoCompare** on GitHub · 2026-11-25 07:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2160#issuecomment-7155472349) Independent Windows x64 + Intel Arc A770 test report on commit `637b82a72ccad39d365e302e600cdc0b6ca0dbb2`. **Environment** - OS: Windows 11 Enterprise Evaluation x64 (build 26200.9974, Session 0) - CPU: AMD Ryzen 7 3800X - GPU: Intel Arc A770 16 GiB (driver `32.0.101.9175`, Tiled Resources Tier 4, Resource Heap Tier 1, `DoublePrecisionFloatShaderOps=0`) - Toolchain: `rustc 1.100.0 (0ef1bc386 2026-11-09)` (debug build), DXC `1.9.2609.5 (01b62ad47)` **Command** Executed under serialized Arc A770 GPU mutex (`XCL_ADAPTER=A770`) with pre/in/post-mutex executable SHA-256 verified (`3A3AB38543C51DE1A34904719F94965BBAB0276568835F4D2AD11338C614B639`): ```powershell xcl-97fdf2b9ff8e1482.exe --exact --nocapture --test-threads=1 ` hle::d3d12x::alloc_pool::tests::a_resubmit_while_the_previous_submit_runs_is_noticed ``` **Results** - Passed: 1, Failed: 0, Ignored: 0, Skipped: 0 (0.15s, exit code 0) - Emitted expected resubmit warning: `xcl: D3D12.X: a command list is submitted while its previous submit is still on the GPU (the same recording, the same queue; #1 so far) – the PC does not allow it (debug layer id 553)`. **Not tested** - Full workspace suite and game smoke run. **AI use** - Verified and published with T3 Code / Antigravity (`gemini-4-neon`).
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-25 07:05 UTC · original · edited 2026-11-25 07:15 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 637b82a (on its base 6020a33).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1143 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: a_resubmit_while_the_previous_submit_runs_is_noticed.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1154 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 568e7db too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-25 07:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2160#issuecomment-7155472204) · edited 2026-11-25 07:15 UTC Full-suite run, since this PR has no test report yet. Tested exact head `637b82a` (on its base `6020a33`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1143 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `a_resubmit_while_the_previous_submit_runs_is_noticed`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1154 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `568e7db` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 07:20 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 07:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2160#issuecomment-7155751868) 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!
This discussion has been locked. Commenting is limited to contributors.
No description provided.