[PR #111] Tests: method_variants castable-list cases on a host without relaxed format casting #163

Open
opened 2026-11-26 20:16:59 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/111
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9844


📝 Commits (1)

  • d64326e Tests: method_variants castable-list cases on a host without relaxed format casting

📊 Changes

1 file changed (+21 additions, -4 deletions)

View changed files

📝 runtime/test/d3d12_method_variants_test.cpp (+21 -4)

📄 Description

Carried over from old PR 9844 by imranakki in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9844, 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.
imranakki: 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: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116713080

Separate from #5390 (host adapter) and #7422 (resource heap tier 1), which touch other lines of the same file.

What and why

d3d12_method_variants fails on main 5d74c2723 on a laptop with an Intel UHD (Alder Lake, 32.0.101.7092) and an RTX 3060 Laptop (NVIDIA 595.97), with the layer on either GPU. The host is D3D12's default adapter, the Intel:

CreateReservedResource2, valid castable format on texture: ours 00000000, host runtime 80070057

The Intel D3D12 driver reports RelaxedFormatCastingSupported = 0 and refuses every castable-format list. A standalone probe of each adapter's own D3D12 (a 64x64 R8G8B8A8_UNORM reserved texture, 64KB_UNDEFINED_SWIZZLE, COMMON):

host RelaxedFormatCasting no list count 2, null list _SRGB own format _UINT R32_UINT committed (CreateCommittedResource3), _SRGB
Intel UHD 32.0.101.7092 0 S_OK S_OK E_INVALIDARG E_INVALIDARG E_INVALIDARG E_INVALIDARG E_INVALIDARG
RTX 3060 595.97 1 S_OK S_OK S_OK S_OK S_OK S_OK S_OK
WARP 1 S_OK S_OK S_OK S_OK S_OK S_OK S_OK

The layer reports the feature (the test checks RelaxedFormatCastingSupported == TRUE), so on such a host the difference is the host's capability, not a layer bug. d3d12_clear and d3d12_typeless_rtv already handle the same host limitation.

The change is in the test only:

  • Edge gets a casts flag, set on the 4 edge cases that pass a castable-format list (buffer with a list, UNKNOWN in the list, mismatched texel size, valid _SRGB). "castable count with null list" is no list and stays comparable.
  • On a host whose OPTIONS12.RelaxedFormatCastingSupported is 0, those 4 are printed as not comparable, the host has no relaxed format casting and not compared with the host. They are still checked against their recorded answers, as every case is. Every other case is compared as before.
  • The test prints how many edge cases it compared: edge cases: N of 73 compared with the host runtime.

Tested

Windows 11 Pro 26200, MSVC 14.44, Vulkan SDK 1.4.363, Ninja RelWithDebInfo, on main 5d74c2723. main fails in both rows with the Intel host; this branch:

layer (LEONIDA_VK_DEVICE) host result
RTX 3060 Intel UHD (default adapter) pass, 69 of 73 compared, 4 not comparable
Intel UHD Intel UHD (default adapter) pass, 69 of 73 compared, 4 not comparable
RTX 3060 RTX 3060 pass, 73 of 73 compared
Intel UHD RTX 3060 pass, 73 of 73 compared

The RTX 3060 host rows used Windows' per-app GPU preference (GpuPreference=2) for the test exe, since this test still creates its host on the default adapter (#5390 changes that).

Negative controls (a temporary local edit, not in this PR, flipping one layer answer before the host comparison):

flipped case host Intel UHD host RTX 3060
CreateReservedResource2, valid castable format on texture pass: not comparable on this host, by design fail
CreateCommittedResource3, valid clear value on RT fail fail

The remaining gap is that the castable-list answers are only compared with a host that supports relaxed format casting.

ctest -R d3d12_method_variants passes with the layer on both GPUs, with no new build warnings. git diff --check, test_ctest_registration.py, test_text_encoding.py and test_docs_repo_paths.py pass.

AI-assisted: yes (Claude Code wrote the change and ran the tests; I checked the results and the diff).

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. (n/a: no 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/111 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9844` --- ### 📝 Commits (1) - [`d64326e`](https://github.com/ubiquitarianism/leonida/commit/d64326ee05203b68aa152d9a7a03db31afd2c486) Tests: method_variants castable-list cases on a host without relaxed format casting ### 📊 Changes **1 file changed** (+21 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/d3d12_method_variants_test.cpp` (+21 -4) </details> ### 📄 Description > Carried over from **old PR 9844** by `imranakki` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9844`, 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. > `imranakki`: 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: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116713080 Separate from `#5390` (host adapter) and `#7422` (resource heap tier 1), which touch other lines of the same file. ### What and why `d3d12_method_variants` fails on `main` 5d74c2723 on a laptop with an Intel UHD (Alder Lake, 32.0.101.7092) and an RTX 3060 Laptop (NVIDIA 595.97), with the layer on either GPU. The host is D3D12's default adapter, the Intel: ``` CreateReservedResource2, valid castable format on texture: ours 00000000, host runtime 80070057 ``` The Intel D3D12 driver reports `RelaxedFormatCastingSupported = 0` and refuses every castable-format list. A standalone probe of each adapter's own D3D12 (a 64x64 `R8G8B8A8_UNORM` reserved texture, `64KB_UNDEFINED_SWIZZLE`, `COMMON`): | host | `RelaxedFormatCasting` | no list | count 2, null list | `_SRGB` | own format | `_UINT` | `R32_UINT` | committed (`CreateCommittedResource3`), `_SRGB` | |---|---|---|---|---|---|---|---|---| | Intel UHD 32.0.101.7092 | 0 | S_OK | S_OK | E_INVALIDARG | E_INVALIDARG | E_INVALIDARG | E_INVALIDARG | E_INVALIDARG | | RTX 3060 595.97 | 1 | S_OK | S_OK | S_OK | S_OK | S_OK | S_OK | S_OK | | WARP | 1 | S_OK | S_OK | S_OK | S_OK | S_OK | S_OK | S_OK | The layer reports the feature (the test checks `RelaxedFormatCastingSupported == TRUE`), so on such a host the difference is the host's capability, not a layer bug. `d3d12_clear` and `d3d12_typeless_rtv` already handle the same host limitation. The change is in the test only: - `Edge` gets a `casts` flag, set on the 4 edge cases that pass a castable-format list (buffer with a list, `UNKNOWN` in the list, mismatched texel size, valid `_SRGB`). "castable count with null list" is no list and stays comparable. - On a host whose `OPTIONS12.RelaxedFormatCastingSupported` is 0, those 4 are printed as `not comparable, the host has no relaxed format casting` and not compared with the host. They are still checked against their recorded answers, as every case is. Every other case is compared as before. - The test prints how many edge cases it compared: `edge cases: N of 73 compared with the host runtime`. ### Tested Windows 11 Pro 26200, MSVC 14.44, Vulkan SDK 1.4.363, Ninja RelWithDebInfo, on `main` 5d74c2723. `main` fails in both rows with the Intel host; this branch: | layer (`LEONIDA_VK_DEVICE`) | host | result | |---|---|---| | RTX 3060 | Intel UHD (default adapter) | pass, 69 of 73 compared, 4 not comparable | | Intel UHD | Intel UHD (default adapter) | pass, 69 of 73 compared, 4 not comparable | | RTX 3060 | RTX 3060 | pass, **73 of 73 compared** | | Intel UHD | RTX 3060 | pass, 73 of 73 compared | The RTX 3060 host rows used Windows' per-app GPU preference (`GpuPreference=2`) for the test exe, since this test still creates its host on the default adapter (`#5390` changes that). Negative controls (a temporary local edit, not in this PR, flipping one layer answer before the host comparison): | flipped case | host Intel UHD | host RTX 3060 | |---|---|---| | `CreateReservedResource2, valid castable format on texture` | pass: not comparable on this host, by design | fail | | `CreateCommittedResource3, valid clear value on RT` | fail | fail | The remaining gap is that the castable-list answers are only compared with a host that supports relaxed format casting. `ctest -R d3d12_method_variants` passes with the layer on both GPUs, with no new build warnings. `git diff --check`, `test_ctest_registration.py`, `test_text_encoding.py` and `test_docs_repo_paths.py` pass. AI-assisted: yes (Claude Code wrote the change and ran the tests; I checked the results and the diff). ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#163
No description provided.