runtime tests: compare heaps on a resource heap tier 1 host (TEST-HEAP-TIER1-HOST) #1389

Open
github-bot wants to merge 2 commits from github-bot/gh-1389 into main AGit
Owner

@⁠qhukz13 on GitHub · 2026-11-24 23:06 UTC · original
qhukz13:cont/heap-tier1-tests → main · +104 −37 · 3 files · 2 commits · open

Claimed in the coordination issue as: TEST-HEAP-TIER1-HOST (claim)

Depends on: #1364 for d3d12_vulkan_device and d3d12_heap_properties to pass in full on NVIDIA Pascal (without it
both stop earlier on that card, on the CPU-heap textures). The change here is independent of it.

What and why

The layer accepts heaps without two DENY flags (D3D12_HEAP_FLAG_NONE, ALLOW_ALL_BUFFERS_AND_TEXTURES), as the
console does. A D3D12 host of resource heap tier 1 refuses them with E_INVALIDARG; measured on a GeForce GTX 1050
Ti (Pascal) with Windows 10, whose native D3D12 reports D3D12_RESOURCE_HEAP_TIER_1. So three host comparisons
report mismatches that are the host's tier, not the layer:

  • d3d12_heap_properties: placed buffer, DEFAULT heap, ALLOW_ALL and placed texture, DEFAULT heap, ALLOW_ALL
    (ours 0x0 host 0x80070057);
  • d3d12_vulkan_device, compare_heap_neighbours: the NONE-flag heaps (alignment 0 / 64 KiB / 4 MiB, size 1000,
    upload, readback, custom write-combine L0) fail heap_mismatches <= 0;
  • d3d12_vulkan_device, compare_placed_reserved: every placed case on the default NONE-flag heap gets
    E_UNEXPECTED from the host's CreateHeap (reached once the check above passes).

Each test now asks the host for ResourceHeapTier. On a tier-1 host only:

  • d3d12_heap_properties prints the mixed-heap cases as not comparable on this host (resource heap tier 1 host),
    the way it already prints the MEMORY_POOL_L1 cases on a UMA host, and the host line names the tier;
  • d3d12_vulkan_device creates the NONE-flag heaps as ALLOW_ONLY_BUFFERS in compare_heap_neighbours, and as the
    ALLOW_ONLY_* heap that matches the resource in compare_placed_reserved, on both devices, so the alignment,
    size, heap-type and placement argument checks are still compared; one line says so. Cases that set their heap
    flags on purpose are not touched.

On a tier-2 host nothing changes. docs/testing.md gets one row in its known-problems table.

Tested

GeForce GTX 1050 Ti, NVIDIA 582.66, Windows 10 19045, MSVC RelWithDebInfo, main 0f98d193c + this branch +
#1364, ctest -R "^(d3d12_heap_properties|d3d12_vulkan_device)$" three times: both pass every time
(d3d12_heap_properties: 527 values compared, 0 mismatches). With LEONIDA_HOST_ADAPTER=warp (WARP is tier 2) the
ALLOW_ALL cases are compared again (544 values compared, 0 mismatches). Without this branch the same build fails
d3d12_heap_properties on the two ALLOW_ALL cases and d3d12_vulkan_device at heap_mismatches <= 0.

#1094 (TEST-METHOD-VARIANTS-HEAP-TIER1) does the same for d3d12_method_variants.

GPUs tested: NVIDIA GeForce GTX 1050 Ti, driver 582.66, Windows 10 19045. No game files.

AI-assisted: yes (Claude Code, with Antigravity for the implementation and the runs)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption (CONTRIBUTING.md).
  • A new translator rule is in the contract table of docs/design.md. (Tests only.)

🤖 Generated with Claude Code

**@⁠qhukz13** on GitHub · 2026-11-24 23:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1389) `qhukz13:cont/heap-tier1-tests` → `main` · +104 −37 · 3 files · 2 commits · open Claimed in the coordination issue as: TEST-HEAP-TIER1-HOST ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)) Depends on: #1364 for `d3d12_vulkan_device` and `d3d12_heap_properties` to pass in full on NVIDIA Pascal (without it both stop earlier on that card, on the CPU-heap textures). The change here is independent of it. ### What and why The layer accepts heaps without two DENY flags (`D3D12_HEAP_FLAG_NONE`, `ALLOW_ALL_BUFFERS_AND_TEXTURES`), as the console does. A D3D12 host of resource heap tier 1 refuses them with `E_INVALIDARG`; measured on a GeForce GTX 1050 Ti (Pascal) with Windows 10, whose native D3D12 reports `D3D12_RESOURCE_HEAP_TIER_1`. So three host comparisons report mismatches that are the host's tier, not the layer: - `d3d12_heap_properties`: `placed buffer, DEFAULT heap, ALLOW_ALL` and `placed texture, DEFAULT heap, ALLOW_ALL` (`ours 0x0 host 0x80070057`); - `d3d12_vulkan_device`, `compare_heap_neighbours`: the NONE-flag heaps (alignment 0 / 64 KiB / 4 MiB, size 1000, upload, readback, custom write-combine L0) fail `heap_mismatches <= 0`; - `d3d12_vulkan_device`, `compare_placed_reserved`: every placed case on the default NONE-flag heap gets `E_UNEXPECTED` from the host's `CreateHeap` (reached once the check above passes). Each test now asks the host for `ResourceHeapTier`. On a tier-1 host only: - `d3d12_heap_properties` prints the mixed-heap cases as `not comparable on this host (resource heap tier 1 host)`, the way it already prints the `MEMORY_POOL_L1` cases on a UMA host, and the host line names the tier; - `d3d12_vulkan_device` creates the NONE-flag heaps as `ALLOW_ONLY_BUFFERS` in `compare_heap_neighbours`, and as the `ALLOW_ONLY_*` heap that matches the resource in `compare_placed_reserved`, on both devices, so the alignment, size, heap-type and placement argument checks are still compared; one line says so. Cases that set their heap flags on purpose are not touched. On a tier-2 host nothing changes. `docs/testing.md` gets one row in its known-problems table. ### Tested GeForce GTX 1050 Ti, NVIDIA 582.66, Windows 10 19045, MSVC RelWithDebInfo, `main` `0f98d193c` + this branch + #1364, `ctest -R "^(d3d12_heap_properties|d3d12_vulkan_device)$"` three times: both pass every time (`d3d12_heap_properties`: 527 values compared, 0 mismatches). With `LEONIDA_HOST_ADAPTER=warp` (WARP is tier 2) the `ALLOW_ALL` cases are compared again (544 values compared, 0 mismatches). Without this branch the same build fails `d3d12_heap_properties` on the two `ALLOW_ALL` cases and `d3d12_vulkan_device` at `heap_mismatches <= 0`. #1094 (TEST-METHOD-VARIANTS-HEAP-TIER1) does the same for `d3d12_method_variants`. GPUs tested: NVIDIA GeForce GTX 1050 Ti, driver 582.66, Windows 10 19045. No game files. AI-assisted: yes (Claude Code, with Antigravity for the implementation and the runs) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption (CONTRIBUTING.md). - [ ] A new translator rule is in the contract table of `docs/design.md`. (Tests only.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a resource heap tier 1 D3D12 host (measured on a GeForce GTX 1050 Ti
with Windows 10), CreateHeap refuses mixed heaps without two DENY flags
(D3D12_HEAP_FLAG_NONE / ALLOW_ALL) with E_INVALIDARG, while the layer
accepts them as Xbox does.

- d3d12_heap_properties_test: query host ResourceHeapTier once and mark
  mixed placed-heap (ALLOW_ALL) cases not comparable on a tier-1 host;
  tier-2+ hosts are unchanged.
- d3d12_vulkan_device_test: in compare_heap_neighbours, compare the
  NONE-flag heaps as ALLOW_ONLY_BUFFERS on both devices on a tier-1
  host; in compare_placed_reserved, use category-specific ALLOW_ONLY_*
  heaps for NONE-flag placed cases on a tier-1 host so CreatePlacedResource
  argument checks stay compared instead of failing in CreateHeap.
- docs/testing.md: document the tier-1 host behaviour in Known problems.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:49:42 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:20 UTC · original

Reviewed 81c93402f: the two touched tests need MSVC/Windows + a GPU, so they were not run; this review rests on reading the code plus the checks I could run on the PR tree and on main: cmake + ctest -N (both configure; the touched targets are Windows-only), check_no_game_data.py (clean), and a g++ probe that extracts tier1_placed_heap_flags and the tier-1 case classification verbatim. Exactly the two ALLOW_ALL placed cases are skipped, every mapped heap is a valid two-DENY set matching the resource category, and nothing changes for tier 2+ / explicit-flag cases. Please let Windows CI cover the actual tests. No findings. Unverified without a tier-1 host: the HARDWARE_PROTECTED neighbour case would still mismatch on a tier-1 host with a newer-Windows runtime (ID3D12Device11 present). The branch is 376 commits behind main and merges clean.

AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 15:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1389#issuecomment-7166692207) Reviewed 81c93402f: the two touched tests need MSVC/Windows + a GPU, so they were not run; this review rests on reading the code plus the checks I could run on the PR tree and on main: `cmake` + `ctest -N` (both configure; the touched targets are Windows-only), `check_no_game_data.py` (clean), and a g++ probe that extracts `tier1_placed_heap_flags` and the tier-1 case classification verbatim. Exactly the two ALLOW_ALL placed cases are skipped, every mapped heap is a valid two-DENY set matching the resource category, and nothing changes for tier 2+ / explicit-flag cases. Please let Windows CI cover the actual tests. No findings. Unverified without a tier-1 host: the `HARDWARE_PROTECTED` neighbour case would still mismatch on a tier-1 host with a newer-Windows runtime (`ID3D12Device11` present). The branch is 376 commits behind main and merges clean. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-26 19:10 UTC · original

Re-checked on current main 2d43417d4 (merges cleanly). GTX 1050 Ti, Windows 10, MSVC RelWithDebInfo, with and without LEONIDA_VK_VALIDATION=1.

test main main + this PR
d3d12_heap_properties fails passes
d3d12_vulkan_device fails, line 7362: heap_mismatches <= 0 passes

The second failure comes from compare_heap_neighbours. The resource heap tier 1 host refuses the seven mixed-heap cases (alignment 0 / 64 KiB / 4 MiB, size 1000, upload, readback, custom write-combine L0) with 0x80070057, and the layer accepts them as the console does. Both are the only tier-1 failures in a full ctest of main on this card. The other failures there come from Windows 10's runtime or from session 0.

AI-assisted (Claude Code).

**@⁠qhukz13** on GitHub · 2026-11-26 19:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1389#issuecomment-7201275638) Re-checked on current main `2d43417d4` (merges cleanly). GTX 1050 Ti, Windows 10, MSVC RelWithDebInfo, with and without `LEONIDA_VK_VALIDATION=1`. | test | main | main + this PR | |---|---|---| | `d3d12_heap_properties` | fails | passes | | `d3d12_vulkan_device` | fails, `line 7362: heap_mismatches <= 0` | passes | The second failure comes from `compare_heap_neighbours`. The resource heap tier 1 host refuses the seven mixed-heap cases (alignment 0 / 64 KiB / 4 MiB, size 1000, upload, readback, custom write-combine L0) with `0x80070057`, and the layer accepts them as the console does. Both are the only tier-1 failures in a full `ctest` of main on this card. The other failures there come from Windows 10's runtime or from session 0. AI-assisted (Claude Code).
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/1389/head:github-bot/gh-1389'
git switch 'github-bot/gh-1389'

Merge

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