runtime: fix the three compile breaks that stop main from building #243

Closed
Andretuta wants to merge 3 commits from upstream-pr/243 into main
Andretuta commented 2026-11-24 02:51:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:51:54Z.


Carried over from old PR 9978 by icecreammule277-dot in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9978, 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.
icecreammule277-dot: 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 (d083a2cc3) does not compile the runtime (gta6rt). Three independent source-level breaks from recent merges, each fixed with one hunk. With them the target links; without them it fails with C2084, C2338, C3083, C2248, C2665.

1. runtime/shims/d3d12_xs_device.cpp — missing declaration.
Xbox slot 14's console descriptor-heap path (3630610ca) calls rt::d3d12::create_console_descriptor_heap (declared in d3d12_com.h:221, defined in d3d12_vulkan_device.cpp) but this translation unit never sees the declaration. Fixed with a forward declaration, not #include "d3d12_com.h": that header pulls in gfx10_descriptors.h and vulkan_backend.h, and this TU is also compiled by root_sig_test, device_proxy_test and xs_proxy_mock_test, which do not carry the Vulkan include path — including the header breaks those three tests instead (verified: adding the include reintroduces a vulkan/vulkan.h C1083 in those targets).

2. runtime/shims/d3d12_vulkan_device.cpp — the same commit's helper.
create_console_descriptor_heap needs a non-const DeviceState& (Device::state() returns a const reference) and the private Device::identity(). Added a non-const state() overload and used the existing public holder() (which returns identity()). Behaviour-neutral.

3. runtime/shims/acphal.cpp — SHAPE context sizes (ccd36246f).
sizeof(SHAPE_XMA_CONTEXT) is 60 against the asserted 64, and sizeof(SHAPE_PCM_CONTEXT) is 28 against 32. The repo's own ABI test (tests/test_acphal_abi.py) asserts 64/32 are the GDK sizes, so the structs are one trailing dword short: reserved[10] -> reserved[11], reserved[1] -> reserved[2]. Padding only; no named field moves. (The shim never reads a field of either context — it only allocates sizeof(...) zeroed arrays — so only the size matters to it. Where the true GDK puts the byte is still the author's to confirm.)

Verified: cmake --build runtime/build --config RelWithDebInfo --target gta6rt links on d083a2cc3 with these hunks.

Not fixed here (separate, and its author's to rewrite): runtime/test/d3d12_console_descriptor_heap_test.cpp, added by the same 3630610ca, does not compile — it uses a Ref<T> template this tree does not have and calls IID_PPV_ARGS on a void*.

Method: Windows 11 26300, MSVC 19.52, RelWithDebInfo, Vulkan SDK 1.4.363.0. AI-assisted (OpenCode).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465169596 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/243). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:51:54Z. --- > Carried over from **old PR 9978** by `icecreammule277-dot` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9978`, 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. > `icecreammule277-dot`: 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` (`d083a2cc3`) does not compile the runtime (`gta6rt`). Three independent source-level breaks from recent merges, each fixed with one hunk. With them the target links; without them it fails with `C2084`, `C2338`, `C3083`, `C2248`, `C2665`. **1. `runtime/shims/d3d12_xs_device.cpp` — missing declaration.** Xbox slot 14's console descriptor-heap path (`3630610ca`) calls `rt::d3d12::create_console_descriptor_heap` (declared in `d3d12_com.h:221`, defined in `d3d12_vulkan_device.cpp`) but this translation unit never sees the declaration. Fixed with a forward declaration, *not* `#include "d3d12_com.h"`: that header pulls in `gfx10_descriptors.h` and `vulkan_backend.h`, and this TU is also compiled by `root_sig_test`, `device_proxy_test` and `xs_proxy_mock_test`, which do not carry the Vulkan include path — including the header breaks those three tests instead (verified: adding the include reintroduces a `vulkan/vulkan.h` C1083 in those targets). **2. `runtime/shims/d3d12_vulkan_device.cpp` — the same commit's helper.** `create_console_descriptor_heap` needs a non-const `DeviceState&` (`Device::state()` returns a const reference) and the private `Device::identity()`. Added a non-const `state()` overload and used the existing public `holder()` (which returns `identity()`). Behaviour-neutral. **3. `runtime/shims/acphal.cpp` — SHAPE context sizes (`ccd36246f`).** `sizeof(SHAPE_XMA_CONTEXT)` is 60 against the asserted 64, and `sizeof(SHAPE_PCM_CONTEXT)` is 28 against 32. The repo's own ABI test (`tests/test_acphal_abi.py`) asserts 64/32 are the GDK sizes, so the structs are one trailing dword short: `reserved[10] -> reserved[11]`, `reserved[1] -> reserved[2]`. Padding only; no named field moves. (The shim never reads a field of either context — it only allocates `sizeof(...)` zeroed arrays — so only the size matters to it. Where the true GDK puts the byte is still the author's to confirm.) **Verified:** `cmake --build runtime/build --config RelWithDebInfo --target gta6rt` links on `d083a2cc3` with these hunks. **Not fixed here** (separate, and its author's to rewrite): `runtime/test/d3d12_console_descriptor_heap_test.cpp`, added by the same `3630610ca`, does not compile — it uses a `Ref<T>` template this tree does not have and calls `IID_PPV_ARGS` on a `void*`. Method: Windows 11 26300, MSVC 19.52, RelWithDebInfo, Vulkan SDK 1.4.363.0. AI-assisted (OpenCode).
aslan2142 commented 2026-11-24 19:50:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T19:50:07Z.


Thank you for this fix. The diagnosis was right, and current main already has it, so I'm closing this draft as superseded:

  • acphal.cpp: the SHAPE XMA/PCM contexts are 64 and 32 bytes (#2, db761be31, and the XMA context was reworked since then), so both static_asserts hold.
  • Slot 14: the proxy reaches the Vulkan layer through set_console_descriptor_heap_handler, the same way slot 133 does. Every Vulkan Device registers it, and a Device member builds the heap (#2, a7ffc53c1). #4 (37246f11d) takes the console layout only when the trailing size equals NumDescriptors * 32, so PC callers are no longer caught by the stack bytes after their desc.
  • d3d12_console_descriptor_heap_test compiles and passes (operator->, the reference handling of create_device_proxy, the start read through heap_proxy_real_heap).

The Runtime windows job compiles all of these files with MSVC 14.52 again. The remaining slot-14 false positive (a stray 32 after a one-descriptor desc) is handled in #1148. If anything from this branch is still missing, please open a new PR from current main. The old-pr/* branch stays, and #17 lists the carried-over drafts.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142655410 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/243#issuecomment-7142655410). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-24T19:50:07Z. --- Thank you for this fix. The diagnosis was right, and current `main` already has it, so I'm closing this draft as superseded: - `acphal.cpp`: the SHAPE XMA/PCM contexts are 64 and 32 bytes (#2, `db761be31`, and the XMA context was reworked since then), so both `static_assert`s hold. - Slot 14: the proxy reaches the Vulkan layer through `set_console_descriptor_heap_handler`, the same way slot 133 does. Every Vulkan `Device` registers it, and a `Device` member builds the heap (#2, `a7ffc53c1`). #4 (`37246f11d`) takes the console layout only when the trailing size equals `NumDescriptors * 32`, so PC callers are no longer caught by the stack bytes after their desc. - `d3d12_console_descriptor_heap_test` compiles and passes (`operator->`, the reference handling of `create_device_proxy`, the start read through `heap_proxy_real_heap`). The Runtime `windows` job compiles all of these files with MSVC 14.52 again. The remaining slot-14 false positive (a stray `32` after a one-descriptor desc) is handled in #1148. If anything from this branch is still missing, please open a new PR from current `main`. The `old-pr/*` branch stays, and #17 lists the carried-over drafts. AI-assisted (Claude Code, Claude Opus 5.5).

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!243
No description provided.