[PR #288] [CLOSED] Tests: a refused depth resolve is checked by its Close alone #341

Closed
opened 2026-11-26 20:17:33 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/288
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/10019


📝 Commits (1)

  • 5894b0b Tests: a refused depth resolve is checked by its Close alone

📊 Changes

2 files changed (+32 additions, -27 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+7 -6)
📝 runtime/test/d3d12_depth_resolve_test.cpp (+25 -21)

📄 Description

Carried over from old PR 10019 by tugasky in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10019, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
tugasky: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: claim (the d3d12_depth_resolve red on Windows AMD item; the follow-up comment there corrects the first framing — this is the test's model, not the layer)

Depends on: none. It conflicts with none of the open PRs; main itself does not compile today (see Tested), which the open build-fix PRs handle separately.

What and why

d3d12_depth_resolve is red on every device at d083a2cc, not only on AMD, with these 8 lines (the Close 0x80070057 is the correct refusal):

refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed
refused D24S8 stencil AVERAGE rect 0: Close 0x80070057, destination changed
refused D24S8 stencil as X24_G8 AVERAGE rect 1: Close 0x80070057, destination changed
refused D24S8 stencil, rectangle to another offset MAX rect 1: Close 0x80070057, destination changed
refused D24S8 stencil subresource as R24_X8 MIN rect 0: Close 0x80070057, destination changed
refused D32S8 depth AVERAGE rect 0: Close 0x80070057, destination changed
refused D32S8 stencil AVERAGE rect 1: Close 0x80070057, destination changed
refused D32S8 stencil subresource as R32_X8X24 MAX rect 0: Close 0x80070057, destination changed

The refused loop recorded its resolve into the same list as the clears, executed the list even though Close had failed, and compared the destination with expected_planes(c, false). The layer refuses to replay a list whose recording failed (ExecuteCommandLists, d3d12_com.cpp), which is the contract docs/d3d12_vulkan.md already states: "Refused calls fail Close and record nothing". So nothing of that list runs, the destination keeps what it held before, and the readback resource the test reads it through starts zeroed (d3d12_vulkan_device.cpp). The comparison could only pass where the expected stencil was 0: the 4 stencil-less D32 refused cases passed, and all 8 refused cases with a stencil plane failed — AMD, NVIDIA and WARP alike. The host arms were never the problem: every remaining AMD difference is already classified host quirk: the host differs from the clears; the layer matches them and WARP is 71 of 71.

This checks a refused case by its Close alone (the host arm still checks that the host refuses too), treats "a mode the device lacks" the same way, drops the now meaningless run_invalid parameter of resolve_and_read, and says in docs/d3d12_vulkan.md why the destination is not compared. That an invalid list's earlier commands do not run is already measured by d3d12_queue_list_type_test ("and its earlier CopyBufferRegion did not modify the destination buffer"), so no coverage is lost.

Tested

Windows 11, RX 9070 XT (RDNA4, GFX1201), Adrenalin 26.11.2 / Vulkan 1.4.359, MSVC 19.44, RelWithDebInfo, Ninja, ctest -R 'd3d12_depth_resolve$|d3d12_typeless_depth$|d3d12_msaa_draw$':

run d3d12_depth_resolve AMD arm WARP arm
before, d083a2cc (no patch) FAIL, the 8 lines above 63 of 97 match, 18 host quirks, 7 refusals alike 71 of 71 match
after PASS 63 of 97 match, 18 host quirks, 7 refusals alike 71 of 71 match

After: 134 host comparisons matched, 12 calls were refused at Close, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ — the same counts as before, so the fix removes only the impossible comparison. d3d12_typeless_depth passes before and after.

d3d12_msaa_draw segfaults on main before and after this patch for an unrelated reason: the slot-14 CreateDescriptorHeap wrapper reads an address/size past the 16-byte PC desc, a normal PC heap then takes the console path and GetCPUDescriptorHandleForHeapStart hands out a stack pointer. Reported as a finding: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7117047515

Note on building: main at d083a2cc does not compile. create_console_descriptor_heap passes d->state() (a const DeviceState&) where DescriptorHeap wants DeviceState& and calls Device::identity(), which is private; d3d12_xs_device.cpp also misses the d3d12_com.h include that declares it. I built with those two lines worked around locally and neither workaround is in this pull request; the open build-fix PRs (#9873, #9941, #9867, #9978 and others) cover them.

No game data: the test writes its own resources under %TEMP%\leonida_depth_resolve_test.

AI-assisted: yes (Cline).

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. — not a translator change.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/288 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/10019` --- ### 📝 Commits (1) - [`5894b0b`](https://github.com/ubiquitarianism/leonida/commit/5894b0b97ce9fd3b7f0fee2a86b3f093e653b715) Tests: a refused depth resolve is checked by its Close alone ### 📊 Changes **2 files changed** (+32 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+7 -6) 📝 `runtime/test/d3d12_depth_resolve_test.cpp` (+25 -21) </details> ### 📄 Description > Carried over from **old PR 10019** by `tugasky` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10019`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `tugasky`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: [claim](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116798311) (the `d3d12_depth_resolve` red on Windows AMD item; the follow-up comment there corrects the first framing — this is the test's model, not the layer) Depends on: none. It conflicts with none of the open PRs; `main` itself does not compile today (see Tested), which the open build-fix PRs handle separately. ### What and why `d3d12_depth_resolve` is red on every device at `d083a2cc`, not only on AMD, with these 8 lines (the `Close 0x80070057` is the correct refusal): ``` refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed refused D24S8 stencil AVERAGE rect 0: Close 0x80070057, destination changed refused D24S8 stencil as X24_G8 AVERAGE rect 1: Close 0x80070057, destination changed refused D24S8 stencil, rectangle to another offset MAX rect 1: Close 0x80070057, destination changed refused D24S8 stencil subresource as R24_X8 MIN rect 0: Close 0x80070057, destination changed refused D32S8 depth AVERAGE rect 0: Close 0x80070057, destination changed refused D32S8 stencil AVERAGE rect 1: Close 0x80070057, destination changed refused D32S8 stencil subresource as R32_X8X24 MAX rect 0: Close 0x80070057, destination changed ``` The refused loop recorded its resolve into the same list as the clears, executed the list even though `Close` had failed, and compared the destination with `expected_planes(c, false)`. The layer refuses to replay a list whose recording failed (`ExecuteCommandLists`, `d3d12_com.cpp`), which is the contract `docs/d3d12_vulkan.md` already states: "Refused calls fail `Close` and record nothing". So nothing of that list runs, the destination keeps what it held before, and the readback resource the test reads it through starts zeroed (`d3d12_vulkan_device.cpp`). The comparison could only pass where the expected stencil was 0: the 4 stencil-less D32 refused cases passed, and all 8 refused cases with a stencil plane failed — AMD, NVIDIA and WARP alike. The host arms were never the problem: every remaining AMD difference is already classified `host quirk: the host differs from the clears; the layer matches them` and WARP is `71 of 71`. This checks a refused case by its `Close` alone (the host arm still checks that the host refuses too), treats "a mode the device lacks" the same way, drops the now meaningless `run_invalid` parameter of `resolve_and_read`, and says in `docs/d3d12_vulkan.md` why the destination is not compared. That an invalid list's earlier commands do not run is already measured by `d3d12_queue_list_type_test` ("and its earlier CopyBufferRegion did not modify the destination buffer"), so no coverage is lost. ### Tested Windows 11, RX 9070 XT (RDNA4, GFX1201), Adrenalin 26.11.2 / Vulkan 1.4.359, MSVC 19.44, RelWithDebInfo, Ninja, `ctest -R 'd3d12_depth_resolve$|d3d12_typeless_depth$|d3d12_msaa_draw$'`: | run | `d3d12_depth_resolve` | AMD arm | WARP arm | |---|---|---|---| | before, `d083a2cc` (no patch) | **FAIL**, the 8 lines above | 63 of 97 match, 18 host quirks, 7 refusals alike | 71 of 71 match | | after | **PASS** | 63 of 97 match, 18 host quirks, 7 refusals alike | 71 of 71 match | After: `134 host comparisons matched, 12 calls were refused at Close, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ` — the same counts as before, so the fix removes only the impossible comparison. `d3d12_typeless_depth` passes before and after. `d3d12_msaa_draw` segfaults on `main` before and after this patch for an unrelated reason: the slot-14 `CreateDescriptorHeap` wrapper reads an address/size past the 16-byte PC desc, a normal PC heap then takes the console path and `GetCPUDescriptorHandleForHeapStart` hands out a stack pointer. Reported as a finding: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7117047515 Note on building: `main` at `d083a2cc` does not compile. `create_console_descriptor_heap` passes `d->state()` (a `const DeviceState&`) where `DescriptorHeap` wants `DeviceState&` and calls `Device::identity()`, which is private; `d3d12_xs_device.cpp` also misses the `d3d12_com.h` include that declares it. I built with those two lines worked around locally and neither workaround is in this pull request; the open build-fix PRs (`#9873`, `#9941`, `#9867`, `#9978` and others) cover them. No game data: the test writes its own resources under `%TEMP%\leonida_depth_resolve_test`. AI-assisted: yes (Cline). ### Checklist - [x] 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. — not a translator change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:33 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#341
No description provided.