d3d12_xs: command-allocator slot 9 (SetAllocatorCallbackX) is recorded, again (RT-ALLOC9) #395

Manually merged
github merged 5 commits from gh-pr/395/head into gh-pr/395/base 2026-11-26 08:57:41 +00:00
Owner

@⁠Mumogg on GitHub · 2026-11-24 04:28 UTC · original
Mumogg:allocator-slot9-callback → main · +220 −32 · 6 files · 5 commits · merged 2026-11-24 23:59 UTC

Claimed in #14 as RT-ALLOC9. Depends on: #349, #350, #356, #362, #369, #375, #377, #383, #385, #391 (their commits come first here; this pull request is the last commit). The code itself only touches the allocator proxy.

What and why

The retail title calls command-allocator slot 9 with a function pointer and a context: the console's SetAllocatorCallbackX. It is past the PC allocator's 9 slots, so main refuses it with E_NOTIMPL.

Commit e29e98998 by DevilNine (-x, authorship kept; an ancestor of main whose content is not in the tree) records the callback and its context on the proxy and answers S_OK, leaving slots 10 and up refused. The layer manages its command buffers itself and never calls the callback. The conflict was one neighbour (the queue's slot 35 branch of #391); both sides are kept.

Measured

Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on main ece4ba5b3, with #142, #219, #328 and #387 applied on top for the boot runs (they are not in this branch).

--run Trace line for the call
without this XboxID3D12CommandAllocator::Slot9 unsupported
with this XboxID3D12CommandAllocator::SetAllocatorCallbackX called, and one [rt] line with the recorded words

This does not move the stop. The run ends as with #391 alone: after the first ExecuteCommandLists ok the title faults writing through a null pointer. I thought the refused slot 9 might be the cause and it is not. What differs from a run that goes on is in the console command-list proxy; I posted that as a finding in #14.

So this pull request removes one refused console call from the path and nothing more. It is small and tested, but it can wait for the list work if you prefer to take them together.

Tests under Wine: xs_proxy_mock_test passes; allocator_proxy_test exits 0.

Not built with MSVC and not run on Windows.

AI-assisted (Claude Code); built and run on the machine above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt

**@⁠Mumogg** on GitHub · 2026-11-24 04:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/395) `Mumogg:allocator-slot9-callback` → `main` · +220 −32 · 6 files · 5 commits · merged 2026-11-24 23:59 UTC Claimed in #14 as `RT-ALLOC9`. Depends on: #349, #350, #356, #362, #369, #375, #377, #383, #385, #391 (their commits come first here; this pull request is the last commit). The code itself only touches the allocator proxy. ### What and why The retail title calls command-allocator slot 9 with a function pointer and a context: the console's `SetAllocatorCallbackX`. It is past the PC allocator's 9 slots, so `main` refuses it with `E_NOTIMPL`. Commit `e29e98998` by DevilNine (`-x`, authorship kept; an ancestor of `main` whose content is not in the tree) records the callback and its context on the proxy and answers `S_OK`, leaving slots 10 and up refused. The layer manages its command buffers itself and never calls the callback. The conflict was one neighbour (the queue's slot 35 branch of #391); both sides are kept. ### Measured Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on `main` `ece4ba5b3`, with #142, #219, #328 and #387 applied on top for the boot runs (they are not in this branch). | `--run` | Trace line for the call | |---|---| | without this | `XboxID3D12CommandAllocator::Slot9 unsupported` | | with this | `XboxID3D12CommandAllocator::SetAllocatorCallbackX called`, and one `[rt]` line with the recorded words | **This does not move the stop.** The run ends as with #391 alone: after the first `ExecuteCommandLists ok` the title faults writing through a null pointer. I thought the refused slot 9 might be the cause and it is not. What differs from a run that goes on is in the console command-list proxy; I posted that as a finding in #14. So this pull request removes one refused console call from the path and nothing more. It is small and tested, but it can wait for the list work if you prefer to take them together. Tests under Wine: `xs_proxy_mock_test` passes; `allocator_proxy_test` exits 0. Not built with MSVC and not run on Windows. AI-assisted (Claude Code); built and run on the machine above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
(cherry picked from commit e29e989980)
(cherry picked from commit e925b63455)

Adapted to main by Mumogg: main has command-list proxies, so the shared execute function replaces them by their
real lists in a copy of the array (UnwrappedArray), for the console slot 35 as for the PC slot 10, whose test
failed otherwise. The slot 35 mock case passes two mock lists instead of two numbers and checks that they arrive
and that the caller's array is not written.
Asked for in review on #377.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Two files conflicted; in each, both sides had added something at the same
place and both are kept.

