test: bind a PSO before direct heap dispatch #2153

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

@⁠Joaco9020 on GitHub · 2026-11-26 00:11 UTC · original
Joaco9020:fix/direct-heap-dispatch-test → main · +48 −2 · 2 files · 1 commits · open

Claimed in the coordination issue as RT-DIRECT-HEAP-DISPATCH-TEST.

What and why

The direct heap indexing regression check dispatched without binding a compute PSO. The command list correctly rejected the dispatch, so the test had no recorded command to inspect. This adds the existing synthetic compute shader to the test target, builds a small shader library for it, and binds its PSO before asserting the remapped CBV and sampler heap bases in dispatch user data.

Tested

  • Built d3d12_set_descriptor_heaps_test with MSVC on current main (c50ed94).
  • ctest --test-dir runtime/build -C RelWithDebInfo -R '^d3d12_set_descriptor_heaps$' --output-on-failure — passed.
  • The pre-fix test failed at the recorded-command assertion after record_dispatch rejected the missing PSO.
  • python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/test/d3d12_set_descriptor_heaps_test.cpp — passed.

GPUs tested: NVIDIA GeForce RTX 3070, driver 621.01, Windows 11 IoT Enterprise build 22631.

AI-assisted: yes.

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys, or decryption.
  • No translator change; the translator-rule checklist is not applicable.
**@⁠Joaco9020** on GitHub · 2026-11-26 00:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2153) `Joaco9020:fix/direct-heap-dispatch-test` → `main` · +48 −2 · 2 files · 1 commits · open Claimed in [the coordination issue](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) as `RT-DIRECT-HEAP-DISPATCH-TEST`. ### What and why The direct heap indexing regression check dispatched without binding a compute PSO. The command list correctly rejected the dispatch, so the test had no recorded command to inspect. This adds the existing synthetic compute shader to the test target, builds a small shader library for it, and binds its PSO before asserting the remapped CBV and sampler heap bases in dispatch user data. ### Tested - Built `d3d12_set_descriptor_heaps_test` with MSVC on current `main` (`c50ed94`). - `ctest --test-dir runtime/build -C RelWithDebInfo -R '^d3d12_set_descriptor_heaps$' --output-on-failure` — passed. - The pre-fix test failed at the recorded-command assertion after `record_dispatch` rejected the missing PSO. - `python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/test/d3d12_set_descriptor_heaps_test.cpp` — passed. GPUs tested: NVIDIA GeForce RTX 3070, driver 621.01, Windows 11 IoT Enterprise build 22631. AI-assisted: yes. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys, or decryption. - [x] No translator change; the translator-rule checklist is not applicable.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:20:27 +00:00
Author
Owner

@⁠moffington on GitHub · 2026-11-26 00:51 UTC · original

Verified 13e0d78e vs merge-base 88479ff6 on Linux / Wine (clang-cl 23.1.3 + xwin SDK 10.0.26100, glslangValidator, NVIDIA GeForce RTX 3060, driver 615.78.08) with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.

  • Base (88479ff6): d3d12_set_descriptor_heaps_test.exe fails (exit 1) at d3d12_set_descriptor_heaps_test.cpp:353 (CHECK failed: rt::d3d12::recorded_commands(list.p, cmds) && !cmds.empty()) after record_dispatch rejects the un-bound-PSO dispatch (d3d12_com.cpp:1986).
  • Head (13e0d78e): d3d12_set_descriptor_heaps_test.exe passes (exit 0; 23 single-list cases, 7 bundle parity cases, ClearState/Reset, lifetime pinning, direct-index flags) with the synthetic compute PSO bound and both direct-indexed heap bases recorded.
  • Note: Both base and head emit a pre-existing Wine/device-creation validation message (VUID-vkCreateDevice-ppEnabledExtensionNames-01387: VK_EXT_external_memory_dma_buf without VK_KHR_external_memory_fd); zero PR-introduced validation errors. When glslangValidator is absent at configure time (LEONIDA_TEST_CS_SPV undefined), the direct-heap dispatch assertions in check_tracking_lifetime_and_direct_indexing() are compiled out.

AI-assisted.

