test: bind a PSO before direct heap dispatch #2153

Merged
Joaco9020 merged 1 commit from upstream-pr/2153 into main 2026-11-28 08:05:53 +00:00
Joaco9020 commented 2026-11-26 00:11:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Joaco9020 on 2026-11-26T00:11:49Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5501463487 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2153). Originally posted by [Joaco9020](https://github.com/Joaco9020) on 2026-11-26T00:11:49Z. --- Claimed in [the coordination issue](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7178149824) 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.
moffington commented 2026-11-26 00:51:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by moffington on 2026-11-26T00:51:44Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7179187585 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2153#issuecomment-7179187585). Originally posted by [moffington](https://github.com/moffington) on 2026-11-26T00:51:44Z. --- 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.
ammonium231 commented 2026-11-26 08:54:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ammonium231 on 2026-11-26T08:54:29Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7187168259 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2153#issuecomment-7187168259). Originally posted by [ammonium231](https://github.com/ammonium231) on 2026-11-26T08:54:29Z. --- 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.
qhukz13 commented 2026-11-26 19:44:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-26T19:44:56Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7201919602 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2153#issuecomment-7201919602). Originally posted by [qhukz13](https://github.com/qhukz13) on 2026-11-26T19:44:56Z. --- 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).
adrianmjim commented 2026-11-27 21:25:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-27T21:25:00Z.


AMD data point: this diff applied to main cf1c34128 (it applies cleanly). AMD Radeon RX 7900 XT (RDNA3), AMD 32.0.32029.2010, no Resizable BAR, Windows 11 26300, VS 2022 (MSVC 19.44) RelWithDebInfo.

  • main: d3d12_set_descriptor_heaps fails every run at line 353: CHECK failed: rt::d3d12::recorded_commands(list.p, cmds) && !cmds.empty(), and also inside a full ctest -j 6.
  • With this PR:
    • It passes 3 of 3. It reports 23 single-list cases, 7 bundle parity cases, ClearState/Reset, lifetime pinning and the direct-index flags, matched against the native D3D12 device on the same RX 7900 XT.
    • It also passes under LEONIDA_VK_VALIDATION=1, with VK_LAYER_KHRONOS_validation loaded and no VUIDs.

On this card without Resizable BAR the test prints vkAllocateMemory failed (-2): 268435456 bytes, memory type 2 (flags 0x7, heap 2 of 256 MiB), on main and with this PR. It is the device-local host-visible type. The test still passes with it, so it is not what fails at line 353.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7228424142 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2153#issuecomment-7228424142). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-27T21:25:00Z. --- AMD data point: this diff applied to `main` `cf1c34128` (it applies cleanly). AMD Radeon RX 7900 XT (RDNA3), AMD 32.0.32029.2010, no Resizable BAR, Windows 11 26300, VS 2022 (MSVC 19.44) RelWithDebInfo. - **`main`:** `d3d12_set_descriptor_heaps` fails every run at `line 353: CHECK failed: rt::d3d12::recorded_commands(list.p, cmds) && !cmds.empty()`, and also inside a full `ctest -j 6`. - **With this PR:** - It passes 3 of 3. It reports 23 single-list cases, 7 bundle parity cases, ClearState/Reset, lifetime pinning and the direct-index flags, matched against the native D3D12 device on the same RX 7900 XT. - It also passes under `LEONIDA_VK_VALIDATION=1`, with `VK_LAYER_KHRONOS_validation` loaded and no VUIDs. On this card without Resizable BAR the test prints `vkAllocateMemory failed (-2): 268435456 bytes, memory type 2 (flags 0x7, heap 2 of 256 MiB)`, on `main` and with this PR. It is the device-local host-visible type. The test still passes with it, so it is not what fails at line 353.
DadaCap commented 2026-11-28 08:05:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:05:56Z.


Merged into main (merge commit ffbfef54b), approved by DadaCap (maintainer). Thanks!

Checked before merging: d3d12_set_descriptor_heaps fails on main (a Dispatch without a PSO recorded nothing) and passes with this PR. The merge was pinned to the head commit that was tested (13e0d78eb).

AI-assisted (Claude Code), posted for DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236361426 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2153#issuecomment-7236361426). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:05:56Z. --- Merged into `main` (merge commit ffbfef54b), approved by DadaCap (maintainer). Thanks! Checked before merging: `d3d12_set_descriptor_heaps` fails on main (a Dispatch without a PSO recorded nothing) and passes with this PR. The merge was pinned to the head commit that was tested (13e0d78eb). _AI-assisted (Claude Code), posted for DadaCap._
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!2153
No description provided.