d3d12_xs: fall back to ID3D12GraphicsCommandList on E_NOINTERFACE in CreateCommandListX (XS-CREATE-COMMAND-LIST-IID) #728

Closed
promise-ssss wants to merge 1 commit from upstream-pr/728 into main
promise-ssss commented 2026-11-24 13:00:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by promise-ssss on 2026-11-24T13:00:11Z.


Claimed in the coordination issue as: XS-CREATE-COMMAND-LIST-IID

What and why

In
untime/shims/d3d12_xs_device.cpp (proxy_create_command_list_x, slot 73), passing the caller's
iid directly to self->real->CreateCommandList(...) fails with E_NOINTERFACE when a console caller requests a console-only command-list IID not implemented by PC runtimes/layers (matching docs/retail_boot_chain.md §3.3).

When CreateCommandList returns E_NOINTERFACE (and *riid != IID_IUnknown), fall back to creating ID3D12GraphicsCommandList and wrapping it in ListProxy via wrap_list, without hardcoding any retail IID bytes.

Tested

  • ctest --test-dir runtime/build --output-on-failure -R d3d12_xs|xs_proxy: 6/6 passed (0.25 s)
  • gta6rt.exe --run (own 1.0.2.1 copy, Vulkan backend): CreateCommandListX now succeeds instead of failing at the first command list, advancing the D3D12 trace from 13 calls to 1,644 calls (1,619 ok).
  • python -I scripts/check_no_game_data.py runtime/shims/d3d12_xs_device.cpp: passed

