RT-STATE-AUDIT-FORMATS: accept R16_UNORM in D16_UNORM depth ResolveSubresourceRegion #2482

Closed
lixonik wants to merge 3 commits from upstream-pr/2482 into main
lixonik commented 2026-11-27 16:37:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T16:37:36Z.


Part of RT-STATE-AUDIT-FORMATS (#2464; based on the format-state audit notes in #1608 by @kevincommits and @Tauwni).

Summary

  • Add DXGI_FORMAT_R16_UNORM -> {DXGI_FORMAT_D16_UNORM, plane 0} to depth_stencil_resolve_supported in runtime/shims/d3d12_vulkan_device.cpp, matching the existing depth-plane shader-resource format mappings (R32_FLOAT, R24_UNORM_X8_TYPELESS, R32_FLOAT_X8X24_TYPELESS) so ResolveSubresourceRegion accepts DXGI_FORMAT_R16_UNORM (MIN, MAX, and AVERAGE) on D16_UNORM and R16_TYPELESS depth buffers.

Tests

  • runtime/test/d3d12_depth_resolve_test.cpp: added D16_UNORM (MIN/MAX), D16_UNORM as R16_UNORM (MIN/MAX/AVERAGE, clear + diagonal edge draw, full + rectangle), R16_TYPELESS as D16_UNORM and R16_UNORM, and refused D16_UNORM AVERAGE (matching host E_INVALIDARG). Mixed-sample D16 AVERAGE edge draws allow 1 LSB (1/65535) rounding tolerance between Vulkan and D3D12 hardware resolves; all clear cases and all MIN/MAX cases require exact byte equality.

Negative control & verification

  • On unmodified main (ec91d695c), d3d12_depth_resolve_test failed all D16 depth as R16_UNORM (MIN, MAX, AVERAGE, full & rectangle, clear & edge) and R16_TYPELESS depth as R16_UNORM cases with Close 0x80070057 (E_INVALIDARG).
  • With the fix:
    • ctest -R "^d3d12_depth_resolve$": Passed (119/119 match on NVIDIA GeForce RTX 5070 D3D12, 85/93 match on WARP, 204 host comparisons matched, 8 refusals alike, 24 edge MIN/MAX pairs differ).
    • python scripts/check_no_game_data.py: clean.
    • python -m unittest tests/test_ctest_registration.py: 6/6 OK.
    • git diff --check: clean.

GPUs tested: NVIDIA GeForce RTX 5070 (Windows 11, native Vulkan + native D3D12 + WARP; VK_LAYER_KHRONOS_validation not installed locally).

AI-assisted (Antigravity, Gemini).

Independent gfx906 RADV / Wine A/B: all 13 R16_UNORM cases changed from E_INVALIDARG on main to fenced readbacks with the PR. The three rejection controls stayed rejected, and the four one-unit AVERAGE differences were all exact half-word ties. Test report.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5530031094 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-27T16:37:36Z. --- Part of `RT-STATE-AUDIT-FORMATS` (#2464; based on the format-state audit notes in #1608 by `@kevincommits` and `@Tauwni`). ### Summary - Add `DXGI_FORMAT_R16_UNORM` -> `{DXGI_FORMAT_D16_UNORM, plane 0}` to `depth_stencil_resolve_supported` in `runtime/shims/d3d12_vulkan_device.cpp`, matching the existing depth-plane shader-resource format mappings (`R32_FLOAT`, `R24_UNORM_X8_TYPELESS`, `R32_FLOAT_X8X24_TYPELESS`) so `ResolveSubresourceRegion` accepts `DXGI_FORMAT_R16_UNORM` (`MIN`, `MAX`, and `AVERAGE`) on `D16_UNORM` and `R16_TYPELESS` depth buffers. ### Tests - `runtime/test/d3d12_depth_resolve_test.cpp`: added `D16_UNORM` (`MIN`/`MAX`), `D16_UNORM` as `R16_UNORM` (`MIN`/`MAX`/`AVERAGE`, clear + diagonal edge draw, full + rectangle), `R16_TYPELESS` as `D16_UNORM` and `R16_UNORM`, and refused `D16_UNORM` `AVERAGE` (matching host `E_INVALIDARG`). Mixed-sample `D16` `AVERAGE` edge draws allow 1 LSB (`1/65535`) rounding tolerance between Vulkan and D3D12 hardware resolves; all clear cases and all `MIN`/`MAX` cases require exact byte equality. ### Negative control & verification - On unmodified `main` (`ec91d695c`), `d3d12_depth_resolve_test` failed all `D16 depth as R16_UNORM` (`MIN`, `MAX`, `AVERAGE`, full & rectangle, clear & edge) and `R16_TYPELESS depth as R16_UNORM` cases with `Close 0x80070057` (`E_INVALIDARG`). - With the fix: - `ctest -R "^d3d12_depth_resolve$"`: Passed (119/119 match on NVIDIA GeForce RTX 5070 D3D12, 85/93 match on WARP, 204 host comparisons matched, 8 refusals alike, 24 edge MIN/MAX pairs differ). - `python scripts/check_no_game_data.py`: clean. - `python -m unittest tests/test_ctest_registration.py`: 6/6 OK. - `git diff --check`: clean. GPUs tested: NVIDIA GeForce RTX 5070 (Windows 11, native Vulkan + native D3D12 + WARP; `VK_LAYER_KHRONOS_validation` not installed locally). AI-assisted (Antigravity, Gemini). Independent gfx906 RADV / Wine A/B: all 13 R16_UNORM cases changed from E_INVALIDARG on main to fenced readbacks with the PR. The three rejection controls stayed rejected, and the four one-unit AVERAGE differences were all exact half-word ties. [Test report](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7245753996).
djrolfes commented 2026-11-27 17:36:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-27T17:36:19Z.


Independent Linux/Wine + NVIDIA RTX 3070 Ti review/test at 913152909 (merged cleanly on origin/main c0201a806, wine-11.22, NVIDIA 620.73.04). AI-assisted.

  • Diff looks clean: depth_stencil_resolve_supported maps DXGI_FORMAT_R16_UNORM to DXGI_FORMAT_D16_UNORM plane 0 alongside the other depth plane formats, and d3d12_depth_resolve_test covers 16-bit UNORM readback, R16_TYPELESS, and D16 AVERAGE refusal.
  • d3d12_depth_resolve (Wine/Vulkan RTX 3070 Ti): PASSED (Vulkan resolve modes: depth 0x2f, stencil 0x2d; 13 refusals kept the destination, 0 modes the device lacks were refused; 24 edge MIN/MAX pairs differ; host D3D12 comparison skipped under Wine as expected).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7224589949 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2482#issuecomment-7224589949). Originally posted by [djrolfes](https://github.com/djrolfes) on 2026-11-27T17:36:19Z. --- Independent Linux/Wine + NVIDIA RTX 3070 Ti review/test at `913152909` (merged cleanly on `origin/main` `c0201a806`, `wine-11.22`, NVIDIA `620.73.04`). AI-assisted. - Diff looks clean: `depth_stencil_resolve_supported` maps `DXGI_FORMAT_R16_UNORM` to `DXGI_FORMAT_D16_UNORM` plane 0 alongside the other depth plane formats, and `d3d12_depth_resolve_test` covers 16-bit UNORM readback, `R16_TYPELESS`, and `D16` AVERAGE refusal. - `d3d12_depth_resolve` (Wine/Vulkan RTX 3070 Ti): **PASSED** (`Vulkan resolve modes: depth 0x2f, stencil 0x2d`; `13 refusals kept the destination, 0 modes the device lacks were refused; 24 edge MIN/MAX pairs differ`; host D3D12 comparison skipped under Wine as expected).
OreoFR commented 2026-11-27 19:13:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T19:13:50Z.


Merge test for the #2464 campaign on an 8 GB laptop (profile M), taken over from MoonEyes' card. Main ec91d695c was merged without conflict, in one tree together with #2482 and #2483. The numbers were recomputed from the raw logs. AI-assisted (Claude Code, Claude Opus 5.5).

RUN lix2 | 2026-11-27 | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5)
BASE:        main ec91d695c + #2482 (913152909) + #2483 (c84384285), merged cleanly | shaders: main translation + #2447 (one-lane) pack
MACHINE:     RTX 4070 Laptop 8 GB, laptop (profile M) | NVIDIA 621.40 | Windows 11 | 40 GB
RECIPE:      documented + DEVIATIONS: ASYNC_PIPELINES=1 ASYNC_MIN_BYTES=1048576 VALUE_WAIT_TIMEOUT_MS=30000 MAP_READBACK=1 DEVICE_TYPE=6 ARENA_MB=4095 DEVICE_FAULT=1
OS/DRIVER:   TdrDelay 60
TARGET:      regression check against regA (main ec91d695c, same recipe and caches) | PREDICTED: world reached, no loss
MEASURED:    world entry ~235 s (regA 223 s) | 0 device lost, 0 exceptions (regA 0 / 0) | gpu-stall lines 1 (regA 10)
END:         stopped by our script 43 s after world entry (t=278 s): the known display stop after world entry is the same on main
CACHES:      warm | RUN 1 of 1
VERDICT:     no regression seen (n=1)
  • d3d12_depth_resolve_test from this head: exit 0. Built against main ec91d695c it fails: D16 depth as R16_UNORM AVERAGE rect 1: Close 0x80070057, destination differs from the clears (the same for R16_TYPELESS), exit 1. The fix is shown.
  • MoonEyes' card also ran this PR earlier (RTX 4060, 610.88, 350 s, no device lost).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226319186 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2482#issuecomment-7226319186). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-27T19:13:50Z. --- Merge test for the #2464 campaign on an 8 GB laptop (profile M), taken over from MoonEyes' card. Main ec91d695c was merged without conflict, in one tree together with #2482 and #2483. The numbers were recomputed from the raw logs. AI-assisted (Claude Code, Claude Opus 5.5). ``` RUN lix2 | 2026-11-27 | OreoFR | AI-assisted: Claude Code (Claude Opus 5.5) BASE: main ec91d695c + #2482 (913152909) + #2483 (c84384285), merged cleanly | shaders: main translation + #2447 (one-lane) pack MACHINE: RTX 4070 Laptop 8 GB, laptop (profile M) | NVIDIA 621.40 | Windows 11 | 40 GB RECIPE: documented + DEVIATIONS: ASYNC_PIPELINES=1 ASYNC_MIN_BYTES=1048576 VALUE_WAIT_TIMEOUT_MS=30000 MAP_READBACK=1 DEVICE_TYPE=6 ARENA_MB=4095 DEVICE_FAULT=1 OS/DRIVER: TdrDelay 60 TARGET: regression check against regA (main ec91d695c, same recipe and caches) | PREDICTED: world reached, no loss MEASURED: world entry ~235 s (regA 223 s) | 0 device lost, 0 exceptions (regA 0 / 0) | gpu-stall lines 1 (regA 10) END: stopped by our script 43 s after world entry (t=278 s): the known display stop after world entry is the same on main CACHES: warm | RUN 1 of 1 VERDICT: no regression seen (n=1) ``` - `d3d12_depth_resolve_test` from this head: exit 0. **Built against main ec91d695c it fails**: `D16 depth as R16_UNORM AVERAGE rect 1: Close 0x80070057, destination differs from the clears` (the same for R16_TYPELESS), exit 1. The fix is shown. - MoonEyes' card also ran this PR earlier (RTX 4060, 610.88, 350 s, no device lost).
Tauwni commented 2026-11-27 20:11:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-27T20:11:05Z.


Tested on a Mac under Wine (Apple M3, macOS 26.5.1, Wine 11.0 with its MoltenVK 1.4.1), merged onto main 43a9d562d. Profile S, no game files.

d3d12_depth_resolve fails here, but on the test's exact-bit comparison, not on the change. (MEASURED)

  • The 9 failing cases are the new D16 MIN/MAX ones: D16 depth, D16 depth as R16_UNORM and R16_TYPELESS depth as D16 MIN, whole subresource and rect. With the test file alone on main the same cases fail, plus the R16_UNORM refusals this PR fixes.
  • Each one differs from the clears by one LSB: a temporary print of the first differing pixel gives got 16383 expected 16384 in all 9.
  • The cause is the Apple GPU, not the resolve. A standalone Vulkan program (no Leonida, no Wine) that clears a D16 image to 0.25 and reads it back gets 16383 on MoltenVK 1.4.2 and 1.4.3 and on KosmicKrisp (Mesa 26.3.1), and 16384 on llvmpipe. SAMPLE_ZERO/MIN/MAX resolves then copy 16383, and D32 is exact. round(0.25 * 65535) is 16384, so the Apple GPU stores 0.25 rounded down.
  • The same failure with MoltenVK 1.4.3 swapped into Wine, so it is not Wine's older MoltenVK.
  • With same_planes accepting 1 LSB for every D16 case (today it does only for AVERAGE edges), the test passes here.

So for Macs, either the 1-LSB tolerance for all D16 comparisons, or a clear value D16 holds exactly (e.g. 16384 / 65535.0f instead of 0.25f), would keep this test meaningful. The D32 and D24 cases pass unchanged.

AI-assisted (Claude Code). I'm at the PR limit, so this is a report only.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7227256446 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7227256446). Originally posted by [Tauwni](https://github.com/Tauwni) on 2026-11-27T20:11:05Z. --- Tested on a Mac under Wine (Apple M3, macOS 26.5.1, Wine 11.0 with its MoltenVK 1.4.1), merged onto `main` `43a9d562d`. Profile S, no game files. **`d3d12_depth_resolve` fails here, but on the test's exact-bit comparison, not on the change.** (MEASURED) - The 9 failing cases are the new D16 MIN/MAX ones: `D16 depth`, `D16 depth as R16_UNORM` and `R16_TYPELESS depth as D16 MIN`, whole subresource and rect. With the test file alone on `main` the same cases fail, plus the R16_UNORM refusals this PR fixes. - Each one differs from the clears by one LSB: a temporary print of the first differing pixel gives `got 16383 expected 16384` in all 9. - The cause is the Apple GPU, not the resolve. A standalone Vulkan program (no Leonida, no Wine) that clears a D16 image to 0.25 and reads it back gets **16383** on MoltenVK 1.4.2 and 1.4.3 and on KosmicKrisp (Mesa 26.3.1), and 16384 on llvmpipe. SAMPLE_ZERO/MIN/MAX resolves then copy 16383, and D32 is exact. `round(0.25 * 65535)` is 16384, so the Apple GPU stores 0.25 rounded down. - The same failure with MoltenVK 1.4.3 swapped into Wine, so it is not Wine's older MoltenVK. - With `same_planes` accepting 1 LSB for every D16 case (today it does only for AVERAGE edges), the test passes here. So for Macs, either the 1-LSB tolerance for all D16 comparisons, or a clear value D16 holds exactly (e.g. `16384 / 65535.0f` instead of `0.25f`), would keep this test meaningful. The D32 and D24 cases pass unchanged. AI-assisted (Claude Code). I'm at the PR limit, so this is a report only.
lixonik commented 2026-11-27 20:57:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T20:57:32Z.


@Tauwni Thanks for testing on Apple M3 and isolating the D16 clear rounding!

Updated d3d12_depth_resolve_test.cpp in $sha to apply same_planes's existing 1-LSB (1/65535) tolerance to all D16_UNORM comparisons (while keeping D24 and D32 bit-exact). Re-verified on NVIDIA GeForce RTX 5070 (Windows 11, driver 610.88, Vulkan 1.4.341, MSVC 19.44; VK_LAYER_KHRONOS_validation not installed locally): d3d12_depth_resolve passes (5.56 s; 119/119 vs RTX 5070, 93/93 vs WARP, 212 host comparisons matched, 13 refusals kept the destination, 24 edge MIN/MAX pairs differ).

AI-assisted (Antigravity, Gemini).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7227998687 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7227998687). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-27T20:57:32Z. --- @Tauwni Thanks for testing on Apple M3 and isolating the D16 clear rounding! Updated d3d12_depth_resolve_test.cpp in $sha to apply same_planes's existing 1-LSB (1/65535) tolerance to all D16_UNORM comparisons (while keeping D24 and D32 bit-exact). Re-verified on NVIDIA GeForce RTX 5070 (Windows 11, driver 610.88, Vulkan 1.4.341, MSVC 19.44; VK_LAYER_KHRONOS_validation not installed locally): d3d12_depth_resolve passes (5.56 s; 119/119 vs RTX 5070, 93/93 vs WARP, 212 host comparisons matched, 13 refusals kept the destination, 24 edge MIN/MAX pairs differ). AI-assisted (Antigravity, Gemini).
timbot103 commented 2026-11-28 02:02:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:09Z.


