Skip to content

d3d12_xs_device: slot 73 creates the console ID3D12GraphicsCommandListX IID as ID3D12GraphicsCommandList (RT-XS-DEVICE-STOPS-7-9) - #359

Merged
ubiquitarianism merged 5 commits into
mainfrom
feat/xs-device-stops-7-9
Nov 24, 2026
Merged

ubiquitarianism merged 5 commits into
mainfrom
feat/xs-device-stops-7-9

Conversation

@Andretuta

@Andretuta Andretuta commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Claimed in the coordination issue as: RT-XS-DEVICE-STOPS-7-9 (#14 (comment))

What and why

Reduced after review to what current main does not already have. Slots 25/26 (the console's struct-return form) and 48 (CreateCommandQueueX descriptor sanitizing) landed on main in the meantime. The slot 58 forwarder is dropped: PC vtable slot 58 is ID3D12Device5::RemoveDevice, not GetResourceAllocationInfo1 (PC slot 56), and no call to Xbox slot 58 is measured.

  • Stop 9, CreateCommandListX (slot 73, docs/retail_boot_chain.md §3.3): the title passes the console ID3D12GraphicsCommandListX IID {c3827890-4024-474c-98cf-645b51dc4874} (measured in d3d12_xs: accept Xbox ID3D12GraphicsCommandListX IID in CreateCommandListX #445), which the PC device does not know. That IID is created as ID3D12GraphicsCommandList in one call and handed out as the console list proxy, which also answers QueryInterface for it. Every other IID goes to the device unchanged.
  • Fixed after review (ABI review): the first version retried any IID the device refused, so asking for a public list revision the backend lacks (ID3D12GraphicsCommandList9 on a revision-8 device) returned S_OK and a base list. It now returns E_NOINTERFACE with a null output again.

The slot 73 change in d3d12_xs_device.cpp is now #445's patch line for line, so the two merge cleanly in either order (checked with git merge-tree and a test build of both merged, where xs_proxy_mock and d3d12_vulkan_device pass). This PR adds the tests and the docs.

Tested

  • MSVC 14.44 / Windows SDK 10.0.26100: xs_proxy_mock and d3d12_vulkan_device pass under CTest. New slot-73 checks: ID3D12GraphicsCommandList9 and an unknown private IID keep E_NOINTERFACE with a null output and one device call; the console IID is created once as ID3D12GraphicsCommandList and is queryable on the proxy; a PC IID the device refuses is not retried. The ID3D12GraphicsCommandList9 check fails on the previous head.
  • Docs tests: 47 passed.
  • Not run against the retail title; reviewers' reports above cover the boot progress past slot 73.

GPUs tested: n/a (mock device)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🤖 Generated with Claude Code

… 48 desc sanitize and slot 73 IID fallback (RT-XS-DEVICE-STOPS-7-9)
@Sigtryggur-Mani-Gudmundsson

Sigtryggur-Mani-Gudmundsson commented Nov 24, 2026 •

Copy link
Copy Markdown

I tested the slot 73 fallback against the Vulkan backend from main@8f481cf1 under Wine on an RTX 4070 Ti. With a synthetic private IID, main returned E_NOINTERFACE. With this PR’s proxy, the list closed, submitted and reached fence value 1. This covers the creation route in the new boot report.

One public capability check regresses. Requesting ID3D12GraphicsCommandList9 on a backend that implements revision 8 returns S_OK and a base list. A guard for public list revisions preserves E_NOINTERFACE and a null output while the private request still reaches the fence. The complete PR mock passed with the guard. Separately, querying the returned proxy for the original synthetic private IID still returns E_NOINTERFACE. I did not run the retail title.

I isolated your fallback on current main and included a small review patch against e7b32cd9, with a source-only GPU fixture and results. Patches and reproduction. AI-assisted with Codex.

The full proxy mock now passes on unchanged main and main with the standalone slot-73 patch. My earlier slot-26 test failure came from my LLVM-MinGW header adaptation. On the RTX 4070 Ti, both builds returned the same heap properties and allocation info as the underlying D3D12 device through both calling conventions, with vkd3d-proton 2.11.0 and 3.0.0. The updated reproduction link includes the build script and hardware fixture.

Andretuta and others added 2 commits November 24, 2026 02:55
# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
#	runtime/shims/d3d12_xs_device.h
#	runtime/test/xs_proxy_mock_test.cpp
…CommandList

Reduced to what main does not already have: slots 25/26 (struct return) and
48 (queue desc sanitize) landed on main, and the slot 58 forwarder is dropped
(PC vtable slot 58 is ID3D12Device5::RemoveDevice, not
GetResourceAllocationInfo1, and no call to Xbox slot 58 is measured).

CreateCommandListX passes the title's console command-list IID, which the PC
device does not know (docs/retail_boot_chain.md 3.3). On E_NOINTERFACE for an
IID that is not a PC list IID, create the list once more as
ID3D12GraphicsCommandList and hand out the console list proxy. A PC list IID
the device refuses still fails as before.

AI-assisted. Tested: xs_proxy_mock_test new checks with clang 23 / mingw x64
(a pre-existing kLong allocation-injection check does not fire under mingw, so
the full run needs MSVC/CI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Andretuta Andretuta changed the title d3d12_xs_device: handle Xbox struct-return ABI (slots 25/26/58), slot 48 desc sanitize and slot 73 IID fallback d3d12_xs_device: slot 73 retries a console command-list IID as ID3D12GraphicsCommandList (RT-XS-DEVICE-STOPS-7-9) Nov 24, 2026
@fiestorra

Copy link
Copy Markdown
Contributor

Ran your slot-73 change against the retail title on the current main, and one thing to save you a rebase. Base d42773d07. Windows build 26300, MSVC RelWithDebInfo, LEONIDA_D3D12=vulkan on a Radeon 780M integrated GPU (gfx1036), 1.0.2.1 executable and package. Written with an AI assistant.

The rebase. e7b32cd91 conflicts on today's main because the device work it carries has since landed on its own: slot 26 through #349, slot 48 through #350, slot 70 through #356, slot 25 through #362. Only your last commit f423c9046 (the slot 73 command-list IID) is still new, and that one cherry-picks onto d42773d07 with no conflicts, touching only d3d12_xs_device.cpp and xs_proxy_mock_test.cpp. Dropping the earlier commit from the branch looks enough to make this landable as is.

What it does to the title. Without it, d42773d07 stops exactly at this call: 13 recorded calls, #13 ID3D12Device::CreateCommandList failed, then the title's own assert 0x80000003. With f423c9046 applied, the title reaches 1644 recorded calls, 1619 ok, through ID3D12GraphicsCommandList::Close, XboxIDXGIDevice::GetAdapter, CreatePlacedResourceX (slot 133), CreateDescriptorHeap, ID3D12Device10::CreateCommittedResource3 and a batch of view-creation calls, and stops at the title assert 0x80000003 at game_scarlett_master.exe+0x247af2d — a point past every row in docs/retail_boot_chain.md. I posted that stop separately in the coordination issue.

The difference I can measure against the other open attempt on the same wall (#445, which maps the IID instead of retrying) is only in the failed-call count: here five CreateCommandList calls come back failed (#13, #17, #21, #25, #29) and the title continues past them, while the mapping version reports no failed CreateCommandList at all. Both reach the same stop, with the same following calls, so on this title the retry shape is not what holds it back — what matters is that the console IID stops being refused. I did not run xs_proxy_mock_test.cpp (I tested by running the title), and I did not check other hardware.

@x2Tweek x2Tweek 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.

Tested PR #359's IID-free fallback approach on the retail executable (.exe 1.0.2.1), LEONIDA_D3D12=vulkan, RTX 5090.

Before the fix: boot crashes at trace #13, ID3D12Device::CreateCommandList failed — QueryInterface: unknown IID {c3827890-4024-474c-98cf-645b51dc4874}.

After applying PR #359's change (retry CreateCommandList with PC base IID __uuidof(ID3D12GraphicsCommandList) on E_NOINTERFACE when the requested IID is not a list IID): boot reaches trace #1644, stopping at CreateUnorderedAccessView. Exit still 0x80000003 but the blocker moved from CreateCommandList to resource creation.

This is the same outcome as PR #142's class-level approach (both reach resource creation, ~1600 D3D12 calls). PR #359's change is simpler — no new GUID constant, no d3d12_com.h include (which breaks xs_proxy_mock_test build on the root_sig_test target that lacks Vulkan headers), and doesn't change list_query_interface()/is_list_iid().

Next blocker after this fix: CreateUnorderedAccessView at trace #1644, guest-code crash mov dword ptr [rax], r8d with invalid rax at game_scarlett_master.exe+0x55e3b1, stack 100% game code, no gta6rt frames.

Tested on current upstream/main (1c93c86) with the fix applied temporarily in a local worktree (reverted after testing; not committed).

The slot 73 fallback retried every IID the PC device refused, so asking for
a public list revision the backend lacks (ID3D12GraphicsCommandList9 on a
revision-8 device) returned S_OK and a base list instead of E_NOINTERFACE
(review on #359). Only the console ID3D12GraphicsCommandListX IID
{c3827890-4024-474c-98cf-645b51dc4874} (#445) is now created as
ID3D12GraphicsCommandList, in one call, and the list proxy answers
QueryInterface for it. Every other IID reaches the device unchanged.

Tested: xs_proxy_mock (List9 and an unknown IID keep E_NOINTERFACE with a
null output; the console IID is created once and is queryable) and
d3d12_vulkan_device with MSVC 14.44 / SDK 10.0.26100; docs tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Andretuta Andretuta changed the title d3d12_xs_device: slot 73 retries a console command-list IID as ID3D12GraphicsCommandList (RT-XS-DEVICE-STOPS-7-9) d3d12_xs_device: slot 73 creates the console ID3D12GraphicsCommandListX IID as ID3D12GraphicsCommandList (RT-XS-DEVICE-STOPS-7-9) Nov 24, 2026
#445 makes the same slot 73 change (map the console
ID3D12GraphicsCommandListX IID to ID3D12GraphicsCommandList on creation
and QueryInterface). Use its exact text in d3d12_xs_device.cpp so the two
pull requests merge cleanly in either order; this one keeps the
regression checks (ID3D12GraphicsCommandList9 and an unknown IID keep
E_NOINTERFACE with a null output) and the docs line.

Tested: xs_proxy_mock and d3d12_vulkan_device with MSVC 14.44 / SDK
10.0.26100, on this branch and on this branch merged with #445's head
386d6ac.

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

hubeton commented Nov 24, 2026

Copy link
Copy Markdown

Independent run of the current PR head d52ab6b5 on main@2d73c242, using Xbox 1.0.2.1 on native Windows 11 (26300.9974) with an RTX 3060 Ti, NVIDIA 621.24, and LEONIDA_D3D12=vulkan. Built with clang-cl 23.1.6 in RelWithDebInfo. xs_proxy_mock_test passed.

The previous unpatched build failed at slot 73 (CreateCommandListX, trace entry #13). With this PR, entry #13 succeeds and the run reaches entry #1639 (CreateUnorderedAccessView) before the title raises 0x80000003. This matches the existing reports and adds a native Windows Ampere result for the current IID-specific revision.

AI-assisted testing and report.

@ubiquitarianism
ubiquitarianism merged commit dd4be16 into main Nov 24, 2026
3 of 5 checks passed
demoz53 added a commit to demoz53/leonida that referenced this pull request Nov 24, 2026
Brings 58 PRs integration did not have (among them ProjectLeonida#359 ProjectLeonida#360 ProjectLeonida#402 ProjectLeonida#497 ProjectLeonida#557 ProjectLeonida#558
ProjectLeonida#560 ProjectLeonida#561 ProjectLeonida#572 ProjectLeonida#573 ProjectLeonida#574 ProjectLeonida#577) and the newer heads of ProjectLeonida#401 and ProjectLeonida#404. 15 files
conflicted; resolved by hand:

- frame_pacer.h, d3d12_xs_device.h/.cpp: ProjectLeonida#402's pacer (per-event ticks,
  issue_token_locked) now issues from ProjectLeonida#414's shared FrameTokenSource, so a token
  from the device-side WaitFrameEventX is one the pacer accepts (towade's ProjectLeonida#14
  finding: without it every PresentX is refused). The dead frame_next_token and
  issued_ counters are dropped. Queue slot 32 stays ProjectLeonida#414's PresentX; ProjectLeonida#402's
  presentation-handler routes serve slot 30 or LEONIDA_XS_PRESENT_X_SLOT.
  ProjectLeonida#402's GetFrameStatisticsX route moves into ProjectLeonida#385's route_xbox_device_slot.
- acphal.cpp/acphal_test.cpp: upstream's reworked SHAPE allocation and release;
  the release writes nothing through its first argument, as ProjectLeonida#405 requires; both
  sides' tests kept. Upstream's ProjectLeonida#401/ProjectLeonida#404 heads remove lifecycle.cpp and the C++
  xma2_decoder.cpp (replaced by runtime/xma_decoder), so build_runtime.ps1's
  cl.exe list drops them and keeps ProjectLeonida#549's and ProjectLeonida#400's files.
- vulkan_backend.h, statistics_sum.comp, its SPIR-V header, d3d12_mesh_test,
  replay_query_edges_test, d3d12_vulkan_device.cpp, docs: ProjectLeonida#577's clipping
  counter on top of ProjectLeonida#540, which both sides carry; the Timestamps sentence keeps
  integration's corrected wording (c33ce87).
- xs_proxy_mock_test.cpp: both sides' cases; pr_conflict_label.py keeps the
  guarded reconfigure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aslan2142 added a commit that referenced this pull request Nov 25, 2026
Merges main at 1154976 into the integration branch at 273b3bd (merge base ece4ba5). 42 files conflicted;
this commit is the resolution only. Build and test repairs follow in their own commits.

Rule of resolution: where both sides added different things, both stay; where both made the same change in two
forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two
changed the same code for different purposes, both purposes are kept.

Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, registry.cpp):
- d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device
  routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device
  slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the
  console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and
  list slot 139 (#396).
- Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's
  completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is
  attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider
  pc_resource_desc, S_OK for queue slots past the PC table.
- Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its
  undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base
  list proxy, its null-view slot 70 and its refusing slot 133.

Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp):
- Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra
  cases added; main's --env-slots-74 and #984's --env-slots-70.
- Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy,
  the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases.

D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h,
frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp,
d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp,
vk_pipeline_check.cpp, vk_test_device.h):
- Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's
  ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's
  origin, so both pools run on disjoint sets of textures.
- frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter.
- main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4
  stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980).
- shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it.
- Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count
  refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it.

Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp,
runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp):
- ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on
  ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file.
- gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries.
- Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped.

Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1,
make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py,
runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md,
runtime/README.md):
- Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake.
- rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's
  restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped.
- shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags.
- shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants.

One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC
compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

6 participants