GPUs tested: NVIDIA GeForce RTX 3060 Laptop GPU, Windows 11

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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5472621377 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/728). Originally posted by [promise-ssss](https://github.com/promise-ssss) on 2026-11-24T13:00:11Z. --- Claimed in the coordination issue as: XS-CREATE-COMMAND-LIST-IID ### What and why In untime/shims/d3d12_xs_device.cpp (proxy_create_command_list_x, slot 73), passing the caller's iid directly to self->real->CreateCommandList(...) fails with E_NOINTERFACE when a console caller requests a console-only command-list IID not implemented by PC runtimes/layers (matching docs/retail_boot_chain.md §3.3). When CreateCommandList returns E_NOINTERFACE (and *riid != IID_IUnknown), fall back to creating ID3D12GraphicsCommandList and wrapping it in ListProxy via wrap_list, without hardcoding any retail IID bytes. ### Tested - `ctest --test-dir runtime/build --output-on-failure -R d3d12_xs|xs_proxy`: 6/6 passed (0.25 s) - `gta6rt.exe --run` (own 1.0.2.1 copy, Vulkan backend): CreateCommandListX now succeeds instead of failing at the first command list, advancing the D3D12 trace from 13 calls to 1,644 calls (1,619 ok). - `python -I scripts/check_no_game_data.py runtime/shims/d3d12_xs_device.cpp`: passed GPUs tested: NVIDIA GeForce RTX 3060 Laptop GPU, Windows 11 AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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)
djrolfes commented 2026-11-24 13:15:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-24T13:15:02Z.


Retested on Linux under Wine, independent of the author's Windows run — the PR clears its blocker here:

  • Build: this PR's head df5505f9b only (no other boot branches), clang-cl/xwin cross-build, SDL3 fetched (LEONIDA_SDL3_FETCH=ON), Vulkan backend, Wine 11.22, RTX 3070 Ti (NVIDIA 620.73.04). Run inside an offline sandbox (network off, package read-only), bounded.
  • Before the PR (same environment, main + no boot PRs): the run stops at the first CreateCommandListX — the console command-list IID QueryInterface refuses and the title's own fail-fast ends the process.
  • With the PR: CreateCommandListX succeeds (list proxy wraps the PC list, 82 PC vtable slots) and the run continues: four descriptor heaps created, heap CPU/GPU handle getters, device slots 18/19/17, slot 70 (SRV from raw words), slot 25, slot 127 (Xbox CreateCommittedResource3, a buffer; xbox flags folded to PC bits) and slot 20.
  • New stop (not this PR's concern): the title's own fail-fast in its physical-memory bootstrap, where a value computed from a size delta plus a global base must stay under 2 MiB; at the assert it is 0x4000000. This is the physical-pages/large-pages neighborhood of docs/retail_boot_chain.md stops 10–11; per #479, main's tree is missing some boot-branch content there, which fits.

No game data quoted; raw logs stay local. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7132561189 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7132561189). Originally posted by [djrolfes](https://github.com/djrolfes) on 2026-11-24T13:15:02Z. --- Retested on Linux under Wine, independent of the author's Windows run — the PR clears its blocker here: - **Build**: this PR's head `df5505f9b` only (no other boot branches), clang-cl/xwin cross-build, SDL3 fetched (`LEONIDA_SDL3_FETCH=ON`), Vulkan backend, Wine 11.22, RTX 3070 Ti (NVIDIA 620.73.04). Run inside an offline sandbox (network off, package read-only), bounded. - **Before the PR** (same environment, `main` + no boot PRs): the run stops at the first `CreateCommandListX` — the console command-list IID `QueryInterface` refuses and the title's own fail-fast ends the process. - **With the PR**: `CreateCommandListX` succeeds (list proxy wraps the PC list, 82 PC vtable slots) and the run continues: four descriptor heaps created, heap CPU/GPU handle getters, device slots 18/19/17, slot 70 (SRV from raw words), slot 25, slot 127 (Xbox `CreateCommittedResource3`, a buffer; xbox flags folded to PC bits) and slot 20. - **New stop** (not this PR's concern): the title's own fail-fast in its physical-memory bootstrap, where a value computed from a size delta plus a global base must stay under 2 MiB; at the assert it is `0x4000000`. This is the physical-pages/large-pages neighborhood of `docs/retail_boot_chain.md` stops 10–11; per #479, `main`'s tree is missing some boot-branch content there, which fits. No game data quoted; raw logs stay local. AI-assisted.
abnalstlll-byte commented 2026-11-24 13:15:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T13:15:16Z.

Review: APPROVED


LGTM. Critical fallback for console-specific command-list IIDs passed to CreateCommandListX: gracefully falls back to ID3D12GraphicsCommandList on E_NOINTERFACE before wrapping.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6039836907 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/728#pullrequestreview-6039836907). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T13:15:16Z. **Review:** APPROVED --- LGTM. Critical fallback for console-specific command-list IIDs passed to CreateCommandListX: gracefully falls back to ID3D12GraphicsCommandList on E_NOINTERFACE before wrapping.
djrolfes commented 2026-11-24 14:07:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-24T14:07:17Z.


Follow-up with the runbook tool (my capture-wrapper bug was fixed, so --trace/--trace-d3d12 now work in the offline sandbox): tools/boot_trace.py on this branch under Wine 11.22 / RTX 3070 Ti summarizes exactly your Windows counts — 1,644 D3D12 calls (1,619 ok, 5 CreateCommandList failures answered by the fallback), last recorded call CreateUnorderedAccessView, and the run's final exception 0x80000003 with a stack that is entirely game frames (the physical-pool span assert from the coordination thread). One XMemAllocatePhysicalPages event (attributes 0x280) precedes device creation. Counts and error classes only; traces stay local.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7133872052 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7133872052). Originally posted by [djrolfes](https://github.com/djrolfes) on 2026-11-24T14:07:17Z. --- Follow-up with the runbook tool (my capture-wrapper bug was fixed, so `--trace`/`--trace-d3d12` now work in the offline sandbox): `tools/boot_trace.py` on this branch under Wine 11.22 / RTX 3070 Ti summarizes exactly your Windows counts — 1,644 D3D12 calls (1,619 ok, 5 `CreateCommandList` failures answered by the fallback), last recorded call `CreateUnorderedAccessView`, and the run's final exception `0x80000003` with a stack that is entirely game frames (the physical-pool span assert from the coordination thread). One `XMemAllocatePhysicalPages` event (attributes 0x280) precedes device creation. Counts and error classes only; traces stay local.
BubsMcgee commented 2026-11-25 12:19:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T12:19:41Z.


Checked this against current main 0d80bc5df. The fallback it adds is already the behavior in runtime/shims/d3d12_xs_device.cpp, proxy_create_command_list_x (slot 73): main now always creates the PC list with __uuidof(ID3D12GraphicsCommandList) through proxy_create_command_list, then

  • returns it when *riid == ID3D12GraphicsCommandList (~line 3852),
  • otherwise QueryInterfaces the requested IID (~line 3857),
  • and if that fails, answers with the console list proxy itself (~line 3866: "slot 73 asks for a list IID the PC does not know; answered with the console list proxy").

So a console-only IID no longer fails with E_NOINTERFACE; it gets a working list. This PR now conflicts only because main reworked the same function, and the E_NOINTERFACE-then-ID3D12GraphicsCommandList retry is redundant unless CreateCommandList itself returns E_NOINTERFACE for ID3D12GraphicsCommandList (it does not). I'd suggest closing it as superseded. If you have a trace where current main still fails at this slot, please share it and I'll retest.

Environment for the check: Windows 11 Pro 26300, RTX 3080 Ti (driver 616.64), main 0d80bc5df. I applied the PR's diff locally only to confirm the conflict is the same function; no new code was needed. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7162224342 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7162224342). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T12:19:41Z. --- Checked this against current `main` `0d80bc5df`. The fallback it adds is already the behavior in `runtime/shims/d3d12_xs_device.cpp`, `proxy_create_command_list_x` (slot 73): main now always creates the PC list with `__uuidof(ID3D12GraphicsCommandList)` through `proxy_create_command_list`, then - returns it when `*riid == ID3D12GraphicsCommandList` (~line 3852), - otherwise `QueryInterface`s the requested IID (~line 3857), - and if that fails, answers with the console list proxy itself (~line 3866: "slot 73 asks for a list IID the PC does not know; answered with the console list proxy"). So a console-only IID no longer fails with `E_NOINTERFACE`; it gets a working list. This PR now conflicts only because main reworked the same function, and the `E_NOINTERFACE`-then-`ID3D12GraphicsCommandList` retry is redundant unless `CreateCommandList` itself returns `E_NOINTERFACE` for `ID3D12GraphicsCommandList` (it does not). I'd suggest closing it as superseded. If you have a trace where current main still fails at this slot, please share it and I'll retest. Environment for the check: Windows 11 Pro 26300, RTX 3080 Ti (driver 616.64), main `0d80bc5df`. I applied the PR's diff locally only to confirm the conflict is the same function; no new code was needed. AI-assisted.
promise-ssss commented 2026-11-26 00:14:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by promise-ssss on 2026-11-26T00:14:10Z.


Superseded by the slot 73 fallback now on main.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7178542701 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7178542701). Originally posted by [promise-ssss](https://github.com/promise-ssss) on 2026-11-26T00:14:10Z. --- Superseded by the slot 73 fallback now on main.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!728
No description provided.