Reviewed at head fd07437bd on Windows 11 (MSVC 2022 19.44) with dual-GPU Vulkan validation (LEONIDA_VK_VALIDATION=1, Vulkan SDK 1.4.363.0).

Verification

  • Built d3d12_depth_resolve_test.
  • d3d12_depth_resolve_test (LEONIDA_VK_VALIDATION=1): passed with 0 validation errors on both NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02).

Notes

  • Accepting DXGI_FORMAT_R16_UNORM for D16_UNORM depth plane 0 in ResolveSubresourceRegion while preserving color R16_UNORM resolves, keeping AVERAGE with D16_UNORM refused, and enforcing matching formats/planes/sample counts (d3d12_vulkan_device.cpp:21471-21528) is clean and well-tested.

Approve.

AI-assisted review + local MSVC/dual-GPU verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232084132 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7232084132). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-28T02:02:09Z. --- Reviewed at head `fd07437bd` on Windows 11 (MSVC 2022 `19.44`) with dual-GPU Vulkan validation (`LEONIDA_VK_VALIDATION=1`, Vulkan SDK `1.4.363.0`). ### Verification - Built `d3d12_depth_resolve_test`. - `d3d12_depth_resolve_test` (`LEONIDA_VK_VALIDATION=1`): **passed** with 0 validation errors on both **NVIDIA GeForce RTX 5080** (`616.64`) and **AMD Radeon(TM) Graphics** (`25.10.30.02`). ### Notes - Accepting `DXGI_FORMAT_R16_UNORM` for `D16_UNORM` depth plane 0 in `ResolveSubresourceRegion` while preserving color `R16_UNORM` resolves, keeping `AVERAGE` with `D16_UNORM` refused, and enforcing matching formats/planes/sample counts (`d3d12_vulkan_device.cpp:21471-21528`) is clean and well-tested. Approve. AI-assisted review + local MSVC/dual-GPU verification.
timbot103 commented 2026-11-28 14:37:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T14:37:01Z.

Review: COMMENTED


Static code audit of fd07437bd against ec740bcc3. No confirmed findings.

runtime/shims/d3d12_vulkan_device.cpp:21497 maps R16_UNORM to D16 depth plane 0. The existing guards require matching depth resources and a supported resolve mode. Replay uses the Vulkan depth attachment path, and color AVERAGE retains its own route.

runtime/test/d3d12_depth_resolve_test.cpp:388 and :397 exercise the typed and typeless depth cases through readback. The refusal at :406 checks E_INVALIDARG for AVERAGE with D16_UNORM and verifies that the layer preserves the destination. The PR discussion reports successful NVIDIA and AMD runs with Vulkan validation at this head.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6098420228 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#pullrequestreview-6098420228). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-28T14:37:01Z. **Review:** COMMENTED --- Static code audit of `fd07437bd` against `ec740bcc3`. No confirmed findings. `runtime/shims/d3d12_vulkan_device.cpp:21497` maps `R16_UNORM` to D16 depth plane 0. The existing guards require matching depth resources and a supported resolve mode. Replay uses the Vulkan depth attachment path, and color AVERAGE retains its own route. `runtime/test/d3d12_depth_resolve_test.cpp:388` and `:397` exercise the typed and typeless depth cases through readback. The refusal at `:406` checks `E_INVALIDARG` for AVERAGE with `D16_UNORM` and verifies that the layer preserves the destination. The PR discussion reports successful NVIDIA and AMD runs with Vulkan validation at this head. AI-assisted.
zmasi commented 2026-11-28 21:04:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T21:04:35Z.


Verified fd07437bd merged with 1bc055e6c under Linux Wine 11.0 on physical gfx906, RADV Mesa 26.0.8, with synchronization validation. All 13 R16_UNORM cases went from E_INVALIDARG at Close() on main (no resolve submitted) to S_OK and fenced readback on the merge: 12 typed D16 cases covering MIN/MAX/AVERAGE, full/rectangle, clear/diagonal edge, plus the typeless rectangular AVERAGE case.

In the matched 25-case D16 fixture, successful resolves went from 9 to 22. The three rejection controls stayed rejected and left the destination unchanged, including AVERAGE named as D16_UNORM rather than R16_UNORM. Clear, MIN and MAX words were exact. Of the edge AVERAGE results, four words differed by one from ties-to-even, all at exact half-word ties: for example, 40959 for a mean of 40959.5. No non-tie word or guard differed.

The edge shader was active. These are shader-layer readbacks through Wine, not a native D3D12 or WARP comparison. The full PR test source compiled; the run used its D16-only instrumented fixture on both trees. No shader-run validation errors or synchronization hazards.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245753996 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7245753996). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T21:04:35Z. --- Verified `fd07437bd` merged with `1bc055e6c` under Linux Wine 11.0 on physical gfx906, RADV Mesa 26.0.8, with synchronization validation. All **13** `R16_UNORM` cases went from `E_INVALIDARG` at `Close()` on main (no resolve submitted) to `S_OK` and fenced readback on the merge: 12 typed D16 cases covering MIN/MAX/AVERAGE, full/rectangle, clear/diagonal edge, plus the typeless rectangular AVERAGE case. In the matched 25-case D16 fixture, successful resolves went from 9 to 22. The three rejection controls stayed rejected and left the destination unchanged, including AVERAGE named as `D16_UNORM` rather than `R16_UNORM`. Clear, MIN and MAX words were exact. Of the edge AVERAGE results, four words differed by one from ties-to-even, all at exact half-word ties: for example, 40959 for a mean of 40959.5. No non-tie word or guard differed. The edge shader was active. These are shader-layer readbacks through Wine, not a native D3D12 or WARP comparison. The full PR test source compiled; the run used its D16-only instrumented fixture on both trees. No shader-run validation errors or synchronization hazards. AI-assisted.
fiestorra commented 2026-11-30 06:08:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T06:08:16Z.


Independent verification on this machine (Windows 11, MSVC 19.44.35226, RTX 4090), and the negative control reproduces the exact error the commit removes.

1. It applies. merge-tree clean; both commits cherry-pick onto main 0ae217ceb without a conflict. Two files: d3d12_vulkan_device.cpp and the depth-resolve test.

2. It builds and passes, three times: d3d12_depth_resolve_test.exe -> exit 0, 0, 0.

3. With main's shim (test from the PR kept, binary confirmed rebuilt at 07:07:53):

-> exit 1, 1
  D16 depth as R16_UNORM MIN rect 0: Close 0x80070057, destination differs from the clears
  D16 depth as R16_UNORM MAX rect 0: Close 0x80070057, destination differs from the clears
  D16 depth as R16_UNORM AVERAGE rect 0: Close 0x80070057, destination differs from the clears

0x80070057 is E_INVALIDARG, and it is raised on the very format pairing the commit accepts - a D16_UNORM depth target resolved through an R16_UNORM view. So this is a red->green with the failing error named, not a test agreeing with itself.

What the second commit does and I did check: it relaxes the test to allow 1 LSB of D16 rounding on the destination, which is a tolerance rather than an assertion about behaviour. It is worth a reviewer's eye: the accept path is proven by the first commit, and the tolerance only affects how exact the comparison is after the resolve.

