Skip to content

d3d12_depth_resolve_test: a refused resolve reads the destination through lists that run - #7909

Closed
justrealyme wants to merge 1 commit into
ProjectLeonida:mainfrom
justrealyme:test-depth-resolve-refused-readback
Closed

justrealyme wants to merge 1 commit into
ProjectLeonida:mainfrom
justrealyme:test-depth-resolve-refused-readback

Conversation

@justrealyme

Copy link
Copy Markdown

Claimed in the coordination issue as: #7804 (comment)

What and why

d3d12_depth_resolve_test checks that a refused ResolveSubresourceRegion keeps its destination. Each refused case recorded the destination's clear, the resolve and the copy into the readback buffer in one list. Its Close fails, so ExecuteCommandLists refuses the whole list ([rt] d3d12: ExecuteCommandLists: list 0 is invalid; refusing batch): the clear and the copy never run, and the test compared whatever memory the readback buffer was given with the clears.

On an RTX 5070 Ti that made clean main fail every run, with a different set of refused ... destination changed lines each time, for example:

refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed
refused D32S8 stencil subresource as R32_X8X24 MAX rect 0: Close 0x80070057, destination changed

Other setups pass when that memory happens to hold the expected bytes.

The refused path in resolve_and_read now:

  1. clears the destination in a list of its own and runs it,
  2. submits the refused list (still refused, as before),
  3. copies the destination out in a third list, from DEPTH_WRITE (the refused list's barriers did not run either),

so the comparison is really "the refusal kept the destination". Cases whose Close succeeds are recorded and run exactly as before. The host path (which never executes a refused list) is unchanged.

Tested

NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 build 26300, VS 2022 Build Tools (MSVC 19.44), Windows SDK 10.0.26100, RelWithDebInfo.

runs result
main (dde82f2) 3 (ctest -j 8, then twice alone) failed every time: 5 to 8 refused cases "destination changed", a different set each run
this PR 5, alone exit 0 every time: hardware 51/51 and WARP 37/37 match, 7 refusals alike, 12 refusals kept the destination

(The edge cases were skipped in both, since this machine has no glslangValidator.)

Doesn't overlap #6091 or #7638, which change other parts of this file.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

…ough lists that run

A refused case recorded the destination's clear, the resolve and the copy into
the readback buffer in one list. Its Close fails, so ExecuteCommandLists
refuses the whole list: the clear and the copy never ran, and the test compared
whatever memory the readback buffer was given with the clears. On an RTX 5070 Ti
(NVIDIA 617.42) that failed every run, with 5 to 8 different refused cases
reported as "destination changed" from run to run.

The refused path now clears the destination in a list of its own, submits the
refused list, then copies the destination out from DEPTH_WRITE in a third
list, so "the refusal kept the destination" is what is compared. Cases whose
Close succeeds are recorded and run as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trick-ye

Copy link
Copy Markdown

Tested 738f1a9b9 (based on main dde82f27e) on AMD Radeon RX 7800 XT (RDNA3), AMD 26.11.2 (Windows driver 32.0.32029.2010), Windows 11 26200: d3d12_depth_resolve fails on main here and passes on this head, 5 of 5 runs.

  • main dde82f27e: d3d12_depth_resolve fails in the suite (ctest -j 1), and d3d12_depth_resolve_test exits 1 in 3 of 3 direct runs. Each direct run prints 12 ExecuteCommandLists: list 0 is invalid; refusing batch lines and the same 8 refused ...: Close 0x80070057, destination changed lines (for example refused D24S8 depth AVERAGE rect 1 and refused D32S8 depth AVERAGE rect 0), and no summary line.
  • This head: 5 of 5 direct runs exit 0, with no destination changed line and the summary 134 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ.
  • The host comparison lines are the same on main and on this head: against AMD Radeon RX 7800 XT: 63 of 97 match, 18 host quirks, 7 refusals alike and against WARP: 71 of 71 match, 0 host quirks, 7 refusals alike.
  • Only d3d12_depth_resolve_test was rebuilt and run on this head (the PR changes only that file); it compiled with no compiler warnings. The rest of the suite was not run on it.
  • MSVC 14.42 (VS 2022), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, RelWithDebInfo, LEONIDA_VK_DEVICE=7800. Synthetic test only, no game files.

AI-assisted (Claude Code).

@skorex

skorex commented Nov 23, 2026

Copy link
Copy Markdown

Duplicate of #7905

#7905 makes the same change and was opened earlier. Topic: d3d12_depth_resolve_test: check a refused resolve's destination through lists that run (red since #6610).

Suggest closing this PR in favour of #7905, and porting anything this one adds that #7905 lacks there.

@RAINighty

Copy link
Copy Markdown

Tested 738f1a9b9 merged with main dde82f27e (clean merge) on Windows 11 (10.0.26300), hybrid laptop: NVIDIA GeForce RTX 5060 Laptop GPU (driver 32.0.16.2124) plus Intel UHD Graphics, MSVC 19.44.35228, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Ninja, RelWithDebInfo: pass, and it fixes a failure on main.

AI-assisted (Claude Code).

@MartinIndra02

Copy link
Copy Markdown
Contributor

Independent build + test: PASS

AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo, NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124 (Vulkan layer and host D3D12), plus WARP.

Head 738f1a9b9, based on current main (dde82f27e). Built d3d12_depth_resolve_test.

Build d3d12_depth_resolve_test.exe
main dde82f27e exit 1, 8 lines like refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed (also D24S8 stencil ..., D32S8 depth/stencil ...)
this PR exit 0 on 3 of 3 runs: 145 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ. RTX 3080 74/97 (15 host quirks), WARP 71/71, 7 refusals alike on each

The refused-resolve path now clears the destination in a separate list, submits the refused list, and copies out in a third list with the barrier from DEPTH_WRITE. Because the refused list still has its own target clear, a layer that ran only the clears and skipped the resolve would also pass. That's fine for "the destination is kept", but it can't tell "dropped the whole batch" apart from "ran part of it".

FYI: #7905 and #7930 make the same test fix in different ways. Each one on its own makes this test pass here, so only one of them should be merged.

@justrealyme

Copy link
Copy Markdown
Author

Thanks @skorex, agreed: #7905 makes the same fix and was opened first (24 s earlier), so I'm closing this one in its favour. It adds nothing #7905 lacks beyond test results, which I've posted there: #7905 passes 5 of 5 runs on an RTX 5070 Ti with the edge cases on. The AMD RX 7800 XT result above applies to the same change.

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.

5 participants