D3D12.X: ensure view and sampler descriptor heaps before console-list dispatches #2323
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!2323
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2323/head"
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 14:23 UTC · original
Decodere:fix-1991-console-list-sampler-heap→main· +135 −12 · 1 files · 1 commits · merged 2026-11-25 18:16 UTCWhat is in it
Follow-up to #1991 in
crates/xcl/src/hle/d3d12x/console_list.rs:HEAPS_MARKER: Replaces the singleheaps_set: boolflag inconsole_list::close()with(bound_heaps: Vec<ID3D12DescriptorHeap>, has_sampler_heap: bool). WhenHEAPS_MARKERhasn == 0,close()now clears the command list viaSetDescriptorHeaps(&[])and clears(bound_heaps, has_sampler_heap)to matchlist_x::set_descriptor_heaps_x; whenn > 0, it records the bound heaps returned bylist_x::pc_heapsand whether a sampler heap is among them.default_dispatch_heapshelper (mirroringlist_x::default_bound_heaps) and callsensure_dispatch_heaps(&list, &mut bound_heaps, &mut has_sampler_heap)before each translated compute dispatch. When fewer than 2 heaps are bound,ensure_dispatch_heapslazily initializesconsole_heap::shared_sampler_heapvialist.GetDevice()if needed, filters shared heaps to the list's device, binds both view and sampler heaps when 0 heaps are bound (or sampler alone when!pso::heap_windows()), and upgrades 1-heap bindings missing either a view or sampler heap so directly-indexed translated pipelines (SAMPLER_HEAP_DIRECTLY_INDEXED) never dispatch with 0 sampler heaps bound.Tested
cargo test --release -p xcl --lib hle::d3d12x::console_list::tests:: -- --test-threads=1 --nocaptureon NVIDIA GeForce RTX 4060 and underXCL_ADAPTER="Microsoft Basic Render Driver"/XCL_ADAPTER=warp:7 passed, 0 failed, 0 ignored(0skipped), including:default_dispatch_heaps_binds_and_upgrades_missing_view_or_sampler(pure CPU): covers 0-heap binding under bothheap_windowsmodes (Some(view)andNone), 1-heap view->view+sampler and sampler->view+sampler upgrades, no-op when satisfied, and(None, None).gpu_ensure_dispatch_heaps_binds_view_and_sampler_heaps(D3D12,skip_test-guarded): exercisesensure_dispatch_heaps_withon a realID3D12GraphicsCommandListacross 0-heap bind, idempotent repeat call,SetDescriptorHeaps(&[])reset +!heap_windowssampler-only bind, 1-view-heap upgrade, 1-sampler-heap upgrade, andlist.Close().cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocaptureon RTX 4060):23test binaries,1267 passed, 0 failed, 46 ignored(28pre-existing hardware/debug-layerSKIPPED:21no wave64on 32-lane GPU,3wave32 per-lanerefused,2missing D3D12 debug layer,1driver cache toggle,1no heap windows;0skipped inconsole_list).Regression run
Paired 60 s
scripts/smoke.ps1runs on the same RTX 4060 host againstorigin/main(06c9f5505f63f10c5ec49ef932d75b2c28177324) and PR head (a78ffa89f64c31ed248b1e643e6ebb6c1b31455f):Baseline (
origin/main):PR head:
Not tested
XCL_CONSOLE_LISTS=1enabled (default smoke runs withoutXCL_CONSOLE_LISTS=1; descriptor-heap binding logic is verified directly by the unit and D3D12 command-list tests).d3d12SDKLayers.dllis not installed on this host).AI use
Implemented and verified with Google Antigravity (Gemini 4 Neon).
@nnonno91 on GitHub · 2026-11-25 14:29 UTC · original
Independent Radeon check of
a78ffa89f64c31ed248b1e643e6ebb6c1b31455f.Tested
cargo test --locked -p xcl --lib hle::d3d12x::console_list::tests:: -- --nocapture --test-threads=1gave 7 passed, 0 failed. This fixture uses the D3D12 default device.cargo test --locked -p xcl --lib gpu_ensure_dispatch_heaps_binds_view_and_sampler_heaps -- --nocapture --test-threads=1then passed on the Radeon. It exercised empty bindings, sampler-only and one-heap upgrades, repeat binding and command-list close. Both runs had 0 ignores and no skips. The selection edit was restored.Not tested
Retail smoke, the full workspace suite, and GPU shader output from a translated dispatch in this check.
AI use
OpenAI Codex (GPT-6.2 Sol) adapted the test fixture, ran the checks and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 17:53 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!
@DarkPanda69 on GitHub · 2026-11-25 14:29 UTC · original · edited 2026-11-25 19:29 UTC
Correction:
gpu_ensure_dispatch_heaps_binds_view_and_sampler_heapscreates its device withagility::create_device(None, ..), so it runs on DXGI adapter 0, which on this machine is the RX 9070 XT, whateverXCL_ADAPTERsays. Both runs of that test below were on the RX 9070 XT: the AMD result stands, but the RTX 3060 line for this test is not an RTX 3060 result. The per-cardgpu::counts are unaffected.AMD run, plus an RTX 3060: the new GPU test passes on both, and nothing else in the GPU suite changes.
Head
a78ffa8applied onmain06c9f55, debug, Windows 11 Pro 26200,cargo test -p xcl --lib -- gpu:: --test-threads=4:gpu_ensure_dispatch_heaps_binds_view_and_sampler_heapsok. 638 passed, 2 failed, 22 ignored; the 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain.Not tested: a title with
XCL_CONSOLE_LISTS=1, the D3D12 debug layer (not installed here).AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.