Skip to content

D3D12.X: Reset and CreateCommandList do not wait for a compute pipeline still being built - #2548

Open
tiagonleal wants to merge 1 commit into
xcl-dev:mainfrom
tiagonleal:reset-does-not-wait-for-compute
Open

tiagonleal wants to merge 1 commit into
xcl-dev:mainfrom
tiagonleal:reset-does-not-wait-for-compute

Conversation

@tiagonleal

@tiagonleal tiagonleal commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

After #2118 a dispatch waits for its compute pipeline at the submit instead of in the bind. SetPipelineState takes a pending compute pipeline lazily (the stand-in, no wait), and since main's db4dd27 the re-bind after KickoffX uses bind::initial_pipeline, which does not wait either. Two places still wait: Reset(allocator, initial_pso) and CreateCommandList with an initial pipeline prepare it with PreparedNativePipeline::new, which selects with ForBind. That waits for a compute pipeline and may build it on the title's thread. A title that passes a compute pipeline still being built to one of them stops there until the driver finishes, which can take minutes for a large program.

These two now use PreparedNativePipeline::new_lazy, the same retained resolution selected lazily, as SetPipelineState does. The dispatch that follows is still left for the submit: bind::reset and on_create keep the title's own pipeline (the stand-in), and bind::dispatch and bind::execute_indirect defer when it is pending. The Reset of the PC path (real::cl_reset) keeps ForBind.

An earlier version of this PR also changed the re-bind after KickoffX. main fixed that part in db4dd27, so it is no longer in the diff; its test stays as a regression test and passes on main as it is.

What is in it

  • bind.rs: PreparedNativePipeline::new_lazy, and a shared from_resolution_mode behind it and new.
  • list_x.rs: reset_pc uses new_lazy. device_x.rs: create_list (the path without the console list) uses new_lazy.
  • Tests a_reset_with_a_compute_pipeline_still_building_does_not_wait, a_kickoff_with_a_compute_pipeline_still_building_does_not_wait and a_command_list_created_with_a_compute_pipeline_still_building_does_not_wait (list_x.rs): each makes a compute pipeline whose build stays pending, checks that the call returns without waiting for it and that a Dispatch right after is put off to the submit. The Reset one also checks that the list tracks the stand-in.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0
  • New tests on the current head: cargo test -p xcl --lib -- still_building_does_not_wait: 3 passed, 0 failed. With the two calls put back to PreparedNativePipeline::new, the Reset and CreateCommandList tests fail after the test's 10 s wait ("Reset waited for the build (10.0014942s)", "CreateCommandList waited for the build (10.001688s)"); the KickoffX one passes either way.
  • cargo test --workspace --no-fail-fast -- --test-threads=4, run twice on c0d0920: 1422 passed, 4 failed, 46 ignored both times (25 SKIPPED lines). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY), the known ones on this machine.
  • After the rebase onto main d8bd9a38 (head 3407d221): cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4, one run: 2617 passed, 4 failed, 49 ignored (26 SKIPPED lines). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3. The 4 are the fuzz_validate_and_gpu_* tests, which fail on main here too (Recompiler: LDS ds_sub_u32 hides its negation from the driver (RTX 50 refuses it) #1919 fixes them); main's run had a fifth failure, the intermittent e2e check reported in D3D12.X: a submit misses a CPU write into memory idle for 1.5 s (hot write-watch looks); intermittent e2e failure #3382. On main d8bd9a38 on this machine the same command gave 2613 passed, 5 failed, 49 ignored (26 SKIPPED lines). The other results in this section are from the earlier heads named in them.

Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e (Newer Retail Game), release builds of both commits in clean trees, main d8bd9a38 first, one run each, in one queue with this account's other PRs. Both runs had XCL_PREPARE=0 and the same warm DXIL cache. A warm-up run of main came before them and is not shown. A second run of main at the end of the queue showed 1694 frames and a peak commit of 15641 MB, so differences of a few tens of frames between runs are noise here.

main (d8bd9a38):

xcl-smoke v1
commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1691 (PresentX 1691)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 15319 MB

This PR (3407d221):

xcl-smoke v1
commit: 3407d22183bda181f3d90f9122bb0a518d040c07
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1697 (PresentX 1697)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15851 MB

Not tested

  • Whether the retail title passes a compute pipeline that is still being built to Reset or CreateCommandList: not known. No claim about world loading or any visible change; the smoke run shows only that nothing regressed. KickoffX rarely reaches this case, because the deferred recording right before it has already waited for the deferred pipelines.
  • real.rs cl_reset (the PC path) still uses PreparedNativePipeline::new (ForBind); it is not changed here.
  • AMD, other drivers.

AI use

  • Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5, Claude Sonnet 5.5) helped developing.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings November 25, 2026 22:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@futurepro62

futurepro62 commented Nov 25, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 5ac8e85 (on its base e1d84b7).

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: 1412 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, dispatch_chain_native_wave64_builds_whole, 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_reset_with_a_compute_pipeline_still_building_does_not_wait.
  • 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: 1423 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 e1d84b7 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #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.

@xpatfussy69x

Copy link
Copy Markdown
Contributor

Test run on exact head 5ac8e85 (5ac8e857a86835d04c8152c3f3066925d4f07f7d, on its base e1d84b7, current main), clean tree.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs
  • cargo test --workspace -- --test-threads=4: 1424 passed, 0 failed, 46 ignored
  • SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (on main too)
  • cargo test -p xcl --lib a_reset_with_a_compute_pipeline: 1 passed, 0 failed
  • This PR's new tests in the workspace run:
    • a_reset_with_a_compute_pipeline_still_building_does_not_wait: ok
  • Conflicts with D3D12.X: a reused spare keeps the allocator of deferred work still on the GPU #2549 in crates/xcl/src/hle/d3d12x/list_x.rs (git merge-tree of both heads); whichever lands second needs a rebase

Regression run (60 s, default settings, a retail title)

main:

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1091 (PresentX 1091)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

this PR:

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

No crash or device removal; frames 104 % of main's, peak commit 100 %.

Not tested

  • Whether a Reset, KickoffX or CreateCommandList met a pipeline still building in this run (default settings, no frame-time measurement): a regression check only
  • AMD / native wave64

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

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

Thanks!

— Devin

@KOLESNiii KOLESNiii mentioned this pull request Nov 25, 2026
@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) verification of exact PR head 5ac8e857a86835d04c8152c3f3066925d4f07f7d on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver 32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC 1.9.2602.17).

Tested

  • cargo build --workspace (debug): passed (0 errors).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1422 passed, 2 failed, 46 ignored (8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1 heap_window_out_of_memory_falls_back_to_the_switch_form no heap windows, 1 pso_measurement_compiles_an_exact_synthetic_record Windows Developer Mode off).
    • The new test hle::d3d12x::list_x::tests::a_reset_with_a_compute_pipeline_still_building_does_not_wait passed.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3) are pre-existing on unmodified main on this RX 9060 XT / driver 32.0.31044.16.
  • cargo build --release -p xcl + 60 s retail-title smoke test (scripts/smoke.ps1, offline):
xcl-smoke v1
commit: 5ac8e857a86835d04c8152c3f3066925d4f07f7d
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1603 (PresentX 1603)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19171 MB

(Compare against main 08db8020 on this machine: 1553 frames, 13966 MB peak, 0 device removals, 0 crashes.)

Not tested

  • NVIDIA / Intel GPUs, Linux / Wine.

AI use

  • Verification run and report prepared with Antigravity (Gemini 4 Neon); all build, test, and smoke results are from live runs on this machine.

raylitebull added a commit that referenced this pull request Nov 26, 2026
Eliminate the global sparse STATE lock convoy across synchronous GPU
fence waits in sparse::readback_now (triggered on ID3D12Resource::Map
readbacks) by pooling per-Map ReadbackJob objects (COPY command
allocator + list + persistently-mapped READBACK staging buffer + OS
fence event) outside STATE. STATE is now only held briefly to flush
pending zero/dirty pages and snapshot mapped spans, to submit/signal on
the copy queue, and to copy still-committed non-hole bytes back into
host memory after the fence wait completes unlocked.

Also adapt three upstream fixes cleanly atop our runtime branch:
- #2548: use pso_async::resolve (non-blocking) instead of
  resolve_for_bind in device_x::create_list, list_x::kickoff_x, and
  list_x::reset_pc so list creation/reset with a compiling compute PSO
  never stalls the title thread.
- #2549: preserve own_alloc when split() reuses a spare segment whose
  previous recording held deferred dispatches' allocator.
- #2550: add pso_async::is_stand_in and bind::note_skipped_indirect to
  call list_x::note_dropped_draw on skipped graphics ExecuteIndirect
  paths (including stand-in / two-pass PSOs) so dropped draws stay
  tracked consistently.

Assisted-by: Antigravity (Gemini 4 Neon High)
@xpatfussy69x

Copy link
Copy Markdown
Contributor

Read the diff on 5ac8e85. The three resolve_for_bind → resolve swaps look right to me: resolve_for_bind already sent graphics pipelines to resolve, and for a compute pipeline still being built the title's own pipeline stays in bound_pso, so the dispatch after it is still put off to the submit. The test covers Reset (reset_pc) only; the KickoffX re-bind (list_x.rs:3404) and CreateCommandList with an initial pipeline (device_x.rs:98) are changed without a test. A dispatch right after each, while the build is pending, would cover them.

AI use: Claude Code (Claude Opus 5.5) reviewed the diff; I checked each point.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 26, 2026
…ixes

Integrates upstream amd-dev 61121fe/xcl-dev#2569 (DirectStorage ordered completion
wakeups) plus open PRs xcl-dev#2577 (skip AMD cache-reference driver blobs on disk,
xcl-dev#2512), xcl-dev#2578 (clear LAST_CONTENT on placed texture unmap/remap, xcl-dev#2460),
xcl-dev#2579 (mark put-off builds wanted immediately), xcl-dev#2556 (NULL-ppv
CreateDescriptorHeap test), xcl-dev#2550 (skipped ExecuteIndirect occlusion query),
xcl-dev#2549 (reused spare keeps in-flight deferred allocator, with Wine raw fences
and UnadoptGuard), and xcl-dev#2548 (Reset/KickoffX/CreateCommandList do not wait on
building compute pipelines).

Assisted-by: Antigravity (Gemini 4 Neon)
@SlopTart

Copy link
Copy Markdown

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of a_reset_with_a_compute_pipeline_still_building_does_not_wait: passed.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
@tiagonleal
tiagonleal force-pushed the reset-does-not-wait-for-compute branch from 5ac8e85 to c0d0920 Compare November 26, 2026 11:52
@tiagonleal

Copy link
Copy Markdown
Contributor Author

Thanks. I added a test for each of the two other paths, next to the Reset one, both in list_x.rs: a_kickoff_with_a_compute_pipeline_still_building_does_not_wait (the KickoffX re-bind) and a_command_list_created_with_a_compute_pipeline_still_building_does_not_wait (CreateCommandList with an initial pipeline). Each checks that the call returns without waiting for the build and that a Dispatch right after is left for the submit. The follow-up commit is squashed into the first one, now c0d0920.

Run on c0d0920: cargo test -p xcl --lib -- still_building_does_not_wait, 3 passed, 3 of 3 runs. With the three calls put back on resolve_for_bind, all three fail after a 10 s wait ("Reset waited for the build (10.0008635s)", "KickoffX waited for the build (10.0029887s)", "CreateCommandList waited for the build (10.0042973s)"). cargo test --workspace --no-fail-fast -- --test-threads=4, twice: 1422 passed, 4 failed, 46 ignored; the 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY, known on this machine). 60 s smoke runs on e1d84b7 and c0d0920: both exit 0, no device removals, 1623 and 1626 frames shown.

Not run: the four fuzz tests on main today.

@Decodere

Copy link
Copy Markdown
Contributor

Independent desktop NVIDIA verification of PR #2548 at head c0d09204145a8c6b9f49e5c19aad27c64711c97c (1 commit; exact parent & merge-base: e1d84b7d9153f86a97d2ec5d209d196046fc0bea, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (c0d09204)

