Skip to content

d3d12_xs: device slot 73 answers the console list IID with the console list proxy (depends on #6935, #2490) - #7076

Open
NiiRoZz wants to merge 6 commits into
ItsNotRexed:mainfrom
NiiRoZz:rt-xs-slot73-console-list
Open

NiiRoZz wants to merge 6 commits into
ItsNotRexed:mainfrom
NiiRoZz:rt-xs-slot73-console-list

Conversation

@NiiRoZz

@NiiRoZz NiiRoZz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #7049 (comment) (item 1)

Depends on: #6935 (routes device slot 73) and #2490 (the console list proxy). This branch is #6935 with #2490 merged into it (the conflicts resolved: slot 12 joins #6935's overridden-slot list, and the mock test keeps both sides' cases), plus one commit.

What and why

#6935 routes Xbox device slot 73 (CreateCommandListX(desc, allocator, initial_state, riid, out)) to the PC CreateCommandList, passing the caller's riid. Measured locally at a title's call sites, that riid is a console command-list IID that no PC object answers (#3520 records that the package doesn't export these IIDs). So every list failed, and the title asserted right after its first allocator.

The list now comes from the slot 12 path: #2490's console list proxy over a PC graphics list of the desc's type. If the proxy answers the IID the caller asked for, the call returns that interface. Any other IID gets the proxy itself, with one log line. A plain PC list isn't enough: handed out unwrapped, the title faults right after the first list. With the proxy, all 581 of the title's lists are created and closed.

Tested

Windows 11 (build 26300), RTX 5090, MSVC 19.44, Vulkan SDK 1.4.363.0, RelWithDebInfo.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. No IID values; only slot numbers, public SDK types and counts.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: runtime only)

🤖 Generated with Claude Code

NolanCotter and others added 5 commits November 23, 2026 07:21
The d3d12_xs shim's device now hands callers console-shaped command
lists (160-slot vtable, object body at +0x18 with the write cursor
pinned at the record limits, console slots 27-30 recorded not
forwarded, slot map measured to the PC table: 60->58, 61->59,
146->80). Queue layout detection is atomic and device-wide; SignalX
(slot 23/25 by layout) forwards as Signal, PresentX (30/32) reaches
the presentation core, and ambiguous slot 18 serves the timestamp-
frequency getter until the layout is proven.

AllocateUploadMemory (console slot 148) carves a bump arena out of
persistently-mapped UPLOAD-heap buffers; the six root-VA setters and
the IA/SO view setters translate arena pointers to buffer device
addresses in proxy-owned copies. Impossible sizes and non-power-of-
two alignments are refused before any arithmetic that could wrap.

PC-compiled callers opt into real PC-shaped lists with
console_lists=false on create_device_proxy, and PC-compiled guests
with LEONIDA_D3D12_LISTS=pc — the fixture path check_tiny_frame.py
sets, so a guest ClearRenderTargetView at PC slot 48 reaches the
real list. The GPU tests take the flag; unmeasured console slots
stay console-shaped for the title path.

docs/d3d12_xs_console_abi.md records the measured ABI.

Split from ItsNotRexed#2490 (third of three): fixes the run_tiny_frame failure
the revert reported. AI-assisted. Hardware verification on the
earlier identical code is in ItsNotRexed#2490's thread (RTX 3060 Ti-5080, RX
7600/9060/9070/7900 XT, Intel UHD, RADV; 177/177). Wine/clang-cl on
the build host: xs_proxy_mock PASS incl. the overflow regression,
queue_proxy child-runner section fails identically on unmodified
main (Wine env), loader_test 86/0 upstream count.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
test_every_variable_is_named_in_a_document fails when a code-used
environment variable is documented nowhere. The variable is described
in the command-list section where the two list layouts are defined.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The public HLE Freminet/ScarlettX puts CreateCommandQueueX at device slot
48, CreateCommandListX at 73, SetFrameIntervalX at 78, ScheduleFrameEventX
at 79 and WaitFrameEventX at 80. The generic device thunk now answers those
slots before it indexes the PC vtable, so a title that follows the public
boot sequence no longer reaches CreateReservedResource2/CreateSampler2
(slots 78/79), falls past an 80-slot ID3D12Device11 table (slot 80), or
reaches unrelated PC methods (48/73).

Queue and list creation use the existing create paths. The command-list
call takes the console shape (desc, allocator, initialState, riid, out):
the type is the first word of the desc and there is no node mask. The three
frame calls are a per-device token counter and return S_OK; WaitFrameEventX
returns at once with a fresh non-zero token, because there is no vblank
source behind the device before a presenter exists.

