Skip to content

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

Merged
aslan2142 merged 5 commits into
ProjectLeonida:mainfrom
Mumogg:allocator-slot9-callback
Nov 24, 2026
Merged

aslan2142 merged 5 commits into
ProjectLeonida:mainfrom
Mumogg:allocator-slot9-callback

Conversation

@Mumogg

@Mumogg Mumogg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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
Mumogg force-pushed the allocator-slot9-callback branch from 339f43f to 6d5b2d4 Compare November 24, 2026 04:37
DevilNine and others added 3 commits November 24, 2026 03:52
(cherry picked from commit e925b63)

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.
…ow in the Xbox-only table

Asked for in review on ProjectLeonida#377.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
@Mumogg
Mumogg force-pushed the allocator-slot9-callback branch from 6d5b2d4 to dfd62d7 Compare November 24, 2026 09:54
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 24, 2026
aslan2142 and others added 2 commits November 24, 2026 18:41
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 <noreply@anthropic.com>
Merged on top of the merge made for ProjectLeonida#391 (main 507029d 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 <noreply@anthropic.com>
@aslan2142
aslan2142 merged commit 9c5e706 into ProjectLeonida:main Nov 24, 2026
4 of 5 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator

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 d3d12_xs: command-queue slot 35 is the console's ExecuteCommandLists (RT-QUEUE35) #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 added a commit that referenced this pull request Nov 25, 2026
Merged on top of the merge made for #395 (main 507029d plus RT-QUEUE35
and RT-ALLOC9). No conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants