Repository navigation
d3d12_xs: the title's queue slot 18 is the frequency getter, not PC GetDesc (RT-QUEUE18) - #403
Conversation
…stack Contains ProjectLeonida#375 ProjectLeonida#377 ProjectLeonida#383 ProjectLeonida#385 ProjectLeonida#391 ProjectLeonida#395 ProjectLeonida#396 ProjectLeonida#403 ProjectLeonida#414 ProjectLeonida#416 ProjectLeonida#427 ProjectLeonida#430 ProjectLeonida#432. # Conflicts: # runtime/shims/d3d12_com.cpp # runtime/shims/d3d12_vulkan_device.cpp # runtime/src/command_list.h
…) on allocator proxy (cherry picked from commit e29e989)
(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
The retail title resets its command lists through list slot 139, with (allocator proxy, pipeline state). main's slot map had no entry for it, so the call was recorded and dropped and the list stayed closed. The map sends it to the PC slot 10, and the unwrap keys on the PC slot, so console slot 10 and console slot 139 both hand the real list its real allocator (and a wrapped pipeline state the same way) and re-pin the inline cursor. The mapping and the unwrap rule are those of ef9d075 (Nolan Cotter; measured by Pipodi), written again for main's list proxy, where that commit does not apply. xs_proxy_mock_test checks the map entry and a slot 139 call. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
…etDesc Queue slot 18 is ID3D12CommandQueue::GetDesc on the PC: a struct return that writes a 16-byte description through the hidden pointer. The retail title calls slot 18 with one pointer to 8 bytes, the shape of GetTimestampFrequency(UINT64*), which the console queue has there (two methods are inserted at 14/15, so the PC slots 16 to 18 sit two later). Forwarded as GetDesc, the call wrote a description over the title's 8 bytes and what follows them; the title then went wrong a little later, after its first submission. The title's call (set_console_caller, as device slots 61 and 74) now goes to the PC slot 16. A host caller, and every caller when no classifier is installed, keeps the PC GetDesc. The reading of slot 18 is that of the console queue work in old PR 2490 (Nolan Cotter), which answers an undetected slot 18 as the frequency getter because it is the only reading that cannot overrun its argument. That work's layout detection does not apply to main's queue proxy; this is the one rule the boot needs, written for it. xs_proxy_mock_test: the guest call reaches the mock queue's slot 16 with its pointer and leaves the words around it; a host call, with a classifier and with none, reaches slot 18. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
e7044cb to
862890c
Compare
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>
Merged on top of the merge made for ProjectLeonida#395 (main 507029d plus RT-QUEUE35 and RT-ALLOC9). No conflicts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merged on top of the merge made for ProjectLeonida#396 (main 507029d plus RT-QUEUE35, RT-ALLOC9 and RT-LIST139). No conflicts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Merged. Mumogg is still away and this is the next rung on What it does: queue slot 18 is the frequency getter for the title's calls. A caller in a guest-mapped image goes to the PC slot 16 ( How it is known: the mapping agrees with the console queue table Kokonotcu posted in #14 (#14 (comment)): 16 Holds and requests: none on this PR. Tests (clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU):
For later:
Next: #414 ( AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5). |
Claimed in #14 as
RT-QUEUE18. Depends on: the stack up to #396 (their commits come first here; this pull request is the last commit). The change itself is in the queue proxy and its test.What and why
This is the cause of the fault I could not explain in #391, #395 and #396.
Command-queue slot 18 is
ID3D12CommandQueue::GetDescon the PC: a struct return that writes a 16-byteD3D12_COMMAND_QUEUE_DESCthrough its hidden pointer. The retail title calls queue slot 18 with one pointer to 8 bytes. That is the shape ofGetTimestampFrequency(UINT64*), which the console queue has at that slot: two methods are inserted at 14 and 15, so the PC slots 16 to 18 sit two later.mainforwarded the call asGetDesc, which wrote a description over the title's 8 bytes and the 8 after them.How I found it: the normalized D3D12 traces of this path and of the integration branch (#321) were the same up to that point except for one extra line here,
ID3D12CommandQueue::GetDesc calledright afterXboxID3D12CommandQueue::GetDesc called.The change: the title's call goes to the PC slot 16. "The title's call" is decided by the caller classifier device slots 61 and 74 use (
set_console_caller), so a host caller, and every caller when no classifier is installed, keeps the PCGetDesc.Written by me, not cherry-picked. The reading of slot 18 comes from the console queue work of old PR 2490 (Nolan Cotter), which answers an undetected slot 18 as the frequency getter because it is the only reading that cannot overrun its argument. That work detects the queue layout at run time and does not apply to
main's queue proxy; this is the one rule the boot needs. Slots 19 and 20 are left as they are: I have not seen the title call them.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
mainece4ba5b3, with #142, #219, #328 and #387 applied on top for the boot runs (they are not in this branch).--runExecuteCommandLists okint3on another thread, after command-queue slot 32 is refusedWhat the fault was hiding: after the first submission the title now records on its list (
Barrier,ClearRenderTargetView,Barrier), submits again, creates six samplers and five placed resources with their views, and calls queue slot 32, which isPresentX. That is the first present call on this path. It is refused as past the PC queue table, and oneID3D12GraphicsCommandList::Closefails along the way; those are the next two things to look at.That the overrun is what broke the title is an inference from the forwarded call's shape; what is measured is that the fault is gone with this change and nothing else.
Tests under Wine:
xs_proxy_mock_testpasses with the new case (the guest call reaches the mock queue's slot 16 with its pointer and leaves the words around it alone; a host call, with a classifier and with none, reaches slot 18).queue_proxy_testpasses on the Vulkan backend.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