d3d12_xs: device slot 26 takes the console's struct-return form, again (RT-SLOT26) #349
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!349
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/349/head"
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?
@Mumogg on GitHub · 2026-11-24 03:46 UTC · original
Mumogg:slot26-struct-return→main· +133 −5 · 5 files · 1 commits · merged 2026-11-24 04:31 UTCClaimed in #14 as
RT-SLOT26. Clears the stop after #127 and #131.What and why
The retail executable calls
GetCustomHeapProperties(device slot 26) with the buffer for the returned struct in RCX and the device in RDX.main's generic forwarder takes RCX for the proxy, reads a vtable out of the title's stack buffer and faults: the host access violation right afterD3D12XboxCreateDevicethat I measured under Wine and that was confirmed on native Windows in #131.This is commit
86b8e04e4by Senne Cools (-x, authorship kept). It is an ancestor ofmainwhose content is not in the tree. The cherry-pick conflicted with whatmainhas gained around it since; I kept both sides everywhere:d3d12_xs_device.cpp: the slot 26 thunk next to slot 133's, and 26 added todevice_slot_overriddenwith the Xbox route slots.xs_proxy_mock_test.cpp: the slot 26 case next tocheck_xbox_slotsandcheck_console_command_list.docs/d3d12_vulkan.md:main's UMA paragraph, followed by the commit's sentences about the call shape.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.main--runint3afterCreateCommandQueueis refusedThe next stop is device slot 48: it is routed to
CreateCommandQueueX, and the layer refuses the queue (type, priority, flags or node mask, type 2). That is stop 8 ofdocs/retail_boot_chain.md, and I will look at it next.xs_proxy_mock_testunder Wine: passes, including the new case (buffer in RCX and device in RDX reaches the PC method and writes only the struct; the PC form is forwarded unchanged).device_proxy_testgets a case too, but that test stops atD3D12XboxCreateDevice returns a deviceunder Wine here, onmainas well, so I could not run it.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
@BadgersMC on GitHub · 2026-11-24 04:01 UTC · original
Native Windows validation for
c4954581ae27e9db5baabaea091302ed54eb96eaas included in #350 at9e6f8ae1332aed8efb5b2ed78a4780340c29fc40. Windows 11 Home build 26100, MSVC 19.44.35228, Windows SDK 10.0.26100,RelWithDebInfo.The slot 26 regression check passed. The mock confirmed that the Xbox argument order reaches the PC method, writes only the requested struct, and leaves the PC calling form working. All six
xs_proxy_mockvariants and bothdevice_proxyWARP tests passed. This was a stacked test, with synthetic inputs and no game files. AI-assisted testing with Codex.@Mumogg on GitHub · 2026-11-24 04:15 UTC · original
Thank you for the Windows run, here and on #350. Those two were the part I could not do: built with clang-cl and run under Wine only on my side.
AI-assisted.
@fiestorra on GitHub · 2026-11-24 04:28 UTC · original
Confirmation of your stop on a third machine, and the symbol behind it. Built this repository's
mainatece4ba5b3here with MSVC 14.44.35207 on Windows build 26300 and ran the title (gta6rt.exe --run game_scarlett_master.exe --trace-d3d12,LEONIDA_D3D12=vulkan, device picked: NVIDIA RTX 4090, driver 32.0.16.2124). The loader line readsshim=94 host=421 module=72 unimplemented=0andD3D12XboxCreateDevicereturns ok once, thendevice slot 26 (forwarded) first calland the process dies of0xc0000005reading address0xd0— the same title frames as #47's comment 7121225307 (game_scarlett_master.exe+0x2478713, +0x19f4f54, +0x580437e, +0x43a4911, +0x224070b, +0x23cf00a, +0x2215eca), so this row reproduces on native MSVC as well as on the clang-cl build and the AMD part.I resolved the host frame with the Windows debugger against
gta6rt.pdbfor this build: the fault is inrt::d3d12_xs::proxy_slot<26>+0x239,mov r10, qword ptr [rax+0D0h]withrax = 0, which isruntime/shims/d3d12_xs_device.cpp:1923auto fn = reinterpret_cast<ForwardFn>(self->real_vtable[Slot]);. The proxy pointer itself is fine (theSlot >= self->slot_countcheck readsDeviceProxy+0x18 andself->realat +0x8 just before), andreal_vtableisDeviceProxy+0x10, so what is null is the cached table, indexed at 26 × 8 = 0xd0. In that file the field is written in one place only, line 608proxy->real_vtable = *reinterpret_cast<void***>(real);, while another path re-reads it from the object each call (line 1091auto** const real_vtable = *reinterpret_cast<void***>(self->real);). I have not measured which creation path this device came through, so I am not claiming to know why it is null; I only have the offset and the instruction, and the observation that the generic forward trusts the cached field while a nearby path does not. Not claiming the row — it is yours, and this is only the extra symbol for it.