Repository navigation
Conversation
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>
|
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 |
|
Tested Retail Xbox Series 1.0.2.1 package + executable (sizes match
Outcomes only; no game data. |
|
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
…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>
|
Independent before/after result for 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). |
There was a problem hiding this comment.
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.
|
Follow-up with static data on list slots 131/132, which this PR answers with 0 without calling the backend (
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). |
|
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 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, 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 ( AI-assisted (Claude Code). |
|
Independent native Windows/Vulkan integration of
An additional integration issue with #2490's queue-layout detection: both 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). |
|
Tested on the retail boot (head Setup: native Windows 11, RTX 5060 Ti (NVIDIA), Ryzen 7 8700F, MSVC RelWithDebInfo, Counts and stop numbers only, no game files. AI-assisted (Claude Code). |
… its interfaces From @tupacfan04's review of ItsNotRexed#7903: on a boot stack with the console list proxy (ItsNotRexed#7076), the title's lists are proxies whose QueryInterface answers only the console and public list IIDs. The shim asked the proxy itself, so a private interface was refused, and a PC interface it did answer would have been called through a console-shaped vtable. d3d12_xs_device exposes real_object_behind_proxy(), the real object behind any child proxy (proxy_real_object, which a console list proxy joins, as the file and ItsNotRexed#7076 say), and the shim asks that real list for ID3D12GraphicsCommandList4. On main lists aren't wrapped, so nothing changes there; with ItsNotRexed#7076 the shim follows its lists without a further change. docs/xdxr.md: BuildRaytracingAccelerationStructureBatched2X is 6 call [rip+disp32] sites through the import table; IDA counts 8 direct calls, two of them in another form (@FJKiXfaR on ItsNotRexed#7516). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its interfaces From @tupacfan04's review of ItsNotRexed#7903: on a boot stack with the console list proxy (ItsNotRexed#7076), the title's lists are proxies whose QueryInterface answers only the console and public list IIDs. The shim asked the proxy itself, so a private interface was refused, and a PC interface it did answer would have been called through a console-shaped vtable. d3d12_xs_device exposes real_object_behind_proxy(), the real object behind any child proxy (proxy_real_object, which a console list proxy joins, as the file and ItsNotRexed#7076 say), and the shim asks that real list for ID3D12GraphicsCommandList4. On main lists aren't wrapped, so nothing changes there; with ItsNotRexed#7076 the shim follows its lists without a further change. docs/xdxr.md: BuildRaytracingAccelerationStructureBatched2X is 6 call [rip+disp32] sites through the import table; IDA counts 8 direct calls, two of them in another form (@FJKiXfaR on ItsNotRexed#7516). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r ILeonidaXdxrRehydrate From @tupacfan04's review: a console list proxy (ItsNotRexed#7076) answers only console and public list IIDs, so the rehydration export took its "not the layer's list" branch (E_NOTIMPL) for every proxy-created list. It now asks the list real_object_behind_proxy() gives, as list4_of does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
checked: #7076 at
Both tests came to AI-assisted (Claude Code). |
|
Independent Windows Sandbox baseline with #8379, #6582, #8461, #7216, #6964 and #8258 code/test hunks in a temporary checkout (network disabled; game inputs read-only; fresh overlay per run): 2/2 runs reached 13 D3D12 calls, with 12 successful and one failed Counts, error classes and public API/slot names only; traces stay local. AI-assisted. |
|
Windows integration validation, RX 580 (driver 31.0.21924.61), i7-10700F, MSVC 14.44: xs_proxy_mock (including all six fault/environment variants), device_proxy, queue_proxy, d3d12_descriptor and d3d12_existing_heap pass after combining this with #6964, #8258 and #7218. The normal retail startup creates/closes hundreds of console lists, passes the earlier queue/IID failures, and reaches the descriptor-handle stop. With #7021 then integrated, it passes that stop and reaches a CLWB illegal instruction on this Intel CPU. No assertion skipping or debugger argument rewriting was used. No frame/gameplay claim; no game data or logs included. |
|
Independent Windows 11 / MSVC 2022 RelWithDebInfo synthetic check of the narrower IID amendment linked above, commit
This validates that separate amendment only; it is not a test of #7076's current head or a retail boot with that amendment integrated. No game files were used. AI-assisted. |
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
|
Tested c7eaea3 under Wine: Proton Experimental (wine 11),
AI-assisted run (Claude Code); no game files used. |
|
Retail-boot result on the real 1.0.2.1 image with this PR merged into the local stack (local merge 7b4841f8): slot 73 answered the console list IID with the console list proxy; 581 command lists were created and closed (1,181 traced D3D12 calls), and the boot proceeded through SetFrameIntervalX/ScheduleFrameEventX to the next stop (device slot 133, the 128-slot table limit). Focused device_proxy/xs_proxy/queue_proxy/run_tiny_frame/dstorage: 31/31 pass, including run_tiny_frame; full ctest: 226 passed, 12 skipped, 1 disabled, only the 2 pre-existing GPU failures (d3d12_vulkan_device, d3d12_depth_resolve). No PC-list regression. |
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 PCCreateCommandList, passing the caller'sriid. Measured locally at a title's call sites, thatriidis 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.
xs_proxy_mock_test: slot 73 returns a list proxy over the mock's list (PC slot 12 reached once per call), a made-up IID the PC doesn't know gets a list proxy, andID3D12GraphicsCommandList1is returned as asked. d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935's refusal cases and d3d12_xs: console-ABI command lists, upload arena, PC-list fixture path #2490's list cases still pass. Also drops a duplicateKind::listcase left by the merge. PASS.ctest -R "xs_proxy|device_proxy": 8/8 pass.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (n/a: runtime only)🤖 Generated with Claude Code