D3D12.X: bind console_list view/sampler heaps before root signature and fix shared ClearUAV handle #2508
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T21:22:18Z.
Fix 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 and theshared_view_boundflag returned to callers), 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 viapso_root_signature_exact(real)first (returning missing-RS errors before mutating command-list state), then invokeensure_dispatch_heaps(SetDescriptorHeaps) strictly beforelist.SetComputeRootSignature(root_sig).clear_uav_gpu_slot/clear_uav_gpu_handle/CLEAR_UAV_MARKER: reject sampler slots (g.sampler || c.sampler), selectc(andc.pc_gpu_uav) when both slots live in the sharedGLOBALheap (c.shared_srv != 0 && g.shared_srv != 0 && c.pc_gpu_uav != 0), and fall back togotherwise (forwarding the selected slot tolist_x::uav_clear_resourceand rejecting zero handles).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, forwarding childSKIPPEDlines tostderr) using a recordingID3D12GraphicsCommandListspy vtable + real directly-indexed ABI root signature to verify["heaps", "rs"]call ordering,shared_view_bound == true, and[CBV_SRV_UAV, SAMPLER]binding withoutXCL_HEAP_WINDOWS, plusClose().is_ok()on a real D3D12 command list.Tested
621.40, wave32), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust1.100.1(stable-x86_64-pc-windows-msvc), DXC1.9.2602.17.origin/main(1c8b551475e1e7bfe48f94448492a4c3544a2e0f) at749629981cd551596b3a4111510ed508187e2d80:cargo build --workspace(debug): ok.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture(43 targets): 2911 passed, 0 failed, 51 ignored (+2 new tests vsorigin/main1c8b5514).hle::d3d12x::console_list::tests: 13/13 passed, 0 skipped (includingbind_dispatch_root_sets_view_and_sampler_heaps_before_root_signature,clear_uav_gpu_handle_prefers_shared_cpu_slot_and_rejects_samplers,default_dispatch_heaps_binds_and_upgrades_missing_view_or_sampler, andgpu_ensure_dispatch_heaps_binds_view_and_sampler_heaps).SKIPPEDlines (28 total, identical toorigin/main1c8b5514): 22no wave64(8 direct + 14lower_dxilsubcases), 2no d3d12SDKLayers.dll, 1no D3D12 debug layer, 2no heap windows, 1cannot disable the driver cache (Windows Developer Mode required).cargo build --release -p xcl: ok.clear_uav_gpu_handlereturned the stale non-shared slot handle, andbind_dispatch_rootrecorded["rs", "heaps"]without creating the shared view heap).Regression run
Paired 60 s retail title runs with
scripts/smoke.ps1(release build, same title29640639, clean working tree) onorigin/main(1c8b551475e1e7bfe48f94448492a4c3544a2e0f) and this PR (749629981cd551596b3a4111510ed508187e2d80):Baseline (
origin/main):PR head (
74962998):Not tested
console_listreplay (d3d12SDKLayers.dllis not installed on this host), native wave64 GPU tests, and AMD/Intel GPUs.XCL_CONSOLE_LISTS=1beyond the unit/D3D12 command-list tests and the default 60 s retail title smoke run.AI use
Antigravity (Gemini 4 Neon) implemented the
console_list.rsheap-binding andCLEAR_UAV_MARKERfixes, wrote the unit and subprocess D3D12/WARP tests, performed the rebase ontomain, and drafted this PR description; all builds, tests, and paired retail smoke runs were executed locally on the hardware listed above.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:32:06Z.
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!
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T21:56:33Z.
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
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-25T22:40:36Z.
merge-check
base:
5eaadb54c1head:
749629981cmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2976 passed, 0 failed, 52 ignored (base: 2974 passed, 0 failed, 52 ignored); SKIPPED: 26 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 1 no build ahead); failing: none. The last skip is not in my base run:
a_parked_giant_build_ahead_leaves_the_lane_of_new_compute_pipelines_to_the_nextskips when the machine is short of commit, and it ran and passed alone 3 of 3 on this merge.review: read the whole diff (1 file, +159 -20). No blocking finding.
console_list::testsmodule at 8 threads: 30 of 30 passed, both new tests included, none skipped.XCL_CONSOLE_LISTSis set, so a default title run (the smoke pair included) does not reach this code.list_x::uav_clear_handles) still use the GPU slot's. That gives the same result when both slots hold the same view, as D3D12 asks.77f5142its messages matched main's, but the e2e title never dispatched on a console list).performance: none by default. With console lists on, up to one more heap lookup per dispatch until both heaps are bound; reasoned, not measured.
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
Rerun on the new head; it replaces my report on
77f5142.Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T22:09:15Z.
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
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T22:33:08Z.
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.
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T02:13:50Z.
merge-check claim
head:
77f51420c1Imported from ivall/xcl. Originally posted by throny on 2026-11-28T02:30:27Z.
merge-check
base:
753e8b1ahead:
77f51420c1merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored
review: no blocking finding. Default path: console-list dispatches now bind the shared view heap whether or not XCL_HEAP_WINDOWS is set (the shared heap exists by default), and heaps are set before the root signature, which is the right order for directly indexed root signatures. Notes: this now differs from list_x::ensure_view_heap, which still gates on heap windows; the test's child process runs with XCL_HEAP_WINDOWS=0, which is the default anyway, and a SKIPPED line of the child is swallowed; from the thread: the e2e title never dispatches on a console list, so no title run reaches this code. Not verified: that the shared copy of the CLEAR_UAV slot is always published.
performance: one mutex lock and one SetDescriptorHeaps per list (reasoned).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K (no SSE4a), Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:14:49Z.
Triage (#1607) – head
77f5142No open standalone PR or main commit makes this change: main's
console_list.rsstill callsSetComputeRootSignaturebeforeensure_dispatch_heaps, binds the view heap only underheap_windows, and clears throughg.pc_gpu_uav. The same change also appears as commitddc8a67(by raylitebull) inside the large amd-dev port branches (#2604, #2704, #2738 and others, 200+ commits each). It is not on main, and those PRs are not a reasonable replacement for this one.Main has changed the ClearUAV branch since this PR's base (it now clears through
list_x::uav_clear_resource), so the rebase needs to keep that and applyclear_uav_gpu_handleon top.ensure_dispatch_heapsnow also takes and returnsshared_view_bound.Binding the global view heap when
heap_windowsis off is a behaviour change for every translated dispatch. It is not covered by a title run here.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T14:39:29Z.
Follow-up review (head
74962998, since77f5142, diff read, not a merge-check):main(the own change is the same apart from context and commit-message wrapping).New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-02T18:35:16Z.
merge-check
base:
c53e969602head:
749629981cverdict: not yet: the targeted console-list tests passed and the workspace and retail smoke runs ended early on both builds.
Windows / AMD RDNA4 (native D3D12) — console-list descriptor heap and ClearUAV checks on
7496299Clean merge onto
mainatc53e969(merge commit9a615df349b2e3befa762ef1c37ac0c6dd816079).git diff --checkwas clean.Setup
d3d12SDKLayers.dll, DXC 1.9.2609.5Tested
cargo build --workspacepassed.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputexited 101 on both builds. The baseline table row is from a prior run of the same commit, machine, SDK, and command.SKIPPEDnoticesmainCounts are partial because two test processes aborted on each build.
main— none observed in comparable results.--test-threads=1 --show-output --nocapture. This includes theXCL_HEAP_WINDOWS=0subprocess, descriptor-heap ordering before the root signature, and ClearUAV shared-slot selection and sampler rejection.uploads_start_from_each_subresources_statepassed.Shared failures and process aborts
fuzz_validate_and_gpu_1,fuzz_validate_and_gpu_3, andtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobsreported failures on both builds.gpu_compute_e2etest processes exited with0xc0000409on both builds.Retail smoke
Ran
scripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <debug binary>withXCL_UMA_DRIVER=mixedfor title hash2c508222.main0xc00004090xc00004090xc0000409The higher initial startup commit did not reproduce. These exits leave retail behavior unverified.
Diff review
The focused test recorded the descriptor-heap call ahead of the compute root signature. The ClearUAV test verified shared-slot preference, fallback, and sampler rejection.
Not tested
Remaining workspace tests after the aborts, retail performance, and pixel readback from a retail ClearUAV operation.
AI use
Codex (GPT-6) merged and built the PR, ran the tests, compared the results with
main, reviewed the diff, and drafted 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.