Select the slot 14 descriptor layout when creating the device proxy #216

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

@⁠Andretuta on GitHub · 2026-11-24 02:46 UTC · original
ubiquitarianism:old-pr/9951 → main · +96 −91 · 7 files · 1 commits · draft

Carried over from old PR 9951 by tcurtsinger in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9951, 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.
tcurtsinger: 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):

Claimed in the coordination issue as the Windows slot 14 build fix.

Depends on: #9809, #9857, #9873 (overlap in the slot 14 implementation). This branch builds the D3D12 targets independently. The full-runtime integration check below also uses the audio-only commit from #9809.

What and why

The Xbox and PC versions of device slot 14 share a 16-byte descriptor prefix. The Xbox version also supplies a heap address and size. Reading those words on a PC call can turn adjacent stack data into an apparently valid heap address. This affected the existing descriptor, present and half-float tests. Measured Xbox layout · Windows runtime report

Select the layout when constructing each proxy. The Xbox Vulkan entry point supplies the console allocator. PC-layout proxies call the underlying device with the ordinary descriptor. Both heap paths now share the Vulkan device's allocation and COM ownership logic, and the standalone proxy can link without the Vulkan library.

The regression test passes identical bytes, including a plausible address and size, to both kinds of proxy. Only the Xbox proxy returns that address from heap slots 9 and 10. It also checks that an Xbox descriptor with a zero address gets ordinary storage. The two synthetic Xbox callers now pass the measured layout.

Tested

  • Windows x64, MSVC 19.44, Ninja RelWithDebInfo, GeForce RTX 4080, NVIDIA driver 621.01. Reproduced the original MSVC errors on 2d53a8055, then built the D3D12 COM library, standalone proxy targets and guest fixtures. All 16 focused CTests passed, including d3d12_console_descriptor_heap, d3d12_descriptor, d3d12_translated_draw, both present paths and the standalone mocks.
  • The full runtime built with just the separate audio correction 8403c4c2b from #9809 applied on top. On the PR alone two existing acphal.cpp size assertions block that build. The default CTest run gave 256 passes, 12 skips, one disabled and five failures. All five also failed in a control build of 2d53a8055 with the upstream slot 14 change (3630610ca) reverted: root_sig, d3d12_com, d3d12_vulkan_device, d3d12_execute_indirect_validation and d3d12_depth_resolve.
  • Enabled LEONIDA_TEST_GUEST_DRAW separately and ran the synthetic guests through gta6rt --run. Both run_tiny_frame cases passed the clear/readback check. d3d12_translated_draw_guest passed its pixel comparison.
  • The translator suite ran 6,046 tests across 459 files. The same two files, test_exec_computed and test_image_atomics_guard, failed when rerun on the clean base.

AI-assisted: yes, with OpenAI Codex.

Checklist

  • All seven changed files are C++ source or headers. scripts/check_no_game_data.py passed on them.
**@⁠Andretuta** on GitHub · 2026-11-24 02:46 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/216) `ubiquitarianism:old-pr/9951` → `main` · +96 −91 · 7 files · 1 commits · draft > Carried over from **old PR 9951** by `tcurtsinger` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9951`, 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. > `tcurtsinger`: 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): Claimed in the coordination issue as [the Windows slot 14 build fix](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116539991). Depends on: `#9809`, `#9857`, `#9873` (overlap in the slot 14 implementation). This branch builds the D3D12 targets independently. The full-runtime integration check below also uses the audio-only commit from `#9809`. ### What and why The Xbox and PC versions of device slot 14 share a 16-byte descriptor prefix. The Xbox version also supplies a heap address and size. Reading those words on a PC call can turn adjacent stack data into an apparently valid heap address. This affected the existing descriptor, present and half-float tests. [Measured Xbox layout](https://github.com/ProjectLeonida/Leonida/issues/313#issuecomment-7107265058) · [Windows runtime report](https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116662920) Select the layout when constructing each proxy. The Xbox Vulkan entry point supplies the console allocator. PC-layout proxies call the underlying device with the ordinary descriptor. Both heap paths now share the Vulkan device's allocation and COM ownership logic, and the standalone proxy can link without the Vulkan library. The regression test passes identical bytes, including a plausible address and size, to both kinds of proxy. Only the Xbox proxy returns that address from heap slots 9 and 10. It also checks that an Xbox descriptor with a zero address gets ordinary storage. The two synthetic Xbox callers now pass the measured layout. ### Tested - Windows x64, MSVC 19.44, Ninja `RelWithDebInfo`, GeForce RTX 4080, NVIDIA driver 621.01. Reproduced the original MSVC errors on `2d53a8055`, then built the D3D12 COM library, standalone proxy targets and guest fixtures. All 16 focused CTests passed, including `d3d12_console_descriptor_heap`, `d3d12_descriptor`, `d3d12_translated_draw`, both present paths and the standalone mocks. - The full runtime built with just the separate audio correction `8403c4c2b` from `#9809` applied on top. On the PR alone two existing `acphal.cpp` size assertions block that build. The default CTest run gave 256 passes, 12 skips, one disabled and five failures. All five also failed in a control build of `2d53a8055` with the upstream slot 14 change (`3630610ca`) reverted: `root_sig`, `d3d12_com`, `d3d12_vulkan_device`, `d3d12_execute_indirect_validation` and `d3d12_depth_resolve`. - Enabled `LEONIDA_TEST_GUEST_DRAW` separately and ran the synthetic guests through `gta6rt --run`. Both `run_tiny_frame` cases passed the clear/readback check. `d3d12_translated_draw_guest` passed its pixel comparison. - The translator suite ran 6,046 tests across 459 files. The same two files, `test_exec_computed` and `test_image_atomics_guard`, failed when rerun on the clean base. AI-assisted: yes, with OpenAI Codex. ### Checklist - [x] All seven changed files are C++ source or headers. `scripts/check_no_game_data.py` passed on them.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:49:08 +00:00
This pull request has changes conflicting with the target branch.
  • runtime/shims/d3d12_vulkan_device.cpp
  • runtime/shims/d3d12_xs.cpp
  • runtime/shims/d3d12_xs_device.cpp
  • runtime/shims/d3d12_xs_device.h
  • runtime/test/d3d12_console_descriptor_heap_test.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/216/head:github-bot/gh-216'
git switch 'github-bot/gh-216'

Merge

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