runtime/shims/d3d12_xs_device.cpp: this branch's
queue_execute_command_lists() next to main's XboxQueueSlotRoutes and
xbox_queue_slot_routes() (the PresentX, SuspendX and ResumeX routes).

runtime/test/xs_proxy_mock_test.cpp: main() runs check_xbox_queue_slots()
and then check_presentation_wiring().

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Merged on top of the merge made for #391 (main 507029d1e plus RT-QUEUE35).

One conflict, in docs/d3d12_vulkan.md: both sides added a row at the same
place of the Xbox-only table. Both are kept: this branch's
"Command-allocator slot 9" row, then main's "Device slot 81, queue
PresentX/SuspendX/ResumeX" row. The code and the tests merged without
conflicts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:57:39 +00:00
github-bot referenced this pull request from a commit 2026-11-26 08:57:40 +00:00
github manually merged commit b06d096ad0 into gh-pr/395/base 2026-11-26 08:57:41 +00:00
github-bot referenced this pull request from a commit 2026-11-26 08:57:46 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 23:59 UTC · original

Merged. Mumogg is still away and this is the next rung on main's boot path, so I brought the branch up to date as with the rungs before it: one merge commit on top of dfd62d7e2 (b06d096ad), merging main with #391 in it. Mumogg's two commits (DevilNine's change and the docs row) are untouched and nothing was force-pushed.

What it does: command-allocator slot 9, named SetAllocatorCallbackX after the commit that added it, now stores the title's callback and context on the allocator proxy, logs once and answers S_OK; before, it was refused as past the PC allocator table. Slots 10 and up are still refused. This restores DevilNine's e29e98998, which is in main's history but was no longer in its tree.

It is a stand-in: nothing calls the callback, and whether the title needs it called is open. The new row in docs/d3d12_vulkan.md says so.

Conflict: one, in docs/d3d12_vulkan.md: both sides added a row at the same place of the Xbox-only table. Both are kept (allocator slot 9, then slot 81 / PresentX). The code and the tests merged without conflicts; the merge adds exactly this PR's five files to main.

Holds and requests: none on this PR.

Tests (clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU):

  • Full Windows suite under Wine, the branch against main with #391: no test changed state on either device (259 pass and 15 fail on llvmpipe, 255 and 21 on the iGPU, on both sides).
  • allocator_proxy, xs_proxy_mock with its six variants and device_proxy pass on both devices.
  • The 12 test_docs_* files and check_no_game_data.py on the changed files are clean.
  • Not run here: MSVC, native Windows, and the game itself. By Mumogg's run the stop does not move with this rung: the title still faults through a null pointer after its first ExecuteCommandLists.

For later: the header comment's "Slot 9 wraps only an allocator…" means device slot 9 and should say so, now that allocator slot 9 is described just above it.

#396 (console list slot 139) is the next rung.

AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 23:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/395#issuecomment-7148014970) Merged. Mumogg is still away and this is the next rung on `main`'s boot path, so I brought the branch up to date as with the rungs before it: one merge commit on top of `dfd62d7e2` (`b06d096ad`), merging `main` with #391 in it. Mumogg's two commits (DevilNine's change and the docs row) are untouched and nothing was force-pushed. **What it does:** command-allocator slot 9, named `SetAllocatorCallbackX` after the commit that added it, now stores the title's callback and context on the allocator proxy, logs once and answers `S_OK`; before, it was refused as past the PC allocator table. Slots 10 and up are still refused. This restores DevilNine's `e29e98998`, which is in `main`'s history but was no longer in its tree. **It is a stand-in:** nothing calls the callback, and whether the title needs it called is open. The new row in `docs/d3d12_vulkan.md` says so. **Conflict:** one, in `docs/d3d12_vulkan.md`: both sides added a row at the same place of the Xbox-only table. Both are kept (allocator slot 9, then slot 81 / `PresentX`). The code and the tests merged without conflicts; the merge adds exactly this PR's five files to `main`. **Holds and requests:** none on this PR. **Tests** (clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU): - Full Windows suite under Wine, the branch against `main` with #391: no test changed state on either device (259 pass and 15 fail on llvmpipe, 255 and 21 on the iGPU, on both sides). - `allocator_proxy`, `xs_proxy_mock` with its six variants and `device_proxy` pass on both devices. - The 12 `test_docs_*` files and `check_no_game_data.py` on the changed files are clean. - Not run here: MSVC, native Windows, and the game itself. By Mumogg's run the stop does not move with this rung: the title still faults through a null pointer after its first `ExecuteCommandLists`. **For later:** the header comment's "Slot 9 wraps only an allocator…" means device slot 9 and should say so, now that allocator slot 9 is described just above it. #396 (console list slot 139) is the next rung. AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.