Skip to content

d3d12_depth_resolve: validate edge AVERAGE and host quirks (TEST-1470) - #6091

Open
Halfect wants to merge 2 commits into
ItsNotRexed:mainfrom
Halfect:fix/test-1470-depth-resolve
Open

Halfect wants to merge 2 commits into
ItsNotRexed:mainfrom
Halfect:fix/test-1470-depth-resolve

Conversation

@Halfect

@Halfect Halfect commented Nov 23, 2026 •

Copy link
Copy Markdown

Item: TEST-1470 (claim).

This integrates the behavior-based host classification and layer invariant from #6053 by @emirduran707 with this PR's strict WARP comparison.

  • The layer's edge AVERAGE must be strictly between its own MIN and MAX wherever those differ. This checks the layer independently of any host.
  • A hardware-host AVERAGE difference is a host quirk only when the host's MIN/MAX match the layer's, the layer's AVERAGE satisfies that invariant, and the host's AVERAGE is not strictly between its own MIN/MAX. The rule uses returned values, not the adapter vendor. A host that does average but still differs from the layer fails.
  • WARP's edge AVERAGE remains a hard byte-for-byte comparison, so the hardware-host quirk cannot hide a layer regression.
  • docs/d3d12_vulkan.md records the rule and the RX 9060 XT measurement from d3d12_depth_resolve: a host that does not average an edge AVERAGE is a host quirk (TEST-1470) #6053.

Tested at dfcfc15dd

Windows 11, MSVC 14.44, Vulkan SDK 1.4.363, LEONIDA_VK_VALIDATION=1:

  • NVIDIA GeForce RTX 5080, driver 621.24: 97/97 hardware comparisons and 71/71 WARP comparisons matched; 12 refusals kept the destination; 20 edge MIN/MAX pairs differed; no validation errors.
  • AMD Radeon Graphics (gfx1036), driver 32.0.21030.2001: 49/83 hardware comparisons matched with 18 existing host quirks and 7 refusals alike; 57/57 WARP comparisons matched; 14 unsupported modes were refused; 20 edge MIN/MAX pairs differed; no validation errors. This GPU's Vulkan driver does not support AVERAGE, so the integrated head still needs RDNA4 verification; the RX 9060 XT measurements are from d3d12_depth_resolve: a host that does not average an edge AVERAGE is a host quirk (TEST-1470) #6053, not a local reproduction.

Temporary local fault injection, not included in the commit:

  • Six simulated hardware results returning MIN instead of AVERAGE were classified as six host quirks and exited 0, including on NVIDIA, demonstrating that classification is vendor-independent.
  • Six simulated hardware results that remained strictly between MIN/MAX but differed slightly from the layer still produced six failures and exited 1.
  • Six simulated WARP AVERAGE differences still produced six failures and exited 1.
  • Substituting the layer's MIN for its AVERAGE produced six independent layer-invariant failures and exited 1.

python -m pytest tests/test_docs_*.py -q: 33 passed, 6 subtests passed. python -I scripts/check_no_game_data.py and git diff --check: passed.

Synthetic test data only; no game files or game data.

AI-assisted: Kimi Work. Behavior-based rule and layer invariant originally implemented in #6053 by @emirduran707.

@LocranKing

Copy link
Copy Markdown
Contributor

Tested 81b9611e7 on Windows 11 Home (Build 26200, x64), NVIDIA GeForce RTX 3060 Ti (driver 621.01, Vulkan 1.4.357, Vulkan SDK 1.4.363.0), MSVC 14.44.35207, Ninja RelWithDebInfo, with LEONIDA_VK_VALIDATION=1 and VK_LOADER_LAYERS_DISABLE=~implicit~: pass.

  • git diff --check HEAD~1..HEAD: clean
  • scripts\build_runtime.ps1: 0 warnings/errors, built gta6rt.exe
  • runtime\build\d3d12_depth_resolve_test.exe: exit 0, 0 Vulkan validation errors
    • depth/stencil resolves against NVIDIA GeForce RTX 3060 Ti: 74 of 97 match, 15 host quirks, 7 refusals alike
    • depth/stencil resolves against WARP: 71 of 71 match, 0 host quirks, 7 refusals alike
    • depth/stencil resolves: 145 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ
  • ctest --test-dir runtime/build -R ^d3d12_depth_resolve$ --output-on-failure -V: 1/1 Passed (4.31s)

AI-assisted. No game files.

@milas6669

Copy link
Copy Markdown

Comparison with #6053 (coordinator asked, 13:08). They conflict in d3d12_depth_resolve_test.cpp (git merge-tree), so one has to be chosen. Built each on Windows 11 with an RTX 3070 (621.24): d3d12_depth_resolve_test exits 0 on main, #6053 and #6091, so neither breaks NVIDIA. I have no AMD, so I can't say whether either gets RDNA4 green.

How they differ in what they would catch:

No failure from either on this machine.

@DavidM1911

Copy link
Copy Markdown

Tested 81b9611 on NVIDIA GeForce RTX 3060 Ti (driver 610.88, 256-byte push constants), Windows 11, MSVC 14.50, Vulkan SDK 1.4.363, LEONIDA_VK_VALIDATION=1: pass, exit 0.

"d3d12_depth_resolve: 128 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ" — RTX 3060 Ti hardware 57/97 + WARP 71/71, same shape as your RTX 5080 run. No validation errors.

AMD Radeon(TM) Graphics iGPU (Ryzen 9 7900X, gfx1036, driver 24.10.24, 128-byte push constants): the test cannot run on main there yet — its draws need the 144-byte push-constant range and the layer refuses the PSO until #2402 lands. Will re-check the AMD AVERAGE quirk path once that merges.

AI-assisted. No game files.

@Halfect Halfect changed the title d3d12_depth_resolve: classify AMD AVERAGE host differences (TEST-1470) d3d12_depth_resolve: validate edge AVERAGE and host quirks (TEST-1470) Nov 23, 2026
@Halfect

Halfect commented Nov 23, 2026

Copy link
Copy Markdown
Author

Updated to dfcfc15dd: this now combines @emirduran707's behavior-based host rule and layer AVERAGE invariant from #6053 with the strict WARP AVERAGE comparison. The vendor-ID-only classification has been removed.

Final local runs pass on RTX 5080 (97/97 hardware, 71/71 WARP) and gfx1036 (49/83 plus 18 existing quirks, 57/57 WARP), with validation enabled. Four temporary fault-injection controls confirm: non-averaging hardware is classified; averaging-but-different hardware fails; WARP differences fail; and the layer invariant fails independently. Details are in the updated PR body. The integrated head has not been tested on RDNA4.

@emirduran707

Copy link
Copy Markdown
Contributor

The RDNA4 run for the combined head dfcfc15d: AMD Radeon RX 9060 XT, driver 26.10.44, Windows 11, MSVC (VS 2022), LEONIDA_VK_DEVICE=9060. Passes, 4 of 4 runs, one with LEONIDA_VK_VALIDATION=1 (no VUID line).

main 561b65a8 dfcfc15d
d3d12_depth_resolve fails, 6 edge AVERAGE lines passes
against the RX 9060 XT 57 of 97, 18 quirks 57 of 97, 24 quirks, 7 refusals alike
against WARP (edge AVERAGE now a hard comparison) 71 of 71 71 of 71

The six cases are classified by what the host returned, not by vendor: each prints host quirk: the host's AVERAGE is strictly between its own MIN and MAX in 0 of the 8 pixels whose samples differ; the layer's is in all of them (0 of the 5 for the rectangle), for D32 as R32_FLOAT, D24S8 as R24_X8 and D32S8 as R32_X8X24.

So on the card the finding is from, this head does everything #6053 does and also holds the layer's edge AVERAGE to WARP's. Only this test was built and run, not the whole suite; I did not repeat your fault injections here.

Thanks for the credit. AI-assisted (Claude Code). Synthetic test only, no game files.

@devnull34

Copy link
Copy Markdown

Tested on Windows 11, AMD Radeon RX 7900 GRE (RDNA3, gfx1100), MSVC (VS 2022 RelWithDebInfo): pass, exit 0.


untime\build\RelWithDebInfo\d3d12_depth_resolve_test.exe:

  • Device: \AMD Radeon RX 7900 GRE, subgroup sizes 32..64 (default 64), stages \

@memorypressure

Copy link
Copy Markdown

Verified at your force-pushed head dfcfc15 (this is the head the verdict is for) on main 561b65a: the change touches only the Windows-side C++ depth-resolve test, which this Linux CPU-only verifier cannot build or run — that needs the D3D12 hosts. On review the rework is sound and stricter than the first revision: the layer's AVERAGE must lie strictly between its own MIN and MAX unconditionally, and a host divergence is a reported quirk only when the host's MIN/MAX match the layer's while its own AVERAGE provably sits outside them — no vendor-id sniffing, so WARP and correctly-averaging hosts stay hard comparisons. Planes& expected aliasing and includes are present, docs guards green. Flag: the branch reports no CI checks — a push would get it built. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only review).

@heykz heykz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review at dfcfc15dd (AI-assisted, no GPU run on this head). I found one remaining path that can downgrade an edge AVERAGE mismatch. In the host loop, if (c.edge && ((warp && c.mode != average) || quirky(c))) also accepts an AVERAGE case through quirky(c) when the earlier flat case with the same name/mode/rectangle differs from the clears. That branch prints an informational line and continues even if the edge AVERAGE comparison failed and the new MIN/MAX-based rule did not classify it. This can also happen on WARP if its matching flat case enters quirks_seen.

If WARP AVERAGE and averaging-but-different hardware are meant to stay hard comparisons, could the legacy information-only branch apply only when c.mode != average (with warp || quirky(c) inside that guard)? A useful negative control would combine a flat-case quirk with an incorrect edge AVERAGE on the same case.

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.

8 participants