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

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

@⁠Andretuta on GitHub · 2026-11-24 02:20 UTC · original
ubiquitarianism:old-pr/9844 → main · +21 −4 · 1 files · 1 commits · draft

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)
**@⁠Andretuta** on GitHub · 2026-11-24 02:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/111) `ubiquitarianism:old-pr/9844` → `main` · +21 −4 · 1 files · 1 commits · draft > 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)
A host whose D3D12 reports RelaxedFormatCastingSupported = 0 refuses every
castable-format list with E_INVALIDARG, valid or not. Intel UHD Graphics
(Alder Lake, 32.0.101.7092) does, so d3d12_method_variants failed there on
"CreateReservedResource2, valid castable format on texture: ours 00000000,
host runtime 80070057" with the layer on either GPU. The layer reports the
feature, so on such a host the four cases that pass a list are printed as not
comparable and still checked against their recorded answers; every other edge
case is compared as before. On a host with the feature (NVIDIA, WARP) all 73
are compared.

AI-assisted (Claude Code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:44:51 +00:00
Author
Owner

@⁠MalexAson on GitHub · 2026-11-24 19:06 UTC · original

Tested d64326ee05 applied on main 6293c1c4f, on Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 24H2 (26100.6584): pass.

This is a second machine that shows the failure the description reports. The D3D12 default adapter (the host) is the Iris Xe; D3D12 runtime 10.0.26100.5074.

  • main 6293c1c4f without this change: d3d12_method_variants fails with the layer on either GPU, with CreateReservedResource2, valid castable format on texture: ours 00000000, host runtime 80070057.
  • With this change: it passes with the layer on the Iris Xe and with the layer on the RTX 4060 Laptop GPU (NVIDIA 616.92). The four castable-list cases print not comparable, the host has no relaxed format casting (host 80070057), followed by edge cases: 69 of 73 compared with the host runtime. ctest -R d3d12_method_variants passes for both.

The change applies cleanly on current main. Built with MSVC 19.50 + Ninja, RelWithDebInfo; no warnings in the rebuilt test.

Not tested here: a host with relaxed format casting (the RTX 4060 as the D3D12 host), so the 73 of 73 path was not run.

AI-assisted: this run was made with a coding agent.

**@⁠MalexAson** on GitHub · 2026-11-24 19:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/111#issuecomment-7141604275) Tested d64326ee05 applied on `main` 6293c1c4f, on Intel Iris Xe (Raptor Lake-P, 8086:a7a0), Intel 32.0.101.7092, Windows 11 24H2 (26100.6584): pass. This is a second machine that shows the failure the description reports. The D3D12 default adapter (the host) is the Iris Xe; D3D12 runtime 10.0.26100.5074. - `main` 6293c1c4f without this change: `d3d12_method_variants` fails with the layer on either GPU, with `CreateReservedResource2, valid castable format on texture: ours 00000000, host runtime 80070057`. - With this change: it passes with the layer on the Iris Xe and with the layer on the RTX 4060 Laptop GPU (NVIDIA 616.92). The four castable-list cases print `not comparable, the host has no relaxed format casting (host 80070057)`, followed by `edge cases: 69 of 73 compared with the host runtime`. `ctest -R d3d12_method_variants` passes for both. The change applies cleanly on current `main`. Built with MSVC 19.50 + Ninja, RelWithDebInfo; no warnings in the rebuilt test. Not tested here: a host with relaxed format casting (the RTX 4060 as the D3D12 host), so the 73 of 73 path was not run. AI-assisted: this run was made with a coding agent.
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/111/head:github-bot/gh-111'
git switch 'github-bot/gh-111'

Merge

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