D3D12.X: bind console_list view/sampler heaps before root signature and fix shared ClearUAV handle #2518
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2518
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2518"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Decodere on GitHub · 2026-11-25 21:22 UTC · original
Decodere:fix-console-list-heaps-clear-uav→main· +135 −15 · 1 files · 1 commits · openFix three descriptor-heap and
ClearUnorderedAccessViewbugs inconsole_listcommand-stream replay: bind the shared CBV/SRV/UAV heap unconditionally (even withXCL_HEAP_WINDOWS=0), callSetDescriptorHeapsbeforeSetComputeRootSignature, and use the valid shared-heap UAV handle inCLEAR_UAV_MARKERwhile rejecting sampler slots. Part of #2461. Part of #1452. Part of #1833.What is in it
crates/xcl/src/hle/d3d12x/console_list.rs:ensure_dispatch_heaps: mirror the sampler-heap path to unconditionally fetch or lazily create the shared CBV/SRV/UAV heap viaconsole_heap::global_heap()/console_heap::shared_heap(d)(preservingheap_on_devicefiltering), instead of gating it onpso::heap_windows(), since translated ABI root signatures always setD3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED.bind_dispatch_root/close: resolve the compute root signature first (returning missing-RS errors before mutating command-list state), then invokeensure_dispatch_heaps(SetDescriptorHeaps) strictly beforelist.SetComputeRootSignature(root_sig).clear_uav_gpu_handle/CLEAR_UAV_MARKER: reject sampler slots (g.sampler || c.sampler) and selectc.pc_gpu_uavwhen both slots live in the sharedGLOBALheap (c.shared_srv != 0 && g.shared_srv != 0 && c.pc_gpu_uav != 0), falling back tog.pc_gpu_uavotherwise (rejecting0).clear_uav_gpu_handle_prefers_shared_cpu_slot_and_rejects_samplers: pure-CPU unit test covering sharedGLOBALinline-copy preference, shared fallback whenc.pc_gpu_uav == 0, non-shared and mixed-heap fallback, sampler rejection, and zero-handle rejection.bind_dispatch_root_sets_view_and_sampler_heaps_before_root_signature: isolated subprocess D3D12/WARP test (XCL_HEAP_WINDOWS=0, safe under--test-threads=4) using a recordingID3D12GraphicsCommandListspy vtable + real directly-indexed ABI root signature to verify["heaps", "rs"]call ordering and[CBV_SRV_UAV, SAMPLER]binding withoutXCL_HEAP_WINDOWS, plusClose().is_ok()on a real D3D12 command list.Tested
dxil.dll1.9.2609.5, release build.origin/main6d12f58a,XCL_ADAPTER=warp): both new tests failed (0 passed, 2 failed:clear_uav_gpu_handlereturnedSome(20496)instead ofSome(24608), andbind_dispatch_rootrecorded["rs", "heaps"]instead of["heaps", "rs"]without creating the shared view heap).cargo test --release -p xcl --lib -- hle::d3d12x::console_list::tests:: --nocapture:9 passed, 0 failed, 0 ignored(0.35 s,0skipped).XCL_ADAPTER=warp:9 passed, 0 failed, 0 ignored(0.32 s,0skipped).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture(RTX 4060):1425 passed, 0 failed, 46 ignoredacross37test binaries (29pre-existingSKIPPEDGPU/environment checks:21no wave64,3per-lane wave32 refused,3no D3D12 debug layer,1no heap windows,1cannot disable driver cache;0skipped inhle::d3d12x::console_list::tests).Regression run
main:
PR:
Not tested
console_listreplay (d3d12SDKLayers.dllnot installed in this environment) and native wave64 GPU tests.XCL_CONSOLE_LISTS=1beyond unit/D3D12 command-list tests and the default 60 s title smoke test.AI use
console_list.rsheap-binding andCLEAR_UAV_MARKERfixes, wrote the unit and subprocess D3D12/WARP tests, ran the test and smoke suites, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-25 21:32 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!
@emirduran707 on GitHub · 2026-11-25 21:56 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
77f51420c133f3fc251c92628d2fde532c99300b(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1423 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.hle::d3d12x::console_list::tests::bind_dispatch_root_sets_view_and_sampler_heaps_before_root_signatureandclear_uav_gpu_handle_prefers_shared_cpu_slot_and_rejects_samplers.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@xpatfussy69x on GitHub · 2026-11-25 22:09 UTC · original
Test run on exact head
77f5142(77f51420c133f3fc251c92628d2fde532c99300b, on its base6d12f58), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1425 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib console_list: 10 passed, 0 failedclear_uav_gpu_handle_prefers_shared_cpu_slot_and_rejects_samplers: ok, not skippedbind_dispatch_root_sets_view_and_sampler_heaps_before_root_signature: ok, not skippedRegression run (60 s, default settings)
main:
this PR:
No crash or device removal; frames 105 % of
main's, peak commit 100 %.Not tested
main(tested on its own base; it merges intoe1d84b7without conflicts)AI use
@SlopTart on GitHub · 2026-11-25 22:33 UTC · original
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 targetx86_64-pc-windows-gnurun 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
bind_dispatch_root_sets_view_and_sampler_heaps_before_root_signatureandclear_uav_gpu_handle_prefers_shared_cpu_slot_and_rejects_samplers: 2 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.
@fromthemoonx on GitHub · 2026-11-25 22:40 UTC · original
Debug-layer run (listed under Not tested): with console lists on, the e2e title's D3D12 debug-layer messages are the same on this PR and on
main. But the title never dispatches on a console list, so this run does not reach the changed code. Full suite passes on NVIDIA.Tested:
77f5142merged ontomaine1d84b7(clean). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, Graphics Tools (D3D12 debug layer) installed.cargo test --workspace --no-fail-fast -- --test-threads=4SKIPPEDlines; both new tests ran and passede2etest_title_draws_with_a_root_signature_under_the_debug_layer,XCL_CONSOLE_LISTS=1, PR andmainExecuteCommandLists: aCREATE_NOT_ZEROEDrender-target resource used byCopyResourcebefore a Discard/Clear/Copy). The test fails on both because of that 1422; it is inmainalready, not this PR. The title log has 2console list: SetPipelineState with an object not from XCLlines and no dispatch.XCL_CONSOLE_LISTS, PRmain(3× id 93, 1× id 1046, 1× warning id 820, 8× id 0 at exit)bind_dispatch_root_sets_view_and_sampler_heaps_before_root_signaturerecords the calls on a spy list, so the debug layer cannot check the new heap/root-signature order there; a real list with the layer on would.Not this PR, but it caught me out:
console_list::enabled()checks only thatXCL_CONSOLE_LISTSis set (var_os(...).is_some()), soXCL_CONSOLE_LISTS=0turns console lists on too.Not tested: a title that dispatches on console lists, AMD, a release build.
AI use: Claude Code (Claude Opus 5.5) ran the suite and the debug-layer comparisons, and wrote this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.