Skip to content

D3D12.X: a skipped ExecuteIndirect inside an occlusion query leaves it visible - #2550

Open
tiagonleal wants to merge 1 commit into
xcl-dev:mainfrom
tiagonleal:skipped-indirect-keeps-occlusion-visible
Open

tiagonleal wants to merge 1 commit into
xcl-dev:mainfrom
tiagonleal:skipped-indirect-keeps-occlusion-visible

Conversation

@tiagonleal

Copy link
Copy Markdown
Contributor

A draw that XCL drops while an occlusion query is open marks the query, so ResolveQueryData reports it as visible (list_x::note_dropped_draw, used by graphics_bound). An ExecuteIndirect that XCL skips did not do this. A title's occlusion query around skipped indirect draws resolved to 0 samples, and the title could take the objects as hidden. Open PR #1798 lets a draw go on with a stand-in while its graphics pipeline is built, which makes a skipped ExecuteIndirect the usual case during pipeline building; this change does not depend on it, because pipelines that are late, two-pass or without a usable ABI are skipped on main too. No existing PR or issue covers this (searched for "occlusion ExecuteIndirect", "note_dropped_draw", "occlusion query skipped"; #1991 added note_dropped_draw for draws only).

What is in it

  • bind.rs: execute_indirect calls note_dropped_draw on the skips that could have drawn: a pipeline still being built, a finished two-pass mesh pipeline, a root-changing signature with a translated graphics pipeline, and a failed ABI bind of a graphics pipeline. A signature with a Dispatch argument makes no samples and is left out, and so are the console compute skips. graphics_bound also marks the two-pass skip, and a draw whose pipeline build failed (a stand-in with no real pipeline) is marked like one still being built.
  • pso_async.rs: is_stand_in(pso), true while the pipeline is being built or after its build failed.
  • list_x.rs: two #[cfg(test)] helpers for the test.
  • Test execute_indirect_skipped_inside_an_occlusion_query_reports_visible (bind.rs): BeginQuery, ExecuteIndirect, EndQuery on a fake list, for a pipeline still being built (reads visible), the same pipeline with a Dispatch signature (does not), a two-pass pipeline and a root-changing signature (both read visible).

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 test before the fix (the skip marking switched off): cargo test -p xcl --lib execute_indirect_skipped_inside: 0 passed, 1 failed ("a pipeline still being built"). After the fix, run 5 times: 1 passed each time.
  • cargo build --workspace and cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4, run twice: 1420 passed, 4 failed, 46 ignored both times (25 SKIPPED lines). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, which fail the same way on main.

Regression run
60 s each, the same retail title, release builds from clean trees, one after the other.

main (e1d84b7):

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

This PR:

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

Not tested

  • Whether the retail title uses occlusion queries around indirect draws: not known. No claim about world loading or any visible change.
  • The failed-ABI path of execute_indirect and the graphics_bound changes have no unit test of their own: they need a real command list and unified memory.
  • AMD, other drivers, Wine.

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

…t visible

A draw that XCL drops while an occlusion query is open marks the query so it
resolves as visible (list_x::note_dropped_draw). A skipped ExecuteIndirect did
not, so a title's occlusion query around skipped indirect draws resolved to 0
samples and the title could treat the objects as hidden.

execute_indirect now calls note_dropped_draw for the skips that could have
drawn: a pipeline still being built, a two-pass mesh pipeline, a root-changing
signature with a translated graphics pipeline, and a failed ABI bind of a
graphics pipeline. A Dispatch signature makes no samples and is left out, as
are the console compute skips. graphics_bound marks the two-pass skip too, and
a draw with a stand-in whose build failed (pso_async::is_stand_in) like one
still being built.

Test execute_indirect_skipped_inside_an_occlusion_query_reports_visible
(pending, Dispatch signature, two-pass, root-changing): before the fix it
fails ("a pipeline still being built"); after it passes 5 of 5 alone. The
failed-ABI path and graphics_bound have no test (they need a real list).

cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4, twice: 1420
passed, 4 failed, 46 ignored both times, 25 SKIPPED lines. The failures are
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, as on main.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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 e033310 (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: execute_indirect_skipped_inside_an_occlusion_query_reports_visible.
  • 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

Test run on exact head e033310 (e033310cd7b91767391f65080629a79c2664b9f8, 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 execute_indirect_skipped: 1 passed, 0 failed
  • This PR's new tests in the workspace run:
    • execute_indirect_skipped_inside_an_occlusion_query_reports_visible: ok

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: e033310cd7b91767391f65080629a79c2664b9f8
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1142 (PresentX 1142)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14788 MB

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

Not tested

  • Whether the title skips an ExecuteIndirect inside an occlusion query in this run: 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

@emirduran707

Copy link
Copy Markdown
Contributor

Independent AMD RDNA4 (native wave64) verification of exact PR head e033310cd7b91767391f65080629a79c2664b9f8 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::bind::tests::execute_indirect_skipped_inside_an_occlusion_query_reports_visible passed on this GPU.
    • 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: e033310cd7b91767391f65080629a79c2664b9f8
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1577 (PresentX 1577)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13932 MB

(Compare against main 68a284a on this machine: 1573 frames, 14420 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.

@KOLESNiii KOLESNiii mentioned this pull request Nov 25, 2026
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)
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 execute_indirect_skipped_inside_an_occlusion_query_reports_visible: 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
…port upstream xcl-dev#2550)

(cherry picked from commit b281526d1017705358eb97cdf83e2c57d97ec007)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants