d3d12_depth_resolve_test: the host's edge draw takes the standard 4x sample positions (TEST-DEPTH-RESOLVE-SAMPLE-POSITIONS) #1505

Open
github-bot wants to merge 1 commit from github-bot/gh-1505 into main AGit
Owner

@⁠QemmHD on GitHub · 2026-11-25 02:33 UTC · original
ubiquitarianism:claude/depth-resolve-sample-positions → main · +17 −0 · 1 files · 1 commits · open

Claimed in the coordination issue as: TEST-DEPTH-RESOLVE-SAMPLE-POSITIONS (#14)

What and why

d3d12_depth_resolve fails its 34 edge cases (TEST-848) on an RTX 4070 SUPER (NVIDIA 621.24, Windows 11). The layer is not at fault: it matches WARP 71/71, and the analytic standard 4x pattern byte for byte. The host reference is what's off. This PC's NVIDIA global profile has "Enable sample interleaving" (MFAA) on, and with it a native D3D12 4x target's default sample positions are not the standard pattern:

  • Before the first Present, all four samples of a pixel coincide, so MIN = MAX = AVERAGE everywhere and no pixel is partly covered.
  • After each Present, two other patterns alternate.

That was measured with a small D3D12-only program (no Vulkan, no Leonida). No PSO or resource setting changes it; only an explicit SetSamplePositions with the standard pattern does, and then the grid equals WARP. Vulkan on the same driver keeps the standard locations, and so does the layer.

This PR makes the edge cases set the standard 4x positions where the device has programmable sample positions, before the clears and through the resolve. The layer and WARP report none, so their results are unchanged. This is probably also why #67 lists d3d12_depth_resolve as a "known failure" on an RTX 5060 Ti.

Tested

Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja, RelWithDebInfo:

  • d3d12_depth_resolve exits 0. On the NVIDIA host, 74 of 97 cases now match (36 before; the rest are the cases the test already marks as host-dependent). WARP matches 71/71. It passes four repeated runs and under LEONIDA_VK_VALIDATION=1 with 0 validation errors, and in ctest.
  • A read-back of the planes with a debugger confirmed the host had no partial coverage before the change.
  • Not done: switching MFAA off in the driver to A/B the unmodified test, because that's the machine owner's setting. With MFAA off, the unmodified test should pass too.

GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md. (n/a: test-only)

AI-assisted (Claude Code, Claude Opus 5.5).

🤖 Generated with Claude Code

https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf

**@⁠QemmHD** on GitHub · 2026-11-25 02:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1505) `ubiquitarianism:claude/depth-resolve-sample-positions` → `main` · +17 −0 · 1 files · 1 commits · open Claimed in the coordination issue as: TEST-DEPTH-RESOLVE-SAMPLE-POSITIONS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why `d3d12_depth_resolve` fails its 34 edge cases (TEST-848) on an RTX 4070 SUPER (NVIDIA 621.24, Windows 11). The layer is not at fault: it matches WARP 71/71, and the analytic standard 4x pattern byte for byte. The **host reference** is what's off. This PC's NVIDIA global profile has "Enable sample interleaving" (MFAA) on, and with it a native D3D12 4x target's **default sample positions are not the standard pattern**: - **Before the first Present,** all four samples of a pixel coincide, so MIN = MAX = AVERAGE everywhere and no pixel is partly covered. - **After each Present,** two other patterns alternate. That was measured with a small D3D12-only program (no Vulkan, no Leonida). No PSO or resource setting changes it; only an explicit `SetSamplePositions` with the standard pattern does, and then the grid equals WARP. Vulkan on the same driver keeps the standard locations, and so does the layer. This PR makes the edge cases set the standard 4x positions where the device has programmable sample positions, before the clears and through the resolve. The layer and WARP report none, so their results are unchanged. This is probably also why #67 lists `d3d12_depth_resolve` as a "known failure" on an RTX 5060 Ti. ### Tested Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja, RelWithDebInfo: - `d3d12_depth_resolve` exits 0. On the NVIDIA host, 74 of 97 cases now match (36 before; the rest are the cases the test already marks as host-dependent). WARP matches 71/71. It passes four repeated runs and under `LEONIDA_VK_VALIDATION=1` with 0 validation errors, and in ctest. - A read-back of the planes with a debugger confirmed the host had no partial coverage before the change. - Not done: switching MFAA off in the driver to A/B the unmodified test, because that's the machine owner's setting. With MFAA off, the unmodified test should pass too. GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 621.24, Windows 11 AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] A new translator rule is in the contract table of `docs/design.md`. (n/a: test-only) AI-assisted (Claude Code, Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
The edge cases (TEST-848) compare MIN, MAX and AVERAGE over samples that differ
with the PC runtime on the layer's own adapter. On an RTX 4070 SUPER (NVIDIA
621.24, Windows 11) all 34 of them failed against the hardware reference while
matching WARP byte for byte. The reference was the one off: with NVIDIA's MFAA
("Enable sample interleaving") on in the driver's global profile, a D3D12 4x
target's default sample positions are not the standard pattern. Measured with a
D3D12-only program (no Vulkan): until the first Present the four samples of a
pixel coincide, so MIN, MAX and AVERAGE agree everywhere, and after each Present
two other patterns alternate. Vulkan on the same driver keeps the standard
locations, and so does the layer.

Where the device has programmable sample positions, the edge cases now set the
standard pattern before the clears and keep it through the resolve. The layer
and WARP report none and are unchanged. On that machine: 74 of 97 match on the
hardware (36 before), 71 of 71 on WARP, exit 0, also under
LEONIDA_VK_VALIDATION=1.

No game data. AI-assisted.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:54:34 +00:00
Author
Owner

@⁠ytsodacan on GitHub · 2026-11-25 03:36 UTC · original · edited 2026-11-25 03:44 UTC

[KEEP]

  • Test-only change in runtime/test/d3d12_depth_resolve_test.cpp: pins standard 4x sample positions via SetSamplePositions when programmable positions are supported. The diff is small and the reasoning is well documented.
  • CI is not settled: windows, macos, linux-gpu-tools, change-scope and no-game-data are all still pending. This test is Windows/D3D12 only, so the windows job matters most.
  • Verification is on a single NVIDIA host (RTX 4070 SUPER, MFAA on): 74 of 97 cases match, with the remaining cases already marked host-dependent. I could not check other vendors, and the PR notes MFAA-off A/B was not done.
  • No overlapping open PRs found. Likely MERGE once CI is green.
**@⁠ytsodacan** on GitHub · 2026-11-25 03:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1505#issuecomment-7152069257) · edited 2026-11-25 03:44 UTC **[KEEP]** - Test-only change in `runtime/test/d3d12_depth_resolve_test.cpp`: pins standard 4x sample positions via `SetSamplePositions` when programmable positions are supported. The diff is small and the reasoning is well documented. - CI is not settled: `windows`, `macos`, `linux-gpu-tools`, `change-scope` and `no-game-data` are all still pending. This test is Windows/D3D12 only, so the `windows` job matters most. - Verification is on a single NVIDIA host (RTX 4070 SUPER, MFAA on): 74 of 97 cases match, with the remaining cases already marked host-dependent. I could not check other vendors, and the PR notes MFAA-off A/B was not done. - No overlapping open PRs found. Likely MERGE once CI is green.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1505/head:github-bot/gh-1505'
git switch 'github-bot/gh-1505'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1505'
git switch 'github-bot/gh-1505'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1505'
git switch 'github-bot/gh-1505'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1505'
git switch 'main'
git merge --squash 'github-bot/gh-1505'
git switch 'main'
git merge --ff-only 'github-bot/gh-1505'
git switch 'main'
git merge 'github-bot/gh-1505'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.