Command Result
cargo test --release -p xcl --lib a_reset_with_a_compute_pipeline_still_building_does_not_wait -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.23s, 0.20s, 0.19s, 0 skipped — live D3D12 + DXC on RTX 4060)
cargo test --release -p xcl --lib a_kickoff_with_a_compute_pipeline_still_building_does_not_wait -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.19s × 3, 0 skipped — live D3D12 + DXC on RTX 4060)
cargo test --release -p xcl --lib a_command_list_created_with_a_compute_pipeline_still_building_does_not_wait -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1326 filtered out × 3 (0.20s, 0.19s, 0.19s, 0 skipped — live D3D12 + DXC on RTX 4060)
cargo test --release -p xcl --lib hle::d3d12x::device_x:: -- --test-threads=1 (3 consecutive runs) 14 passed; 0 failed; 0 ignored; 1313 filtered out × 3 (0.33s × 3, 0 skipped)
cargo test --release -p xcl --lib hle::d3d12x::list_x:: -- --test-threads=1 (3 consecutive runs) 43 passed; 0 failed; 0 ignored; 1284 filtered out × 3 (1.14s × 3, 0 skipped)
cargo build --release -p xcl Clean build (1m 07s, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1531 (PresentX 1531)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13982 MB

PR #2548 (c0d09204145a8c6b9f49e5c19aad27c64711c97c):

xcl-smoke v1
commit: c0d09204145a8c6b9f49e5c19aad27c64711c97c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1574 (PresentX 1574)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14003 MB

Runtime log observations (xcl.log)

  • 9221 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19432 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14002 MB committed by the process; video memory 6116 MB local, 4683 MB non-local.

Limits of coverage

  • Non-blocking Reset, KickoffX, and CreateCommandList with an in-flight compute pipeline build were directly verified on desktop D3D12 / RTX 4060 + DXC 1.9.2609.5 via all 3 new GPU tests (3/3 each, 0 skipped), hle::d3d12x::device_x:: (14/14 × 3), and hle::d3d12x::list_x:: (43/43 × 3).
  • The 60 s retail smoke ran with warm shader/driver caches on title: 29640639, confirming zero runtime regression rather than triggering a cold compute pipeline build during Reset / KickoffX / CreateCommandList (frame-count delta vs. cached parent reflects single-run startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

@ClosetPie107

Copy link
Copy Markdown

Independent test report under Wine/Proton (not native Windows) for head c0d09204.

Setup

  • AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5
  • Proton Experimental experimental-11.0-20261112, vkd3d-proton master ec207194 with a local patch dropping the lpVtbl checks in d3d12_command_allocator_from_iface / d3d12_command_list_from_iface, DXC 1.9.2609.5, Rust 1.96.0, x86_64-pc-windows-gnu
  • Head merged onto main 83b00818, test commit bcdd4358

Tests (debug, XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • hle::d3d12x::list_x::: 43 passed, 0 failed (main: 40 passed, 0 failed), including the three …_still_building_does_not_wait tests
  • cargo test --workspace --no-fail-fast -- --test-threads=4, lib binary: 1324 passed, 8 failed, 27 ignored (main the same run: 1320 passed, 9 failed, 27 ignored). The failures are all among main's.

Retail title, 300 s (release, every run from a copy of the same warm-cache snapshot; XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence, A pressed every 10 s)

  • 2 runs: both exit 0, no crash, no device removal, 2,034 and 1,888 presents. main, 4 runs: all clean, 1,892–2,122.

Not tested

  • Native Windows, NVIDIA/Intel

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.

@tiagonleal
tiagonleal force-pushed the reset-does-not-wait-for-compute branch from c0d0920 to d6d4e99 Compare November 28, 2026 14:36
@tiagonleal tiagonleal changed the title D3D12.X: Reset, KickoffX and CreateCommandList do not wait for a compute pipeline still being built D3D12.X: Reset and CreateCommandList do not wait for a compute pipeline still being built Nov 28, 2026
@tiagonleal
tiagonleal force-pushed the reset-does-not-wait-for-compute branch from d6d4e99 to 7056b3b Compare November 28, 2026 16:08
…ne still being built

After xcl-dev#2118 a dispatch waits for its compute pipeline at the submit, not in the bind. SetPipelineState takes a pending compute pipeline lazily (NativePipelineBindMode::Lazy, the stand-in, no wait), and the re-bind after KickoffX uses bind::initial_pipeline, which does not wait either. Reset(allocator, initial_pso) (reset_pc) and CreateCommandList with an initial pipeline (create_list, path without the console list) prepare their pipeline with PreparedNativePipeline::new, which selects with ForBind: that waits for a compute pipeline and may build it on the title's thread.

These two now use PreparedNativePipeline::new_lazy, the same retained resolution selected with Lazy, like SetPipelineState. bind::reset and on_create keep the title's own pipeline (the stand-in), and bind::dispatch / execute_indirect defer when it is pending, so the dispatch that follows is still left for the submit. The Reset of the PC path (real::cl_reset) keeps ForBind.

Tests a_reset_with_a_compute_pipeline_still_building_does_not_wait, a_kickoff_with_a_compute_pipeline_still_building_does_not_wait and a_command_list_created_with_a_compute_pipeline_still_building_does_not_wait, one per path. Each makes a compute pipeline whose build stays pending and checks the call returns without waiting for it and that a Dispatch right after is put off to the submit; the Reset one also checks the list tracks the stand-in. With the two calls back on PreparedNativePipeline::new the Reset and CreateCommandList tests fail ("Reset waited for the build (10.0014942s)", "CreateCommandList waited for the build (10.001688s)"); the KickoffX one passes on main already and stays as a regression test.
@tiagonleal
tiagonleal force-pushed the reset-does-not-wait-for-compute branch from 7056b3b to 3407d22 Compare November 29, 2026 12:01
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 3407d22

No open or merged PR makes the same change. #1798 is about graphics draws, and #2615 is about building cold pipelines in binds. main still calls PreparedNativePipeline::new (ForBind, which waits for a compute pipeline) in device_x.rs:create_list and list_x.rs:reset_pc_inner. Switching these to Lazy matches what SetPipelineState already does. Graphics is not affected, because Lazy and ForBind only differ for compute.
One gap: real.rs:cl_reset (the PC-path Reset hook) still uses PreparedNativePipeline::new and would still wait. The kickoff test exercises code this PR does not change.
Recommendation: keep open.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants