mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:00:52 +01:00
[PR #403] [MERGED] d3d12_xs: the title's queue slot 18 is the frequency getter, not PC GetDesc (RT-QUEUE18) #454
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#454
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/403
Author: @Mumogg
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:queue-slot18-frequency📝 Commits (9)
bbae96dd3d12_xs: handle ID3D12CommandAllocator slot 9 (SetAllocatorCallbackX) on allocator proxy1bd72a8d3d12_xs: route command queue slot 35 to ExecuteCommandListsdfd62d7docs: the recorded, never-called allocator callback of slot 9 has a row in the Xbox-only table54ed404d3d12_xs: console list slot 139 is Reset, routed to the PC slot 10862890cd3d12_xs: the title's queue slot 18 is the frequency getter, not PC GetDesc94c9e43Merge main into RT-QUEUE35 (#391)b06d096Merge main into RT-ALLOC9 (#395)8643373Merge main into RT-LIST139 (#396)fb2afdcMerge main into RT-QUEUE18 (#403)📊 Changes
6 files changed (+266 additions, -33 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+1 -0)📝
runtime/shims/d3d12_xs_device.cpp(+84 -1)📝
runtime/shims/d3d12_xs_device.h(+18 -9)📝
runtime/test/allocator_proxy_test.cpp(+24 -7)📝
runtime/test/queue_proxy_test.cpp(+59 -13)📝
runtime/test/xs_proxy_mock_test.cpp(+80 -3)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.