D3D12.X: align promoted UAV clear values, key UAV support by adapter LUID, and use device-aware footprints fallback #2280
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!2280
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2280/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 12:16 UTC · original
Decodere:fix-1991-device-x-clear-uav-cache→main· +202 −26 · 2 files · 1 commits · merged 2026-11-25 18:16 UTCWhat is in it
Follow-up to #1988 and #1991 fixing three D3D12.X resource-creation and format-support bugs in
crates/xcl/src/hle/d3d12x/device_x.rsandcrates/xcl/src/hle/d3d12x/real.rs:B5G6R5/B8G8R8X8RT+UAV textures (pc_clear_format/pc_clear_for_desc): #1991 promotedB5G6R5_UNORM(85) +ALLOW_UNORDERED_ACCESStoR8G8B8A8_UNORM(28) andB8G8R8X8_UNORM(88) +ALLOW_UNORDERED_ACCESStoB8G8R8A8_UNORM(87) inpc_resource_desc, but resource creation still ranclearthroughpc_clear(leavingclear.Formatat85/88), causing D3D12CreateCommittedResource/CreatePlacedResourceto fail withE_INVALIDARG. Addpc_clear_format(pc_format, clear_format)andpc_clear_for_desc(clear, pc_format, buf)aligning(28, 85) => 28and(87, 88) => 87(while preserving native85/88on render-target-only resources without UAV), and wire it acrosscreate_placed_resource_x,dev_create_committed_resource_x,dev_create_placed_resource_xfallback, andown_memory_if_larger_on_the_pc.device_format_supports_uav:UAV_FORMAT_SUPPORTpreviously keyed by rawdevice as usizepointer and was never evicted on device release; reusing a freed device address on a different adapter returned stale UAV support. KeyUAV_FORMAT_SUPPORTby((luid.LowPart, luid.HighPart), format)viaID3D12Device::GetAdapterLuid()(matchingTYPED_UAV_SUPPORT).get_copyable_footprints_x: WhenGetCopyableFootprintsreturnsUINT64_MAX, retry withpc_resource_desc_for_device(this, &x)instead ofpc_resource_desc(&x)(matchingget_resource_allocation_info_xandcreate_placed_resource_x), so device-unsupportedALLOW_UNORDERED_ACCESSflags are stripped on retry.Tested
1.9.2609.5(01b62ad4), release build.0 passed, 3 failed:pc_clear_for_desc_aligns_promoted_uav_targets_onlysaw85instead of28,device_format_supports_uav_keys_cache_by_adapter_luidhit the stale pointer-keyed cache on pointer reuse across adapter LUIDs, andget_copyable_footprints_x_strips_device_unsupported_uav_on_retryleftALLOW_UNORDERED_ACCESSset on retry).cargo test -j 4 -p xcl --lib hle::d3d12x::device_x::tests -- --nocaptureandcargo test --release -p xcl --lib hle::d3d12x::device_x::tests -- --nocapture): 14 passed, 0 failed, 0 ignored (0.21 s; all 10 existingdevice_xtests + 4 new tests:pc_clear_for_desc_aligns_promoted_uav_targets_only,gpu_promoted_uav_clear_values_pass_create_committed_resourceverifying live RTX 4060CreateCommittedResourcefails withpc_clearand succeeds withpc_clear_for_descfor both85->28and88->87RT+UAV textures,device_format_supports_uav_keys_cache_by_adapter_luid, andget_copyable_footprints_x_strips_device_unsupported_uav_on_retry).cargo build --release --workspaceandcargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture): 23 test binaries, 1254 passed, 0 failed, 46 ignored, plus 27 runtimeSKIPPEDlines (20no wave64on RTX 4060,3wave32 per-lane formrefusedby driver,2missingd3d12SDKLayers.dll/ D3D12 debug layer,1driver shader cache toggle unavailable,1no heap windows).Regression run
Baseline (
origin/main1a0bbe3a):PR head (
7fa87890):Not tested
#[ignore]tests on this machine.CreateCommittedResourceand 60 s title smoke ran live).AI use
Implemented and verified with Google Antigravity (Gemini 4 Neon). All code changes, failing-first and post-fix unit tests, full workspace release tests, and paired 60 s RTX 4060 smoke runs were reviewed and executed locally.
@Lum7nt on GitHub · 2026-11-25 13:04 UTC · original
Independent Windows release test on clean head
7fa8789091281de67c1940fdf04e8f53e5cfe5ed: Windows 11 build 26300, Rust 1.100.0 MSVC; this machine has an RX 9070 XT (driver 32.0.32029.2010).cargo test --offline --locked --release -p xcl --lib hle::d3d12x::device_x::tests -- --nocapture --test-threads=1Result: 14 passed, 0 failed, 0 ignored; no SKIPPED messages, including
gpu_promoted_uav_clear_values_pass_create_committed_resource. The latter usesD3D12CreateDevice(None, ...)and can fall back to WARP; this run did not log the actual device identity, so I cannot independently confirm the adapter used by that test.Not tested: full workspace, retail title, paired smoke runs, or live switching between multiple adapters.
AI use: OpenAI Codex (GPT-6; exact variant unavailable) ran the tests and drafted this report.
@oni-swr on GitHub · 2026-11-25 13:05 UTC · original
Test report: AMD Radeon RX 7800 XT (RDNA3, native wave64) for head
7fa8789091281de67c1940fdf04e8f53e5cfe5ed.Setup: RX 7800 XT, driver 32.0.31035.1003, Windows 11 Pro 10.0.26200, rustc/cargo 1.100.0, debug build, DXC 1.9.0.5512 (
dxcon PATH). Detached checkout of the PR head, which includesea088a5. I did not merge it with currentmain. I read the diff (device_x.rs,real.rs) before running it.Targeted (
cargo test -p xcl --lib -- uav --nocapture --test-threads=1): 15 passed, 0 failed, 0 ignored. The filter also matches existing UAV tests. The PR's four new tests all passed and none printedSKIPPED:device_x::tests::pc_clear_for_desc_aligns_promoted_uav_targets_onlydevice_x::tests::gpu_promoted_uav_clear_values_pass_create_committed_resource(the GPU test, which ran here)device_x::tests::device_format_supports_uav_keys_cache_by_adapter_luiddevice_x::tests::get_copyable_footprints_x_strips_device_unsupported_uav_on_retryFull suite (
cargo test --workspace --no-fail-fast -- --test-threads=4): 1253 passed, 1 failed, 46 ignored.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, the known RDNA3 failure onmain. The PR does not touch it.SKIPPEDlines: 6 inlower_dxil::tests(f16 / f32 conversion programs refused) andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows). These are not coverage.Not tested: retail title or
scripts/smoke.ps1(this is a runtime change, so real-title UAV clear and footprint behaviour is unchecked), NVIDIA, Intel (the LUID-keyed support cache is only exercised through a fake device here), Wine/vkd3d, this PR merged with currentmain.AI use: this report was run and written by Claude Code (Claude Sonnet 5.5). I read the diff but did not change any code.
@nnonno91 on GitHub · 2026-11-25 15:10 UTC · original
Independent Windows test of
7fa8789091281de67c1940fdf04e8f53e5cfe5ed. Real D3D12 texture creation behaved as expected on both adapters.Tested
gpu_promoted_uav_clear_values_pass_create_committed_resourcewith explicit adapter selection added to the local fixture. The log identified Radeon integrated graphics and RTX 5090 in their respective runs. Each run reported 1 passed, 0 failed, 0 ignored, and no logged skips. For both B5G6R5 and B8G8R8X8, D3D12 rejected the old mismatched clear format and accepted the corrected format.pc_clear_for_desc_aligns_promoted_uav_targets_only,device_format_supports_uav_keys_cache_by_adapter_luid, andget_copyable_footprints_x_strips_device_unsupported_uav_on_retryunchanged. Each reported 1 passed, 0 failed, 0 ignored, and no logged skips.Not tested
Texture pixel readback, the parent revision, retail titles, or the full workspace suite. The adapter-selection change was temporary.
AI use
OpenAI Codex (GPT-6.2 Sol) prepared and ran the tests, verified the results, and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 17:20 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
@SlopTart on GitHub · 2026-11-25 19:16 UTC · original
Tested: current
origin/main2898511a(which includes this merge7fa87890, merged 2026-11-25 15:03), 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).This merge adds a new red on the Wine/vkd3d lane:
hle::d3d12x::device_x::tests::gpu_promoted_uav_clear_values_pass_create_committed_resourcefails deterministically, 3/3 solo at--test-threads=1on plain main (it passed on this lane before7fa87890).Which side fails is interesting: it is not the promoted path, it is the guard that the stale clear value is rejected. With a one-line local probe (message only, no behaviour change, reverted after the run) the failing pair is the first one,
85 -> 28:So on this lane
CreateCommittedResourcereturns success for a promoted typeless resource desc paired with the original-format clear value, where the test (and native validation, per the PR's own green checks) expects an error. The88 -> 87pair is never reached. The promoted-side asserts (pc_fmt == promoted_fmt,new_cv.Format, theunwrapon the promoted clear) all pass here, so the promotion logic itself looks right on RADV/vkd3d; what differs is the validation that rejects the mismatched clear value.Effect beyond this test: every
gpu_sweep on current main now carries this as a fourth baseline failure (we see it on all six PR trees merged today: #2404, #2427, #2440, #2441, #2375, #2398, all otherwise clean).Not tested: native Windows on this machine (no Windows boot); retail titles (counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@DarkPanda69 on GitHub · 2026-11-25 13:00 UTC · original · edited 2026-11-25 19:28 UTC
Correction:
gpu_promoted_uav_clear_values_pass_create_committed_resourcecreates its device withD3D12CreateDevice(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: the new test ok" line is not an RTX 3060 result, and the sentence about covering the LUID-keyed UAV support per device on two vendors is wrong (only the AMD device was exercised). The per-cardgpu::counts are unaffected.AMD run (listed as untested), on a machine with two GPUs (RX 9070 XT + RTX 3060), each picked with
XCL_ADAPTER: the new test passes on both.Head
7fa8789applied onmain1a0bbe3, debug, Windows 11 Pro 26200,cargo test -p xcl --lib -- gpu:: --test-threads=4:gpu_promoted_uav_clear_values_pass_create_committed_resourceok. 629 passed, 2 failed, 22 ignored, 6 SKIPPED; the 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain.Each run used one adapter, so this covers the LUID-keyed UAV support per device on two different vendors, but not switching adapters inside one process.
Not tested: a title, Intel.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.