D3D12.X: clear BlendEnable on integer RTVs, strip unsupported UAVs, set T# levels, and pipeline PresentX #1988
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!1988
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1988/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?
@raylitebull on GitHub · 2026-11-25 00:25 UTC · original
raylitebull:feat/world-d3d-gameplay-fixes→main· +743 −46 · 3 files · 1 commits · merged 2026-11-25 10:40 UTCFixes four D3D12.X / PC translation mismatches across graphics pipelines, resource allocation, texture views, and presentation:
real.rs): clearsBlendEnable/LogicOpEnableonUINT/SINTrender target slots acrossCreateGraphicsPipelineState,CreatePipelineStatestreams, translated GS/MS streams, and direct DXIL pipelines (sanitize_integer_rt_blend).device_x.rs,real.rs): checksis_typeless_uav_formatfirst and queriesD3D12_FEATURE_FORMAT_SUPPORTper device+format (uav_format_supported_by_caps,device_format_supports_uav) to stripALLOW_UNORDERED_ACCESSon MSAA or host-unsupported formats acrossGetResourceAllocationInfo(pc_allocation_size),create_placed_resource_x,dev_create_committed_resource_x, and initial state mapping (pc_resource_desc_for_device,pc_initial_state_for_desc).real.rs): populates GFX10BASE_LEVEL(t[3][15:12]),LAST_LEVEL(t[3][19:16], orlog2(SampleDesc.Count)for MSAA), andMAX_MIP(t[5][7:4]) insrv_tsharp_from_desc/view_shape_desc.PresentX(present.rs): integrates aPresenter-owned 2-slotPresentRing/PresentPipeover a 3-buffer swap chain (XCL_PRESENT_SYNC=1forces 1 slot) withslot_dumpsfence-safe readback tracking andDropfence draining.Part of #1833.
What is in it
crates/xcl/src/hle/d3d12x/device_x.rs:is_typeless_uav_format-first ordering inuav_format_supported_by_caps/device_format_supports_uav,texture_format_allows_uav,strip_unsupported_uav_for_device,pc_resource_desc_for_device,pc_initial_state_for_desc, pluspc_resource_desc_strips_uav_on_unsupported_formats_and_msaa.crates/xcl/src/hle/d3d12x/present.rs:Presenter-ownedPresentPipe/PresentRing(slot_dumps,prepare_pipelined_slot,mark_pipe_drained,Dropdrain) andpresent_ring_overlaps_previous_frame_and_drains_cleanly.crates/xcl/src/hle/d3d12x/real.rs:view_shape_desc,srv_tsharp_from_desc,sanitize_integer_rt_blend,pc_allocation_size/create_placed_resource_x/dev_create_committed_resource_xUAV sanitization, pluspso_blend_and_tsharp_tests.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto0f293be(587d77b).cargo check --workspace --tests: passed.XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4: passed (pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa,present_ring_overlaps_previous_frame_and_drains_cleanly, andpso_blend_and_tsharp_testsincluded and passed).scripts/smoke.ps1regression pair on AMD Radeon RX 9070 (@Toons29): passed (0 device removals, 0 crashes).Regression run
60 s
scripts/smoke.ps1pair on exact head587d77bvsmain(AMD Radeon RX 9070, driver 32.0.32029.2010, Windows 11 26300, release,XCL_NETWORK=0on a retail title), contributed by@Toons29:main:
this PR:
Not tested
scripts/smoke.ps1pair on587d77b, fullcargo test --workspacesuite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use
0f293be, and unit tests; the author reviewed the diff and test output.@gsucristo on GitHub · 2026-11-25 00:57 UTC · original
Technical review findings:
Blocking
uav_format_supported_by_capsfalsely rejects typeless UAV textures on real D3D12 drivers (device_x.rs,uav_format_supported_by_caps): Checks(support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) == 0beforeis_typeless_uav_format(format). On real PC D3D12 drivers,CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)for*_TYPELESSformats does not setTYPED_UNORDERED_ACCESS_VIEW(typed UAVs are created with concrete sibling formats), so this will wrongly stripALLOW_UNORDERED_ACCESSfrom typeless textures.Major
device_x.rscreate_placed_resource_x,real.rsdev_create_committed_resource_x):pc_resource_desc_for_device/strip_unsupported_uav_for_deviceare only called in allocation-size queries (get_resource_allocation_info_x,place_console_texture,pc_allocation_size), whilecreate_placed_resource_xanddev_create_committed_resource_xstill call staticpc_resource_desc, so allocation size and resource creation can disagree.p.dumpsif a frame-dump fence wait times out (present.rs,present_now): If frame N-1 hadXCL_FRAME_DUMPactive andfence::waittimed out (non-fatal), frame N'sprepare_pipelined_slotonly waits for frame N-2, andpresent_nowunconditionally runsp.dumps.clear(), freeing readback buffers while frame N-1's copy is still in flight.PRESENT_PIPEglobal side-table leaks/aliases acrossPresenterlifetime (present.rs,PresentPipe/PRESENT_PIPE):Drop for Presenterandp.disabled = truedon't clearPRESENT_PIPE, leakingspare_alloc/slot_sourcespast teardown and risking pointer-reuse aliasing. Moving these fields directly onto the privatePresenterstruct avoids the extra mutex and fixes lifetime cleanly.(The integer RTV blend sanitization and SRV T# mip/MSAA metadata parts look clean and would be easy to land if split out.)
@raylitebull on GitHub · 2026-11-25 01:15 UTC · original
Thanks for the thorough review and catch,
@gsucristo!Updated
#1988cleanly onto0f293be(587d77b):is_typeless_uav_formatcheck order (device_x.rs): checkedis_typeless_uav_format(format)beforeD3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEWinsideuav_format_supported_by_capsanddevice_format_supports_uav, so*_TYPELESStextures keepALLOW_UNORDERED_ACCESSon real D3D12 drivers (verified withSupport1 = 0typeless unit assertions).real.rs): routedcreate_placed_resource_xanddev_create_committed_resource_xthroughpc_resource_desc_for_device.Presenter-owned ring state & fence-safe dump cleanup (present.rs): movedPresentPipefields directly ontoPresenter(eliminating the globalPRESENT_PIPEside-table + draining fences onDrop), and tracked readback dumps per slot (slot_dumps[prev]) so fence timeouts never UAF active readback buffers.Verified locally (
cargo check --workspace --tests+XCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=4).@futurepro62 on GitHub · 2026-11-25 00:59 UTC · original · edited 2026-11-25 01:21 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
505e974(on its base8c4a46a).Tested
cargo build --workspace, thenXCL_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::dxil::fuzz_tests: 989 passed, 0 failed, 43 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,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.pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa,present_ring_overlaps_previous_frame_and_drains_cleanly,integer_rtv_blend_sanitization_clears_uint_sint_and_preserves_float,rt_format_array_layout_matches_stream_parsing,srv_tsharp_populates_base_level_and_msaa_last_level.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 999 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #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 #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 #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 #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 #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main7994cd1too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests andconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@Anon64 on GitHub · 2026-11-25 01:47 UTC · original
Regression run for this PR: head
505e974, based onmain80f4819. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
80f4819:this PR:
No device removals or crashes; 101 % of main's frames, 100 % of its peak commit.
Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings:
XCL_DIRECT_DXILandXCL_HEAP_WINDOWSunset).Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@JJAutoCompare on GitHub · 2026-11-25 02:19 UTC · original
Empirical verification of xcl-dev/xcl PR #1988
587d77be2a7208c7e7972453b7f9074f19e10a04, fetched from liveoriginrefrefs/pull/1988/headand tested in a clean detached checkout.origin/mainwasaaa093657bd96a146c05c0c1a9b61149fe761453.git merge-tree --write-tree origin/main HEADexited 0 with treecb845f485f9a34bc2fa96360f702815bfba46100.Tested
26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB with driver32.0.101.9175, wave range 8–32 andDoublePrecisionFloatShaderOps=0. DXC/DXIL1.9.2609.5.rustc 1.100.0 (0ef1bc386 2026-11-09). Unoptimized dev/test profiles with debug info and incremental compilation disabled.cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the GPU lock.cargo test -p xcl --lib <filter> -- --show-outputran once per filter outside the GPU lock. 5 passed, 0 failed, 0 ignored, 0 skipped.pc_resource_desc_strips_uav_on_unsupported_formats_and_msaapresent_ring_overlaps_previous_frame_and_drains_cleanlyinteger_rtv_blend_sanitization_clears_uint_sint_and_preserves_floatrt_format_array_layout_matches_stream_parsingsrv_tsharp_populates_base_level_and_msaa_last_levelcargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputcompleted in one pass throughL:\XclTooling\Invoke-ArcTest.ps1under the shared Arc lock. Cargo exited 101. Across 20 targets, libtest reported 1,044 passed, 26 failed, 45 ignored, 0 filtered. The log has 26SKIPPEDlines across 16 test identifiers, including skipped subcases. Libtest's passed count includes early returns, and skipped cases provide no coverage. All five targeted tests also passed in the workspace run.xcllibrary tests reported 996 passed, 25 failed, 25 ignored. Of the 25 failures, 21 returned0x80070057fromCreateComputePipelineState. The other four were assertions on fused multiply-add overflow, implicit-LOD sampling between mips, preservation of the high half duringv_add_f16, and pixel-shader wave reductions.e2ereported 2 passed and 1 failed.test_title_runs_and_game_folder_is_untouchedobserved a blue top-right pixel ([0, 0, 255, 255]) where theRSSetDepthBiasX(-1000.5)check expected green. The same title run logged a pass for the frame clock and PresentX back-buffer check.L:\XclTooling\sol-slot-8\tmp\pr1988-suite.log.Not tested
mainbaseline suite, merged-tree suite, or retail-title smoke runs onmainand the PR head. The run establishes the outcomes at the PR head. Whether the PR introduced any of the failures remains unverified.XCL_SAMPLE_*unset). The log also records early returns for host-specific audio and system-runtime checks.AI use
gpt-6.2-sol) ran the build and tests and drafted this report. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified the counts againstpr1988-suite.logand published this report.Workspace
SKIPPEDlinesFailed workspace tests
@DavidM1911 on GitHub · 2026-11-25 03:31 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!
@Toons29 on GitHub · 2026-11-25 04:32 UTC · original
Regression run of
587d77beon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainoncbc296ab, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 101 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.@raylitebull on GitHub · 2026-11-25 10:38 UTC · original
Thanks @Toons29 for running and sharing the exact-head 60 s
scripts/smoke.ps1pair on587d77b(0 device removals, 0 crashes) — added to the PR description!