What I did not test: a resolve on a real D16 target with content, which needs the title's depth traffic; the test stages the formats and reads back the result.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7270341093 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7270341093). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T06:08:16Z. --- Independent verification on this machine (Windows 11, MSVC 19.44.35226, RTX 4090), and **the negative control reproduces the exact error the commit removes**. **1. It applies.** `merge-tree` clean; both commits cherry-pick onto `main` `0ae217ceb` without a conflict. Two files: `d3d12_vulkan_device.cpp` and the depth-resolve test. **2. It builds and passes, three times:** `d3d12_depth_resolve_test.exe` -> exit 0, 0, 0. **3. With `main`'s shim (test from the PR kept, binary confirmed rebuilt at 07:07:53):** ``` -> exit 1, 1 D16 depth as R16_UNORM MIN rect 0: Close 0x80070057, destination differs from the clears D16 depth as R16_UNORM MAX rect 0: Close 0x80070057, destination differs from the clears D16 depth as R16_UNORM AVERAGE rect 0: Close 0x80070057, destination differs from the clears ``` `0x80070057` is `E_INVALIDARG`, and it is raised **on the very format pairing the commit accepts** - a D16_UNORM depth target resolved through an R16_UNORM view. So this is a red->green with the failing error named, not a test agreeing with itself. **What the second commit does and I did check:** it relaxes the test to allow **1 LSB** of D16 rounding on the destination, which is a tolerance rather than an assertion about behaviour. It is worth a reviewer's eye: the accept path is proven by the first commit, and the tolerance only affects how exact the comparison is after the resolve. **What I did not test:** a resolve on a real D16 target with content, which needs the title's depth traffic; the test stages the formats and reads back the result. Written with an AI assistant.
ammonium231 commented 2026-11-30 14:16:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ammonium231 on 2026-11-30T14:16:08Z.


RTX 3090 / 621.40, validation on, fd07437bd merged onto main 20fe0c754: d3d12_depth_resolve 96 of 119 match (main 74 of 97), the 22 new cases all match; WARP 93/93 (main 71/71). No validation errors.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7281103691 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7281103691). Originally posted by [ammonium231](https://github.com/ammonium231) on 2026-11-30T14:16:08Z. --- RTX 3090 / 621.40, validation on, fd07437bd merged onto main 20fe0c754: d3d12_depth_resolve 96 of 119 match (main 74 of 97), the 22 new cases all match; WARP 93/93 (main 71/71). No validation errors.
aslan2142 commented 2026-12-01 16:45:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:45:11Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7318160329 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2482#issuecomment-7318160329). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:45:11Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!2482
No description provided.