D3D12.X: ignore console DCC-only ClearRenderTargetView sentinel #3249
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3249"
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 Kalmarv on 2026-11-29T00:56:58Z.
Ignore Xbox's DCC-metadata-only
ClearRenderTargetViewsentinel (NumRects == u32::MAXwithpRects == NULL) instead of forwarding it to PC D3D12.On console D3D12.X, calling
ClearRenderTargetViewwithNumRects = 0xFFFFFFFFand a nullpRectspointer resets only MSAA DCC compression metadata without modifying colour texels. Forwarding(u32::MAX, null)verbatim to PCID3D12GraphicsCommandList::ClearRenderTargetViewdereferences a null rect array and crashes the process (0xc0000005). Because PC D3D12 manages compression metadata internally, returning early preserves the render target's colour and avoids the crash.What is in it
crates/xcl/src/hle/d3d12x/real.rs: return early incl_clear_rtvwhenn == u32::MAX && rects.is_null(); add child-process WARP testclear_rtv_tests::cl_clear_rtv_ignores_console_dcc_sentinel_and_preserves_color(crashes before the fix; passes and reads back[64, 128, 191, 255]unchanged after).Tested
rustc 1.99.0 (b940084d7 2026-09-28), DXC 1.9 (XCL_DXC_DIR), debug for tests and release forxcl-smoke.cargo test -p xcl --lib -- cl_clear_rtv_ignores_console_dcc_sentinel_and_preserves_color --nocapture): failed before the fix (child crashed inside PCClearRenderTargetView), 1 passed / 0 failed after.cargo test --workspace -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::): 2600 passed, 0 failed, 49 ignored.SKIPPEDGPU tests on this adapter (26 total): 21no wave64(RTX 5070 Ti is wave32), 3 wave32 per-lane#1426f16/cvt-f16 refusals, 2no heap windows(opt-inXCL_HEAP_WINDOWS=1).ea3b5e4d) 150 s regression run below (0device removals,0crashes,1574frames vs1695onmain,32994 MBpeak commit vs31546 MBonmain).Regression run
Not tested
NumRects == u32::MAXsentinel (theea3b5e4dsmoke is a regression check only; sentinel handling is verified by the WARP device test).uma_driver::tests::(skipped locally due to pre-existing0x7C10003exit on NVIDIA) andtest_title_runs_and_game_folder_is_untouched.AI use
Imported from ivall/xcl. Originally posted by Foniass on 2026-11-29T14:57:05Z.
Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above, the full suite, and a 60 s
scripts/smoke.ps1run of a retail title against main on the same machine. The 4fuzz_validate_and_gpu_*failures happen on main on this machine too.Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T18:29:55Z.
merge-check
base:
6bfb5c5153head:
6e0a36afdamerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none
review: read the whole diff (
real.rs, +140 -1). No correctness problem found.cl_clear_rtvreturns before forwarding whenn == u32::MAX && rects.is_null(). Forwarded, that call reads a null rect array.hle::d3d12x::real::clear_rtv_tests::cl_clear_rtv_ignores_console_dcc_sentinel_and_preserves_color: 3 of 3 passed. Its child run on WARP passes (not skipped) when run with--nocapture.if false && ...) fails the test 3 of 3: the child process does not exit cleanly and the parent'sassert!(output.status.success())fails (real.rs:11415). Good.SKIPPEDline stays in the captured output, so a skip is not visible in a suite run.performance: none: one comparison per
ClearRenderTargetView.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)
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T10:40:36Z.
merge-check
base:
1c8b551475head:
6e0a36afdamerge: clean (trial-merge commit f3a65ffbdbaf9decb6f09083167964df69b00d97, git diff --check clean)
build: cargo build --workspace ok; cargo build --release -p xcl ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets): 2910 passed, 0 failed, 51 ignored (+1 new test vs main baseline). Targeted new test hle::d3d12x::real::clear_rtv_tests::cl_clear_rtv_ignores_console_dcc_sentinel_and_preserves_color passed with 0 skips. 28 SKIPPED lines (host environment only: 22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)).
review: Read the full merged diff (+140/-1 in crates/xcl/src/hle/d3d12x/real.rs). Early-returns in
cl_clear_rtvwhenn == u32::MAX && rects.is_null(), dropping the console DCC-metadata-only clear sentinel before it can fault PCClearRenderTargetViewon a null rect array while leaving normal full-RT clears (n == 0) and explicit rect clears untouched. The new subprocess WARP test clears an RGBA8 render target to[0.25, 0.5, 0.75, 1.0]throughcl_clear_rtv, issues the(u32::MAX, null)sentinel with zero color, and verifies readback preserves[64, 128, 191, 255]. Minimal, exact, no scope creep or UB.performance: 60 s retail smoke (title: 29640639): 1648 frames (+12.7% vs
1c8b5514baseline 1462 frames), 14670 MB peak commit (-8.6% vs 16043 MB baseline), 0 device removals, 0 crashes.verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T15:25:05Z.
merge-check
base:
16c2fd082ahead:
6e0a36afdamerge: clean
build: ok
tests: 3013 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 4 medium, 1 nit (below)
performance: 60 s smoke run: 1683 → 1658 frames (98 % of main), peak commit 18505 → 18661 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 231 s there, 0 device removals, 0 crashes, 3.7 presents/s; run with
XCL_SKIP_CS=95cc13288a27a96e(the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: ClearRenderTargetView with NumRects == u32::MAX and a null rect pointer now returns before reaching the PC, where it read a null rect array and crashed. The head has not moved since my last merge-check (safe to merge), and two later merge-checks also say safe to merge. Nothing blocks it; the open points are evidence and visibility.
Medium
Nit
Checked and fine
How this was tested
16c2fd08, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main16c2fd08and on this merge; presents per 2 s at the end: 60 60 60.XCL_RUN_SECONDS=300and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
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.