The slot numbers are a third-party observation, not Microsoft
documentation, so each route can be moved with LEONIDA_XS_QUEUE_X_SLOT,
LEONIDA_XS_LIST_X_SLOT, LEONIDA_XS_FRAME_INTERVAL_SLOT,
LEONIDA_XS_SCHEDULE_EVENT_SLOT and LEONIDA_XS_WAIT_EVENT_SLOT (3..127;
anything else is logged once and ignored).

Tests: xs_proxy_mock (mock device answering ID3D12Device11: the five slots
reach the handlers, none reaches the mock's own PC slots, null arguments
are refused, environment overrides move all five, out-of-range values are
ignored) and device_proxy (WARP: the same five slots, including a command
list and a queue proxy). 8/8 ctest targets pass: device_proxy,
device_proxy_trace, xs_proxy_mock, xs_proxy_mock_no_reserve,
xs_proxy_mock_no_protect, xs_proxy_mock_no_handler,
xs_proxy_mock_env_slots, xs_proxy_mock_env_slots_invalid.
…e list proxy

Xbox device slot 73 (CreateCommandListX, routed by ItsNotRexed#6935) passed the caller's riid to the PC
CreateCommandList. Measured locally at a title's call sites, that riid is a console command-list IID no PC
object answers, so every list failed and the title asserted after its first allocator. The list now comes
from the slot 12 path (ItsNotRexed#2490's console list proxy over a PC graphics list); an IID the proxy answers is
returned as asked, and any other is answered with the proxy itself, logged once.

A plain PC list is not enough: handed out unwrapped, the title faults right after the first list. With the
proxy, all of the title's lists are created and closed.

xs_proxy_mock_test: slot 73 returns a list proxy over the mock's list, a made-up IID the PC does not know
gets a list proxy, and ID3D12GraphicsCommandList1 is returned as asked. Also drops the duplicate
Kind::list case the ItsNotRexed#2490 merge left in the mock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LooperSalty

Copy link
Copy Markdown

Measured data for this PR, from the 1.0.2.1 executable (own copy, Windows 11, RTX 4070 SUPER), in case it helps the proxy's QueryInterface answer: the slot-73 riid is c3827890-4024-474c-98cf-645b51dc4874, the only GUID of that form in the executable's .rdata. It shares its first 32 bits with PC ID3D12GraphicsCommandList6 (c3827890-e548-4cfa-96cf-5689a9370f80), and a PC device given the PC IID creates the list where the console one gets E_NOINTERFACE. Right after creation the title calls list slots 132 (+0x420) and 131 (+0x418), then slot 9 (+0x48), and asserts on that last result. I'm closing my overlapping #7124 in favour of this PR. AI-assisted (Claude Code).

@zohaiblazuli

zohaiblazuli commented Nov 23, 2026 •

Copy link
Copy Markdown

Tested e08d2af11 on the retail executable, on top of #6973 and #7037: pass.

Retail Xbox Series 1.0.2.1 package + executable (sizes match game/xbox-1.0.2.1.json), Windows 11 10.0.26300, MSVC (VS 2022), GeForce RTX 3060 (driver 32.0.16.1742). Host D3D12 backend (LEONIDA_D3D12=vulkan not compiled in: no Vulkan SDK on this machine). gta6rt --run with --overlay to a scratch folder, outbound network blocked, LEONIDA_UNIMPLEMENTED=stop. Base: main 9b72d0d2c + #6582, #6919, #4313, #4348, #6792, #6810, #6885, #6891 merged locally (conflicts resolved locally).

  • Slot 73 now returns the console list proxy ("asks for a list IID the PC does not know"). The title records into it (list slots 9, 131, 132 called), then calls device slots 78/79 (SetFrameIntervalX / ScheduleFrameEventX) and device slot 15. After that it calls through a null pointer, which I haven't diagnosed. The coordination thread lists later stops, so it may already be covered.
  • An observation, not a claim: on this run, the first slot 73 call's description words are 0x0, 0x2. They're read as type 0 (DIRECT), per d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935's rule. If the second word turns out to be the type, this first list would be a COMPUTE list.
  • Merge notes against main + d3d12_xs: CreateCommandQueueX drops the title's console queue flags (RT-5: the compute queues) #7037: slot_name 48/73, the proxy_create_command_list_x tail, device_slot_overridden() (12 plus 25/26) and the mock test. main and this PR each add a mock Kind for lists (command_list vs list); I kept list and dropped the duplicate case.

Outcomes only; no game data.

@Stalkerino

Copy link
Copy Markdown

We independently reached the same 581 creates and 581 closes on a Radeon RX 9070 XT under Wine 11.22 and Proton CachyOS. My two-file amendment on the current public #2490 head includes a narrower IID rule and a regression test that may be useful here. Xbox GraphicsCommandList6 maps to the corresponding desktop capability, subsequent QueryInterface on the console object preserves COM identity, a neighbouring unknown IID gets E_NOINTERFACE, and a caller asking for the desktop interface keeps the desktop object. The six proxy mock modes pass under Wine, including slot reassignment.

Your PR provides the upstream review thread for slot 73. I’m consolidating my amendment here so maintainers can reuse the tested cases. Single commit on rebased #2490 · Wine integration results

…list

# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
#	runtime/shims/d3d12_xs_device.h
#	runtime/test/xs_proxy_mock_test.cpp
NiiRoZz added a commit to NiiRoZz/Leonida that referenced this pull request Nov 23, 2026
…n and runs on its own line, clear of the slot 73/list changes in ItsNotRexed#7076

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Marukooh

Copy link
Copy Markdown
Contributor

Independent before/after result for c7eaea3d on CachyOS x86-64, Wine 11.22, clang-cl/xwin SDK 10.0.26100 Release, RTX 5070 Ti / NVIDIA 620.73.04, Vulkan. Offline with my own 1.0.2.1 package.

On a local TLS, XMem, GDK, DirectStorage and SDL3/GameInput integration with #6964 and the #7037 queue-flags translation, the #6935 route failed at the first Xbox command-list creation. With this PR's console proxy, the same run creates and closes all 581 lists, after 5 queues, 5 fences and 7 command allocators. It reaches the adapter lookup and device frame-event slots 78 and 79. The next exception is an execute access violation at address zero, after the first log for device slot 15. The three synthetic mock cases passed, including the two environment route cases.

Outcomes only; no retail trace, code or data was published. AI-assisted (Codex).

@fladit123 fladit123 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Windows review — changes requested

Tested head: c7eaea3d42708417270de598da46515eb89831e7
Stack-specific baseline: 624f55dd5b08eb0801d9d9ddd4cf8093b377a802
Environment: Windows 11 26H2, MSVC 19.51, RelWithDebInfo, native D3D12/WARP.

The slot-73 implementation correctly forwards the command-list creation arguments in the valid cases tested. However, independent COM probes found three interface-contract issues that are not covered by the existing tests.

1. An unsupported public IID is accepted.

Requesting IID_ID3D12Fence with a valid COMPUTE allocator returns S_OK and a command-list proxy. The baseline correctly returns E_NOINTERFACE with a null output.

The fallback in proxy_create_command_list_x() returns the list after QueryInterface rejects the requested IID.

Please restrict the fallback to explicitly supported console IID(s), reject unrelated interfaces, and release the temporary reference on failure.

2. A public PC IID can receive a console-layout vtable.

With console lists enabled, requesting ID3D12GraphicsCommandList1 succeeds, but a call through the SDK's SetDescriptorHeaps slot 28 is not forwarded. The console proxy expects that method at slot 32.

The layout difference already exists in the underlying proxy. This PR makes it accessible through slot 73 when returning a public PC interface.

A successful request for a PC interface must provide its expected SDK method layout.

3. PC-list mode can return an incompatible fallback object.

Under LEONIDA_D3D12_LISTS=pc, an unknown synthetic IID returns S_OK with a raw PC list pointer. The baseline returns E_NOINTERFACE.

An explicitly supported console IID should receive the correct console interface; unsupported IIDs should fail rather than return an object with an incompatible layout.

Test results

Test Baseline PR
Independent COM mock assertions 25/25 29/33
Independent WARP assertions 3/3 2/3
Stock PR CTests — 10/10

The PR's ten CTests pass, but the independent probes reproduce the interface-contract failures. The ID3D12Fence result was reproduced with WARP. The baseline mock required removing a duplicate case Kind::list from a temporary test-only copy to compile; no baseline shim code was modified.

The slot-73 argument ABI, allocator unwrapping, null-pointer handling, error propagation, and reference balancing passed in the exercised valid cases.

The console IID measurements already discussed in this PR and the narrower IID handling proposed alongside #2490 may help resolve these issues without duplicating work.

Verdict: REQUEST CHANGES.

Please add regression tests for unsupported public IIDs, PC-interface vtable compatibility, and the LEONIDA_D3D12_LISTS=pc fallback before merging.

Synthetic fixtures only. No proprietary game files or retail executable used. AI-assisted review with OpenAI Codex.

@LooperSalty

Copy link
Copy Markdown

Follow-up with static data on list slots 131/132, which this PR answers with 0 without calling the backend (console_to_pc_list_slot). That is enough for boot: the 1.0.2.1 title doesn't test their results, only Close (slot 9) right after. Their effect is still unknown, so it may matter once lists record real work. The arguments the title passes (after this), from the executable:

site slot arg 2 arg 3 arg 4 arg 5
first list, game+0x2478b9e 132 (+0x420) 0x700000 0 0 0xffffffffff00
first list, game+0x2478bbf 131 (+0x418) 0xc3c0 0x80020000 0 0xffffffffff00
loop, game+0x2478c93 132 0x100000 0 0 0xffffffffff00
loop, game+0x2478cb4 131 0xc380 0x20000 0 0xffffffffff00

All passed by value; nothing establishes that any of them is a pointer, a size or a mode, so I'd keep them logged (as the PR does) rather than guess. Static analysis by Codex on my own copy (Ghidra, targeted functions only); RVAs and constants only. AI-assisted (Claude Code).

@sneylol

sneylol commented Nov 23, 2026

Copy link
Copy Markdown

Tested on the retail executable: pass. this PR is what gets the title through slot 73: every list is created, the console IID the PC does not know is answered with the console list proxy, and the console list slots 132/131 and Close (9) land on the proxy instead of faulting.

Setup: own Xbox 1.0.2.1 copy (exe 120,181,760 bytes), Windows 11 26200, RX 9070 XT (AMD Windows driver), MSVC 14.44 RelWithDebInfo, LEONIDA_D3D12=vulkan, gta6rt --run with --overlay, --trace and --trace-d3d12. Integration branch: main 8575d36 + #6919 (36936f3) + #6964 + #4313 + #6582 + #4348 + #7076 + #7183, plus the console-flags drop from #7037 (now closed in favour of #6954, which does the same for these calls). No local stand-ins: every stop below is the PRs' own behaviour. Counts and API names only.

Result (one run): the device is created; 5 queues (4 through slot 48), 5 fences and 7 allocators; 581 command lists created and closed through slot 73 (list slots 132 and 131 reached on the console-IID lists); slots 78/79 answered; then the xmem placeholder window, its 2 MiB commits and the physical-page maps all succeed (xmem_attributes x7, xmem_physical_pages); the title then calls device slot 133 (a buffer at a title address: unified memory, #313 (comment)), which is refused with E_NOTIMPL, and the title stops on its own assert. That is the next blocker; it is not in any of these PRs.

AI-assisted (Claude Code).

@Zunraz

Zunraz commented Nov 23, 2026

Copy link
Copy Markdown

Independent native Windows/Vulkan integration of c7eaea3d42708417270de598da46515eb89831e7:

An additional integration issue with #2490's queue-layout detection: both device_proxy_test modes fail four checks introduced by #7037 (one GetDesc check for each fresh slot-48 queue). Those modes passed on the control before adding this head. Queue creation and GPU fence signals still pass. A separate local diagnostic through queue_proxy_real_queue(...)->GetDesc() confirms all four backend objects really are COMPUTE / Flags NONE. Calling the proxy's slot 18 with a fully initialized 16-byte synthetic buffer writes the 8-byte timestamp frequency and leaves its second word unchanged, rather than returning the queue description. This matches the unknown-layout branch in child_slot: it treats slot 18 as the newer frequency getter until older-layout evidence exists. The #7037 test calls the SDK GetDesc before signaling that fresh queue, exposing the ambiguity. This is a proxy interface/layout issue, not evidence that the console flags are reaching the backend unchanged. @NolanCotter, this also concerns the underlying #2490 queue-layout path.

This boot result does not resolve the COM-interface findings in the existing changes-requested review. The queue test finding is on this combination of PRs; I have not reproduced it on standalone current main.

Windows build 26300, RTX 5090 / driver 32.0.16.2124; clang-cl 21.1.8 + xwin SDK 10.0.26100, static CRT. Socket creation, DNS and transmission debugger-guarded; local Winsock initialization allowed. Outcomes and synthetic test behavior only; no game data, raw trace or title offsets attached. AI-assisted (Codex).

@kormocicsaba

Copy link
Copy Markdown

Tested c7eaea3d4, merged alone into main 8575d36: fail. Same three failures as #2490 (d3d12_bindless_churn and _validated SEGFAULT, d3d12_mesh Close), which it carries. They need fixing in #2490 first.

Setup: RTX 4070 (driver 621.01), Windows 11 Pro 26300, MSVC (VS 18) RelWithDebInfo with Ninja, Vulkan SDK 1.4.363.0. The PR head was merged alone into main 8575d36 and runtime/ was built. I ran the full ctest -j8 --timeout 300; no game files were used.

AI-assisted review (Claude Code). How this compares with the other boot-chain PRs: #7333 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.