Skip to content

d3d12_depth_resolve_test: a refused list submits nothing, so do not compare the destination - #9066

Open
bailu12300 wants to merge 1 commit into
ItsNotRexed:mainfrom
bailu12300:fix/depth-resolve-refused-destination
Open

bailu12300 wants to merge 1 commit into
ItsNotRexed:mainfrom
bailu12300:fix/depth-resolve-refused-destination

Conversation

@bailu12300

Copy link
Copy Markdown

Claim: coordination issue #8868.

What and why

d3d12_depth_resolve_test exits 1 on an RTX 5060 although every host comparison matches (97 of 97 against the GPU, 71 of 71 against WARP, 0 host quirks). The failures come from the loop over the refused cases:

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

resolve_and_read() puts the destination's clear, the resolve, and the read-back CopyTextureRegion in one list. The layer refuses the whole list (ExecuteCommandLists failed: ... nothing was submitted), so the clear never runs and the copy never writes the read-back buffer, which still holds whatever the heap held. The check compared that uninitialized read-back with the destination's own values (expected_planes(c, false), depth 0.0 and stencil 0x5a), so it reported "changed" for every refused case — the old helper's comment ("the layer runs what it recorded") describes a behaviour the layer does not have.

The refused loop now checks only the refusal (Close is E_INVALIDARG), and the comment records why the destination cannot be observed there: it needs the clear and the read-back in an earlier, accepted submission. The summary line drops "kept the destination" for the same reason.

Tested

Windows 11, NVIDIA GeForce RTX 5060, driver 32.0.16.2124 (621.24), Vulkan SDK 1.4.363, on main:

  • before: refused ... destination changed twelve times, exit 1, 168 host comparisons matched (the refusals were the only failures)
  • after: depth/stencil resolves against NVIDIA GeForce RTX 5060: 97 of 97 match, 0 host quirks, 7 refusals alike, against WARP: 71 of 71 match, 7 refusals alike, 168 host comparisons matched, 12 refusals, 0 modes the device lacks were refused, exit 0, no Vulkan validation errors.

The refusal path itself is unchanged: a list whose Close fails is still refused whole, which the other tests rely on (d3d12_indirect_rt_test prints the same "nothing was submitted").

AI-assisted: yes

…ompare the destination

The test clears the destination and copies it back inside the list that also holds the resolve. When the layer refuses
that list, ExecuteCommandLists reports "nothing was submitted", so neither the clear nor the copy runs and the read-back
buffer still holds whatever the heap held. Comparing that with the destination's own values therefore fails on any device
where a case is refused: on an RTX 5060 twelve refusals were reported as "destination changed" (stencil 0 instead of
0x5a) and the test exited 1, with the host comparisons themselves all matching (97 of 97 against the GPU, 71 of 71
against WARP).

The refused loop now checks only that Close is E_INVALIDARG, which is what the layer promises, and the comment says
why the destination cannot be observed: it would need a clear and a copy in an earlier, accepted submission.
@singul-oss

Copy link
Copy Markdown

AI-assisted review and test. Passes, but it drops a check that #7905 keeps.

Tested 0f9816d8 merged onto main 867d922f (clean) on Windows 11 Home 10.0.26200, NVIDIA GeForce RTX 5080 (driver 610.88), MSVC 14.44.35207, Vulkan SDK 1.4.363.0, RelWithDebInfo.

  • main: d3d12_depth_resolve fails, every refused case prints Close 0x80070057, destination changed.
  • This PR: ctest -R '^d3d12_depth_resolve$' passes 3 of 3 runs.

The diagnosis is right: since #6610 the refused list is refused as a whole, and the clear and the read-back copy are in it, so the read-back never runs. But the fix stops checking that a refused resolve leaves the destination alone, and AGENTS.md asks to fix rather than disable. #7905 (heavily tested, including on Blackwell) runs each refused case as clears, refused list, copy-out in separate lists, so it keeps that check, and #7930 takes a similar route. #7985 was closed as a duplicate of #7905. I'd suggest closing this in favour of #7905.

@kawaii-shakal

Copy link
Copy Markdown

Code read of 0f9816d8a. Nothing was built or run: this test needs Windows and a GPU, and I had neither. AI-assisted.

The point that this drops the check on the refused destination is already made above. Two further things:

1. The same false failure remains for a mode the device lacks

The PR fixes the refused loop, but the main loop has the same pattern (runtime/test/d3d12_depth_resolve_test.cpp, lines 436-438):

const Planes expected = expected_planes(c, can);
if (results[i].close != (can ? S_OK : E_INVALIDARG) ||
    (!c.edge && !same_planes(results[i], expected, false, c.plane))) {

When can is false, Close is expected to return E_INVALIDARG, so the layer refuses the whole list, including the clear and the read-back copy. By the PR's own diagnosis, results[i] then holds whatever the read-back heap held, and it is still compared with expected_planes(c, false). A non-edge case on a device lacking that resolve mode should therefore still fail with destination differs from the clears.

This is reasoning, not a run. The reported runs print 0 modes the device lacks, so they do not reach this branch.

2. The new error message is wrong for most refused cases

Line 475 prints the device has no such mode when Close is not E_INVALIDARG. That is the case where the layer failed to refuse the call. The refused list is also mostly not about device support: it holds offsets, plane/format mismatches and DECOMPRESS. Something like expected E_INVALIDARG would be accurate.

Not tested: any build or run of this test, on any GPU or driver.


Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.

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.

3 participants