[PR #208] [CLOSED] runtime: build on MSVC again after the 2026-11-23 merge round, and one root_sig checksum check #260

Closed
opened 2026-11-26 20:17:18 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/208
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/9941


📝 Commits (2)

  • 3793c9b runtime: build on MSVC again after the 2026-11-23 merge round
  • 967f200 d3d12_xs_rootsig: one checksum check, the one that keeps an all-zero checksum

📊 Changes

6 files changed (+47 additions, -20 deletions)

View changed files

📝 runtime/shims/acphal.cpp (+7 -2)
📝 runtime/shims/d3d12_vulkan_device.cpp (+14 -7)
📝 runtime/shims/d3d12_xs_device.cpp (+10 -4)
📝 runtime/shims/d3d12_xs_device.h (+12 -0)
📝 runtime/shims/d3d12_xs_rootsig.cpp (+0 -6)
📝 runtime/test/d3d12_console_descriptor_heap_test.cpp (+4 -1)

📄 Description

Carried over from old PR 9941 by carlos-seiffert in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9941, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
This branch conflicts with the current main and needs a rebase.
carlos-seiffert: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

main at 0b3caaee, after the 2026-11-23 merge round, does not compile with MSVC. gta6rt_d3d12_com, acphal and every test that links them fail. This PR fixes the build, and with it the whole ctest suite runs again. A second commit fixes root_sig, which a merge between two PRs broke.

What was broken

error cause
d3d12_xs_device.cpp(1606): create_console_descriptor_heap is not a member of rt 3630610c calls it without the declaration. Including d3d12_com.h there doesn't work, because d3d12_xs_device.cpp is built into a dozen tests without the Vulkan layer.
d3d12_vulkan_device.cpp(9997/9998): C2665 / C2248 create_console_descriptor_heap passes the const state() to DescriptorHeap and calls the private identity()
acphal.cpp(146/167): static_assert ccd36246's SHAPE_XMA_CONTEXT and SHAPE_PCM_CONTEXT are 60 and 28 bytes with every compiler: the XMA context's third dword holds 24 bits, and a 26-bit field cannot straddle a dword
d3d12_console_descriptor_heap_test.cpp uses Ref's missing operator->, and IID_PPV_ARGS on a void**

The change

  • Slot 14 now calls a handler that the Vulkan layer can register (set_console_descriptor_heap_handler), the way slot 133 already does with set_placed_at_va_handler. The proxy no longer depends on the Vulkan layer.
  • create_console_descriptor_heap forwards to a new Device::create_console_heap member.
  • acphal: the padding now gives the GDK sizes, 64 and 32. Only sizeof is used, as the stride of the context arrays; the bit positions inside the first dwords are not verified.
  • The console heap test gets operator-> and passes the IID explicitly.

Why the handler is not registered by default

I first registered it in Device's constructor. That crashed or failed 8 ctest programs: d3d12_descriptor, d3d12_f16_halves, d3d12_translated_draw, d3d12_m2_textured, d3d12_m2_formats, d3d12_m3_frame, d3d12_m3_first_pass, d3d12_m4_compute, d3d12_buffer_uav.

The cause: slot 14 reads the 16 bytes that follow a 16-byte PC D3D12_DESCRIPTOR_HEAP_DESC. For a PC caller those bytes are whatever is next in memory, usually non-zero, so the heap is created at a garbage address.

So nothing registers it here; the console heap test registers it itself. How slot 14 should tell the console's 32-byte description from a PC one is left to the author of #9576.

Tested

Windows 11 (10.0.26300), MSVC 14.44 (VS 2022 Build Tools 17.14.45), Windows SDK 10.0.26100, Visual Studio 17 2022 generator, RelWithDebInfo, on an NVIDIA RTX 2060 (621.24).

  • Build: with this branch the whole runtime builds, warnings only. main fails with the errors above.
  • ctest: 268 of 273 pass, plus 12 skipped or disabled for missing optional inputs. The 5 failures:
    • On main before the merge round (5d74c272) too: d3d12_vulkan_device (slot 78; #8496 / #9175) and d3d12_depth_resolve.
    • d3d12_execute_indirect_validation: the 5 parity cases #9002 changed. Here WARP and the RTX 2060 both accept them (layer=0 warp=1 hw=1 expected=0; d3d12.dll/D3D12Core.dll 10.0.26100.10068, Windows 26300.10075). That is the same as the RTX 5060 / Arc reports on #9002 with 10.0.26100.9818, so the host answer depends on the D3D12 runtime.
    • d3d12_com (line 345, Close() == E_INVALIDARG after a depth clear of 2.0). The test is unchanged in the round; I'm bisecting the merge that changed it.
    • d3d12_console_descriptor_heap, #9576's own test, which never ran. It passes its direct checks, then calls GetCPUDescriptorHandleForHeapStart through the Xbox heap proxy with the PC calling convention. It gets a garbage handle (got 0x26a47b718b0 want 0x556677880000) and crashes after that. That needs its author.

The root_sig commit

#9492 (c297bb57) and #8959 (b95925cb) each added an incoming-checksum check to the RTS0 rewrite, and the merge kept both:

  • #9492's check runs first and refuses any mismatching checksum, including an all-zero one.
  • #8959's check accepts an all-zero checksum, as the host d3d12.dll does.

So two of #8959's cases fail. root_sig passes right before #8959's merge (be4a51f5) and on #8959's own branch, and fails right after the merge (1e029d6d). Keeping only #8959's check makes it pass in full: #9492's corrupted-blob cases still pass, because #8959's check also refuses any other mismatching checksum.

AI-assisted (Claude Code); no game files.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/208 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9941` --- ### 📝 Commits (2) - [`3793c9b`](https://github.com/ubiquitarianism/leonida/commit/3793c9bcb0e33336d1290ec5918161748b8cf091) runtime: build on MSVC again after the 2026-11-23 merge round - [`967f200`](https://github.com/ubiquitarianism/leonida/commit/967f20036dbdd8bfb50f213ca26e034f3e728e41) d3d12_xs_rootsig: one checksum check, the one that keeps an all-zero checksum ### 📊 Changes **6 files changed** (+47 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/acphal.cpp` (+7 -2) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+14 -7) 📝 `runtime/shims/d3d12_xs_device.cpp` (+10 -4) 📝 `runtime/shims/d3d12_xs_device.h` (+12 -0) 📝 `runtime/shims/d3d12_xs_rootsig.cpp` (+0 -6) 📝 `runtime/test/d3d12_console_descriptor_heap_test.cpp` (+4 -1) </details> ### 📄 Description > Carried over from **old PR 9941** by `carlos-seiffert` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9941`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > This branch conflicts with the current `main` and needs a rebase. > `carlos-seiffert`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): `main` at `0b3caaee`, after the 2026-11-23 merge round, does not compile with MSVC. `gta6rt_d3d12_com`, `acphal` and every test that links them fail. This PR fixes the build, and with it the whole ctest suite runs again. A second commit fixes `root_sig`, which a merge between two PRs broke. ### What was broken | error | cause | |---|---| | `d3d12_xs_device.cpp(1606)`: `create_console_descriptor_heap` is not a member of `rt` | 3630610c calls it without the declaration. Including `d3d12_com.h` there doesn't work, because `d3d12_xs_device.cpp` is built into a dozen tests without the Vulkan layer. | | `d3d12_vulkan_device.cpp(9997/9998)`: C2665 / C2248 | `create_console_descriptor_heap` passes the `const` `state()` to `DescriptorHeap` and calls the private `identity()` | | `acphal.cpp(146/167)`: static_assert | ccd36246's `SHAPE_XMA_CONTEXT` and `SHAPE_PCM_CONTEXT` are 60 and 28 bytes with every compiler: the XMA context's third dword holds 24 bits, and a 26-bit field cannot straddle a dword | | `d3d12_console_descriptor_heap_test.cpp` | uses `Ref`'s missing `operator->`, and `IID_PPV_ARGS` on a `void**` | ### The change - **Slot 14** now calls a handler that the Vulkan layer can register (`set_console_descriptor_heap_handler`), the way slot 133 already does with `set_placed_at_va_handler`. The proxy no longer depends on the Vulkan layer. - **`create_console_descriptor_heap`** forwards to a new `Device::create_console_heap` member. - **`acphal`**: the padding now gives the GDK sizes, 64 and 32. Only `sizeof` is used, as the stride of the context arrays; the bit positions inside the first dwords are not verified. - **The console heap test** gets `operator->` and passes the IID explicitly. ### Why the handler is not registered by default I first registered it in `Device`'s constructor. That crashed or failed **8 ctest programs**: `d3d12_descriptor`, `d3d12_f16_halves`, `d3d12_translated_draw`, `d3d12_m2_textured`, `d3d12_m2_formats`, `d3d12_m3_frame`, `d3d12_m3_first_pass`, `d3d12_m4_compute`, `d3d12_buffer_uav`. The cause: slot 14 reads the 16 bytes that follow a 16-byte PC `D3D12_DESCRIPTOR_HEAP_DESC`. For a PC caller those bytes are whatever is next in memory, usually non-zero, so the heap is created at a garbage address. So nothing registers it here; the console heap test registers it itself. How slot 14 should tell the console's 32-byte description from a PC one is left to the author of `#9576`. ### Tested Windows 11 (10.0.26300), MSVC 14.44 (VS 2022 Build Tools 17.14.45), Windows SDK 10.0.26100, Visual Studio 17 2022 generator, RelWithDebInfo, on an NVIDIA RTX 2060 (621.24). - **Build:** with this branch the whole runtime builds, warnings only. `main` fails with the errors above. - **`ctest`:** 268 of 273 pass, plus 12 skipped or disabled for missing optional inputs. The 5 failures: - On `main` before the merge round (`5d74c272`) too: `d3d12_vulkan_device` (slot 78; `#8496` / `#9175`) and `d3d12_depth_resolve`. - `d3d12_execute_indirect_validation`: the 5 parity cases `#9002` changed. Here WARP and the RTX 2060 both accept them (`layer=0 warp=1 hw=1 expected=0`; `d3d12.dll`/`D3D12Core.dll` 10.0.26100.10068, Windows 26300.10075). That is the same as the RTX 5060 / Arc reports on `#9002` with 10.0.26100.9818, so the host answer depends on the D3D12 runtime. - `d3d12_com` (line 345, `Close() == E_INVALIDARG` after a depth clear of 2.0). The test is unchanged in the round; I'm bisecting the merge that changed it. - `d3d12_console_descriptor_heap`, `#9576`'s own test, which never ran. It passes its direct checks, then calls `GetCPUDescriptorHandleForHeapStart` through the Xbox heap proxy with the PC calling convention. It gets a garbage handle (`got 0x26a47b718b0 want 0x556677880000`) and crashes after that. That needs its author. ### The `root_sig` commit `#9492` (`c297bb57`) and `#8959` (`b95925cb`) each added an incoming-checksum check to the RTS0 rewrite, and the merge kept both: - `#9492`'s check runs first and refuses any mismatching checksum, including an all-zero one. - `#8959`'s check accepts an all-zero checksum, as the host `d3d12.dll` does. So two of `#8959`'s cases fail. `root_sig` passes right before `#8959`'s merge (`be4a51f5`) and on `#8959`'s own branch, and fails right after the merge (`1e029d6d`). Keeping only `#8959`'s check makes it pass in full: `#9492`'s corrupted-blob cases still pass, because `#8959`'s check also refuses any other mismatching checksum. AI-assisted (Claude Code); no game files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:18 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#260
No description provided.