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

Closed
veqzo wants to merge 1 commit from upstream-pr/1094 into main
veqzo commented 2026-11-24 18:19:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by veqzo on 2026-11-24T18:19:54Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5477879155 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1094). Originally posted by [veqzo](https://github.com/veqzo) on 2026-11-24T18:19:54Z. --- 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.
abnalstlll-byte commented 2026-11-24 18:42:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T18:42:55Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045243076 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1094#pullrequestreview-6045243076). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T18:42:55Z. **Review:** APPROVED --- 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.
Deedlyy commented 2026-11-24 20:18:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:18:38Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143345613 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1094#issuecomment-7143345613). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:18:38Z. --- **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
whoalin1 commented 2026-11-24 22:03:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-24T22:03:37Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7145747797 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1094#issuecomment-7145747797). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-24T22:03:37Z. --- 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.
OreoFR commented 2026-11-28 21:46:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:46:37Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head badfead1d; green run in a merge package of 9 PRs, no new ctest failure vs main
  • Test: ctest -R ^d3d12_method_variants$
  • Red on main: OK on main
  • Green with the PR: OK
  • Verdict: NO RED (test-only PR for tier 1 heaps; the RTX 4070 is tier 2, the branch is not exercised)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246263330 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1094#issuecomment-7246263330). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:46:37Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `badfead1d`; green run in a merge package of 9 PRs, no new ctest failure vs main - Test: `ctest -R ^d3d12_method_variants$` - Red on main: OK on main - Green with the PR: OK - Verdict: NO RED (test-only PR for tier 1 heaps; the RTX 4070 is tier 2, the branch is not exercised) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 02:36:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:36:12Z.


Independent Hardware Verification (RTX 3090, Windows 11, VK_LAYER_KHRONOS_validation 1.4.363.1)

  • Tested merge: origin/main (04f484006e) + PR #1094 (badfead1de) — clean 3-way merge (0 conflicts).
  • Environment: NVIDIA GeForce RTX 3090 (24 GB, Resizable BAR, tier-2 D3D12 host adapter), Windows 11, Visual Studio 2022 (MSVC 19.44 RelWithDebInfo), Vulkan SDK + VK_LAYER_KHRONOS_validation 1.4.363.1 (LEONIDA_VK_VALIDATION=1).

Verification Results

  • ctest -C RelWithDebInfo -R "^d3d12_method_variants$" --output-on-failure -V: Passed (2.59 s, 0 Vulkan validation errors).
    • Verified all four explicit CreateHeap edge-table checks (non-RT/DS texture heap, buffer heap, RT/DS texture heap, upload heap == S_OK) and confirmed CreateCommittedResource1/2/3, CreatePlacedResource2, CreateReservedResource1/2, CreateCommandQueue1, GetCopyableFootprints1, and texture round-trip readback match the host runtime with zero regressions on a tier-2 host.

Code & Tier-1 Contract Audit

  • Every CreatePlacedResource2 call in edge_answers() now targets a heap whose D3D12_HEAP_FLAGS satisfy D3D12 D3D12_RESOURCE_HEAP_TIER_1 segregation (D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS for tall_buffer and buffer, D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES for rt_tex and ds_deny_tex, and D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES for placed_heap and p2_host_sized non-RT/DS textures), matching the layer's own D3D12_RESOURCE_HEAP_TIER_1 report while checking all heap-creation HRESULTs up front instead of passing null ID3D12Heap* handles on tier-1 hosts.
  • python -I scripts/check_no_game_data.py runtime/test/d3d12_method_variants_test.cpp: passed (0 issues). No game files used.

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249531127 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1094#issuecomment-7249531127). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T02:36:12Z. --- ### Independent Hardware Verification (RTX 3090, Windows 11, `VK_LAYER_KHRONOS_validation` `1.4.363.1`) - **Tested merge:** `origin/main` (`04f484006e`) + PR `#1094` (`badfead1de`) — clean 3-way merge (`0` conflicts). - **Environment:** NVIDIA GeForce RTX 3090 (24 GB, Resizable BAR, tier-2 D3D12 host adapter), Windows 11, Visual Studio 2022 (MSVC 19.44 `RelWithDebInfo`), Vulkan SDK + `VK_LAYER_KHRONOS_validation` `1.4.363.1` (`LEONIDA_VK_VALIDATION=1`). #### Verification Results - `ctest -C RelWithDebInfo -R "^d3d12_method_variants$" --output-on-failure -V`: **Passed** (`2.59 s`, `0` Vulkan validation errors). - Verified all four explicit `CreateHeap` edge-table checks (`non-RT/DS texture heap`, `buffer heap`, `RT/DS texture heap`, `upload heap` == `S_OK`) and confirmed `CreateCommittedResource1/2/3`, `CreatePlacedResource2`, `CreateReservedResource1/2`, `CreateCommandQueue1`, `GetCopyableFootprints1`, and texture round-trip readback match the host runtime with zero regressions on a tier-2 host. #### Code & Tier-1 Contract Audit - Every `CreatePlacedResource2` call in `edge_answers()` now targets a heap whose `D3D12_HEAP_FLAGS` satisfy D3D12 `D3D12_RESOURCE_HEAP_TIER_1` segregation (`D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS` for `tall_buffer` and `buffer`, `D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES` for `rt_tex` and `ds_deny_tex`, and `D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES` for `placed_heap` and `p2_host_sized` non-RT/DS textures), matching the layer's own `D3D12_RESOURCE_HEAP_TIER_1` report while checking all heap-creation `HRESULT`s up front instead of passing null `ID3D12Heap*` handles on tier-1 hosts. - `python -I scripts/check_no_game_data.py runtime/test/d3d12_method_variants_test.cpp`: passed (`0` issues). No game files used. AI-assisted: yes
aslan2142 commented 2026-12-01 16:33:17 +00:00 (Migrated from github.com)

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


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:7317798535 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1094#issuecomment-7317798535). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:33:17Z. --- 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!1094
No description provided.