Skip to content

d3d12 test: catch a zero-filled depth-resolve readback - #8415

Open
Raxstreams wants to merge 4 commits into
ItsNotRexed:mainfrom
Raxstreams:codex/depth-resolve-readback-sentinel
Open

Raxstreams wants to merge 4 commits into
ItsNotRexed:mainfrom
Raxstreams:codex/depth-resolve-readback-sentinel

Conversation

@Raxstreams

Copy link
Copy Markdown

Claimed in the coordination issue as: #8186 (comment) (depth-resolve test hardening, no item ID assigned).

Depends on: #7905

What and why

Depth-only D32 has no stencil data to distinguish a zero-filled readback from an untouched destination cleared to 0. The test now clears its destination to 0.125 and uses that value for every depth texel that a resolve should leave untouched. The first two commits come from #7905. The follow-up is the final commit.

Tested

AI-assisted: yes (Codex).

Checklist

  • No game data, keys or decryption. The first-byte check and git diff --check passed on the changed test.
  • Translator contract table entry (inapplicable to this test-only change).

optinium51-bot and others added 3 commits November 23, 2026 18:41
…ared in its own list (ItsNotRexed#6610 follow-up)

ItsNotRexed#6610 makes ExecuteCommandLists refuse a whole batch that holds a list whose
Close failed. resolve_and_read still recorded the clears, the refused resolve
and the readback copies in one list and executed it on the layer, so since
ItsNotRexed#6610 none of it runs and every refused case reads a buffer nothing wrote:
eight "refused ... destination changed" lines and exit 1 on main.

On the layer, the clears (and the edge draw) now run in a list of their own
first. A list whose Close fails is still executed, and its destination is then
read back in a third list, so a refused resolve is still checked against the
destination the clears left. The host path is unchanged.

Tested on Windows 11 build 26200, MSVC 14.52 (VS 2026), RTX 3060 (NVIDIA
616.92). d3d12_depth_resolve: main 9b60c92 fails 8 of 8 runs; with this, 5 of
5 pass, with the same counts (RTX 3060: 27 of 51 match, 24 host quirks,
7 refusals alike; WARP: 37 of 37) and 12 refusals keeping the destination.
Full ctest: 236 of 237 pass; the remaining failure is d3d12_vulkan_device,
which ItsNotRexed#7125 fixes, and with ItsNotRexed#7125 merged both pass. Not run: the edge cases
(no glslangValidator at build time). No game data.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review on ItsNotRexed#7905: a successful case on the layer again records the
clears, the edge draw and the resolve in one list, as the host path does.
Only a list whose Close failed is run between a list of the same clears and
a list that reads the destination back, so the lacking-mode path stays
covered.

Tested on an RTX 3060 (NVIDIA 616.92) with MSVC 14.52: d3d12_depth_resolve
passes 5 of 5 runs with the same counts; full ctest 236 of 237 (the other
failure is d3d12_vulkan_device, fixed by ItsNotRexed#7125). No game data.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Raxstreams
Raxstreams marked this pull request as ready for review November 23, 2026 18:45
@Envyre

Envyre commented Nov 23, 2026

Copy link
Copy Markdown

Tested on an RTX 4070 Ti SUPER (NVIDIA 621.14, Windows 11): d3d12_depth_resolve_test passes with the same summary as the parent commit (145 host comparisons matched, 12 refusals kept, 20 edge MIN/MAX pairs differ; NVIDIA 74/97 with 15 host quirks, WARP 71/71), so moving the destination clear off 0.0 changes no host comparison.

This closes the gap noted on #7930: the clear at runtime/test/d3d12_depth_resolve_test.cpp:183 and both branches of expected_planes (:302-303) now use target_clear_depth (:54). As a mutation check, removing the post-refusal copy_out(side.p) makes all 12 refused cases fail, including the four D32 depth-only ones. 0.125 isn't a 24-bit rounding tie and none of the source clears (0.25 / 0.75 / 1.0) use it, so a resolved pixel can't pass as kept.

Nit: a readback that never ran is still reported as "destination changed". LGTM.

AI-assisted (Claude Code).

@Snooozs

Snooozs commented Nov 23, 2026

Copy link
Copy Markdown

Independent check on Windows 10: d3d12_depth_resolve fails on plain main 1befe1d (eight refused ... Close 0x80070057, destination changed lines, exit 1) and passes with this PR (head 92612be) merged onto main 867d922 (clean merge, only the test file changes).

Windows 10 Pro 22H2 (10.0.19045), NVIDIA GeForce RTX 5060 Ti (driver 621.01, Vulkan 1.4.357) with the hardware device and WARP as hosts, Vulkan SDK 1.4.363.0, VS 2022 RelWithDebInfo; ctest -R "^d3d12_depth_resolve$": 1/1 passed.

AI-assisted (Claude Code); the build and the run are from that machine.

@Raxstreams

Copy link
Copy Markdown
Author

@Envyre Thanks for checking the result and the skipped-copy case. In 69d765fee the failure message reports whether the readback matches the expected destination clear. A failed comparison can come from a readback that never ran. The assertion is the same, and the focused d3d12_depth_resolve CTest passed after rebuilding. AI-assisted (Codex).

@h0useadv

Copy link
Copy Markdown

Tested 92612be73 (based on main dde82f27e, includes #7905) on AMD Radeon RX 9070 XT (RDNA4), AMD Windows driver 32.0.32029.2010, Windows 11 Pro build 26300: pass. Built with clang-cl 23.1.6 + lld-link against an xwin splat (MSVC 14.44, SDK 10.0.26100), RelWithDebInfo; synthetic, no game files.

I didn't repeat the zero-fill fault injection; this is a pass of the hardened test on RDNA4 with the AMD driver as host.

AI-assisted (Claude Code).

@lucasserafin94

Copy link
Copy Markdown

Tested 69d765f merged onto main 2a3b3b5 (Windows 11, one laptop with two GPUs: RTX 5090 Laptop (Blackwell, NVIDIA 621.35) and Intel Arrow Lake-HX iGPU (Xe-LPG, Intel 101.9175); MSVC 14.44, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, built with scripts/build_runtime.ps1): pass.

ctest -R '^d3d12_depth_resolve$': passed with LEONIDA_VK_DEVICE=5090 and =intel. On main it fails on both: 8 refused D24S8/D32S8 cases report destination changed, because since #6610 ExecuteCommandLists refuses the whole invalid list, so the readback copy recorded in it never runs and the stencil reads 0x00 instead of 0x5a.

#7905 and #7930 fix the same test and also pass here; only one is needed.

AI-assisted (Claude Code); no game files involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants