tests: fix method variants on tier-1 heaps (TEST-METHOD-VARIANTS-HEAP-TIER1) #1094

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

@⁠veqzo on GitHub · 2026-11-24 18:19 UTC · original
veqzo:fix-method-variants-tier1 → main · +19 −9 · 1 files · 1 commits · open

Claimed in the coordination issue as: TEST-METHOD-VARIANTS-HEAP-TIER1

What and why

On a tier-1 D3D12 host, d3d12_method_variants creates a mixed-resource heap that the host rejects. The test ignores that failure and passes a null heap into CreatePlacedResource2, so it reports a misleading host/layer mismatch for a valid render target.

Use separate buffer, RT/DS texture, and non-RT/DS texture heaps, including for host-sized texture cases. Check the four heap creation results so setup errors are visible. This preserves the resource-creation comparisons on tier-1 hosts.

PR #111 changes the same test file for a separate relaxed-format-casting issue. It does not change this heap setup; its patch did not apply directly over the earlier local checkout and may require integration or a rebase.

Tested

  • Before: ctest --test-dir runtime/build-full -R '^d3d12_method_variants$' --output-on-failure failed because the layer returned S_OK and the host returned E_INVALIDARG for the placed render target.
  • A standalone host probe reported resource heap tier 1: CreateHeap with mixed-resource flags returned E_INVALIDARG; with RT/DS-only flags, both heap and the same placed render target were created successfully.
  • After rebasing onto 3aa975421d470b76da1aa986a91282c59e20d642 and rebuilding d3d12_method_variants_test, the same CTest passed.
  • python -I scripts/check_no_game_data.py runtime/test/d3d12_method_variants_test.cpp and git diff origin/main --check passed.
  • Tier-2 hardware was not tested.

GPUs tested: NVIDIA GeForce GTX 1080, driver 582.78, Windows 11 Pro 10.0.26300, MSVC 19.44, Vulkan SDK 1.4.363.0.

AI-assisted: yes, Codex.

Checklist

  • Based on current main at the time of the rebase.
  • One topic.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table. Not applicable: no translator rule changed.
**@⁠veqzo** on GitHub · 2026-11-24 18:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1094) `veqzo:fix-method-variants-tier1` → `main` · +19 −9 · 1 files · 1 commits · open Claimed in the coordination issue as: TEST-METHOD-VARIANTS-HEAP-TIER1 ### What and why On a tier-1 D3D12 host, `d3d12_method_variants` creates a mixed-resource heap that the host rejects. The test ignores that failure and passes a null heap into `CreatePlacedResource2`, so it reports a misleading host/layer mismatch for a valid render target. Use separate buffer, RT/DS texture, and non-RT/DS texture heaps, including for host-sized texture cases. Check the four heap creation results so setup errors are visible. This preserves the resource-creation comparisons on tier-1 hosts. PR #111 changes the same test file for a separate relaxed-format-casting issue. It does not change this heap setup; its patch did not apply directly over the earlier local checkout and may require integration or a rebase. ### Tested - Before: `ctest --test-dir runtime/build-full -R '^d3d12_method_variants$' --output-on-failure` failed because the layer returned S_OK and the host returned E_INVALIDARG for the placed render target. - A standalone host probe reported resource heap tier 1: `CreateHeap` with mixed-resource flags returned E_INVALIDARG; with RT/DS-only flags, both heap and the same placed render target were created successfully. - After rebasing onto `3aa975421d470b76da1aa986a91282c59e20d642` and rebuilding `d3d12_method_variants_test`, the same CTest passed. - `python -I scripts/check_no_game_data.py runtime/test/d3d12_method_variants_test.cpp` and `git diff origin/main --check` passed. - Tier-2 hardware was not tested. GPUs tested: NVIDIA GeForce GTX 1080, driver 582.78, Windows 11 Pro 10.0.26300, MSVC 19.44, Vulkan SDK 1.4.363.0. AI-assisted: yes, Codex. ### Checklist - [x] Based on current `main` at the time of the rebase. - [x] One topic. - [x] No game data, keys or decryption. - [ ] A new translator rule is in the contract table. Not applicable: no translator rule changed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:37:53 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 18:42 UTC · original · approved these changes

Audited and verified. Adapts
untime/test/d3d12_method_variants_test.cpp for Resource Heap Tier 1 hardware by splitting placed heaps into dedicated flag-scoped heaps (ALLOW_ONLY_BUFFERS, ALLOW_ONLY_NON_RT_DS_TEXTURES, ALLOW_ONLY_RT_DS_TEXTURES), resolving spurious heap creation failures on Tier-1 adapters. Clean-room compliant. Approved.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 18:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1094#pullrequestreview-6045243076) · **approved these changes** Audited and verified. Adapts untime/test/d3d12_method_variants_test.cpp for Resource Heap Tier 1 hardware by splitting placed heaps into dedicated flag-scoped heaps (ALLOW_ONLY_BUFFERS, ALLOW_ONLY_NON_RT_DS_TEXTURES, ALLOW_ONLY_RT_DS_TEXTURES), resolving spurious heap creation failures on Tier-1 adapters. Clean-room compliant. Approved.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:18 UTC · original

Recommendation: [MERGE]

Reasoning: Test-only fix: d3d12_method_variants now uses separate flag-scoped heaps so tier-1 D3D12 hosts stop reporting a false host/layer mismatch, and it checks heap-creation results. One file, +19/-9, no runtime code touched. Note #111 edits the same test file, so whichever lands second may need a rebase. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1094#issuecomment-7143345613) **Recommendation:** [MERGE] **Reasoning:** Test-only fix: `d3d12_method_variants` now uses separate flag-scoped heaps so tier-1 D3D12 hosts stop reporting a false host/layer mismatch, and it checks heap-creation results. One file, +19/-9, no runtime code touched. Note #111 edits the same test file, so whichever lands second may need a rebase. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-24 22:03 UTC · original

Verification (independent, AI-assisted — Devin worker agent, Windows 11, MSVC, Vulkan SDK 1.4.363.0):

Checked out head badfead in a clean worktree, rebuilt d3d12_method_variants_test with the standard runtime build, and ran ctest -R '^d3d12_method_variants$' --output-on-failure on both GPUs. Also ran the same test on a fresh origin/main (4a50caf) baseline build for comparison.

PR head badfead

  • AMD Radeon iGPU (gfx1035, driver 24.10.24, LEONIDA_VK_VALIDATION=1 LEONIDA_PC_TAIL_UBO=1): Passed (0.69 s)
  • NVIDIA RTX 4070 SUPER (LEONIDA_VK_DEVICE=4070): Passed (1.08 s)

Baseline origin/main

  • AMD iGPU: Passed (0.61 s)
  • RTX 4070 SUPER: Passed (1.17 s)

Notes

  • The failure this fixes needs a tier-1 host D3D12 device (the test compares the layer against the live PC D3D12 runtime). Neither GPU on this machine reproduces it: both report tier-2-class host behavior, so the baseline passes here too. That matches the PR description — the bug only shows on tier-1 hosts (the contributor saw it on a GTX 1080 setup).
  • The diff is test-only (runtime/test/d3d12_method_variants_test.cpp): mixed-flag placed heaps are split into buffer / RT-DS texture / non-RT-DS texture heaps per D3D12 tier-1 rules, host-sized texture heaps get ALLOW_ONLY_NON_RT_DS_TEXTURES, and the four CreateHeap HRESULTs are now asserted instead of ignored. Resource-placement calls were retargeted to the correctly-typed heaps; expected HRESULTs are unchanged.
  • Layer itself still reports ResourceHeapTier = D3D12_RESOURCE_HEAP_TIER_1 (runtime/shims/d3d12_vulkan_device.cpp), so the tier-1 heap discipline is the right contract for this test.
  • git diff origin/main --check clean; no game data involved (synthetic resources only).

No issues found. Cannot confirm the tier-1 fix on this hardware — both adapters here are effectively tier-2 for the host comparison — but the change is correct-by-construction for tier-1 and is a no-op regression-wise on tier-2.

**@⁠whoalin1** on GitHub · 2026-11-24 22:03 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1094#issuecomment-7145747797) Verification (independent, AI-assisted — Devin worker agent, Windows 11, MSVC, Vulkan SDK 1.4.363.0): Checked out head `badfead` in a clean worktree, rebuilt `d3d12_method_variants_test` with the standard runtime build, and ran `ctest -R '^d3d12_method_variants$' --output-on-failure` on both GPUs. Also ran the same test on a fresh `origin/main` (`4a50caf`) baseline build for comparison. **PR head `badfead`** - AMD Radeon iGPU (gfx1035, driver 24.10.24, `LEONIDA_VK_VALIDATION=1 LEONIDA_PC_TAIL_UBO=1`): **Passed** (0.69 s) - NVIDIA RTX 4070 SUPER (`LEONIDA_VK_DEVICE=4070`): **Passed** (1.08 s) **Baseline `origin/main`** - AMD iGPU: **Passed** (0.61 s) - RTX 4070 SUPER: **Passed** (1.17 s) **Notes** - The failure this fixes needs a *tier-1* host D3D12 device (the test compares the layer against the live PC D3D12 runtime). Neither GPU on this machine reproduces it: both report tier-2-class host behavior, so the baseline passes here too. That matches the PR description — the bug only shows on tier-1 hosts (the contributor saw it on a GTX 1080 setup). - The diff is test-only (`runtime/test/d3d12_method_variants_test.cpp`): mixed-flag placed heaps are split into buffer / RT-DS texture / non-RT-DS texture heaps per D3D12 tier-1 rules, host-sized texture heaps get `ALLOW_ONLY_NON_RT_DS_TEXTURES`, and the four `CreateHeap` HRESULTs are now asserted instead of ignored. Resource-placement calls were retargeted to the correctly-typed heaps; expected HRESULTs are unchanged. - Layer itself still reports `ResourceHeapTier = D3D12_RESOURCE_HEAP_TIER_1` (`runtime/shims/d3d12_vulkan_device.cpp`), so the tier-1 heap discipline is the right contract for this test. - `git diff origin/main --check` clean; no game data involved (synthetic resources only). No issues found. Cannot confirm the tier-1 fix on this hardware — both adapters here are effectively tier-2 for the host comparison — but the change is correct-by-construction for tier-1 and is a no-op regression-wise on tier-2.
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/1094/head:github-bot/gh-1094'
git switch 'github-bot/gh-1094'

Merge

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