**@⁠moffington** on GitHub · 2026-11-26 00:51 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2153#issuecomment-7179187585) Verified `13e0d78e` vs merge-base `88479ff6` on Linux / Wine (`clang-cl 23.1.3` + `xwin` SDK 10.0.26100, `glslangValidator`, NVIDIA GeForce RTX 3060, driver 615.78.08) with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. - **Base (`88479ff6`)**: `d3d12_set_descriptor_heaps_test.exe` fails (exit 1) at `d3d12_set_descriptor_heaps_test.cpp:353` (`CHECK failed: rt::d3d12::recorded_commands(list.p, cmds) && !cmds.empty()`) after `record_dispatch` rejects the un-bound-PSO dispatch (`d3d12_com.cpp:1986`). - **Head (`13e0d78e`)**: `d3d12_set_descriptor_heaps_test.exe` passes (exit 0; 23 single-list cases, 7 bundle parity cases, ClearState/Reset, lifetime pinning, direct-index flags) with the synthetic compute PSO bound and both direct-indexed heap bases recorded. - **Note**: Both base and head emit a pre-existing Wine/device-creation validation message (`VUID-vkCreateDevice-ppEnabledExtensionNames-01387`: `VK_EXT_external_memory_dma_buf` without `VK_KHR_external_memory_fd`); zero PR-introduced validation errors. When `glslangValidator` is absent at configure time (`LEONIDA_TEST_CS_SPV` undefined), the direct-heap dispatch assertions in `check_tracking_lifetime_and_direct_indexing()` are compiled out. AI-assisted.
Author
Owner

@⁠ammonium231 on GitHub · 2026-11-26 08:54 UTC · original

RTX 3090 / 621.40, validation on: d3d12_set_descriptor_heaps fails on current main a73a57e13 (record_dispatch rejects a missing PSO, recorded_commands empty). With this PR merged onto that main: pass, 23 single-list + 7 bundle cases, 0 VUID.

**@⁠ammonium231** on GitHub · 2026-11-26 08:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2153#issuecomment-7187168259) RTX 3090 / 621.40, validation on: d3d12_set_descriptor_heaps fails on current main a73a57e13 (record_dispatch rejects a missing PSO, recorded_commands empty). With this PR merged onto that main: pass, 23 single-list + 7 bundle cases, 0 VUID.
Author
Owner

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

Native Windows 10 Pro 19045, GTX 1050 Ti (Pascal), NVIDIA 582.66, MSVC RelWithDebInfo, 13e0d78eb merged onto main 2d43417d4 (clean).

  • main: d3d12_set_descriptor_heaps fails at line 353: rt::d3d12::recorded_commands(list.p, cmds) && !cmds.empty(). The log shows record_dispatch rejected a call (d3d12_com.cpp:1986): the PSO-less dispatch #2141 added hits the existing no-PSO rejection. It is one of 16 failures in a full ctest of main on this card, and the only one that isn't host-specific.
  • With this PR: passes, plain and with LEONIDA_VK_VALIDATION=1.

The fix binds a real compute PSO built on the directly-indexed root signature, so the user_data assertions now see what replay receives. That is the right fix rather than relaxing the no-PSO rule.

One small thing: without glslangValidator the whole direct-heap block is compiled out, so the test passes without checking it. A std::printf("... skipped: no glslangValidator\n") in the #else branch would make that visible in the log, as other tests do.

AI-assisted (Claude Code).

**@⁠qhukz13** on GitHub · 2026-11-26 19:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2153#issuecomment-7201919602) Native Windows 10 Pro 19045, GTX 1050 Ti (Pascal), NVIDIA 582.66, MSVC RelWithDebInfo, `13e0d78eb` merged onto main `2d43417d4` (clean). - **main:** `d3d12_set_descriptor_heaps` fails at `line 353: rt::d3d12::recorded_commands(list.p, cmds) && !cmds.empty()`. The log shows `record_dispatch rejected a call (d3d12_com.cpp:1986)`: the PSO-less dispatch #2141 added hits the existing no-PSO rejection. It is one of 16 failures in a full `ctest` of main on this card, and the only one that isn't host-specific. - **With this PR:** passes, plain and with `LEONIDA_VK_VALIDATION=1`. The fix binds a real compute PSO built on the directly-indexed root signature, so the `user_data` assertions now see what replay receives. That is the right fix rather than relaxing the no-PSO rule. One small thing: without `glslangValidator` the whole direct-heap block is compiled out, so the test passes without checking it. A `std::printf("... skipped: no glslangValidator\n")` in the `#else` branch would make that visible in the log, as other tests do. 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/2153/head:github-bot/gh-2153'
git switch 'github-bot/gh-2153'

Merge

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