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

Closed
github-bot wants to merge 1 commit from gh-pr/728/head into gh-pr/728/base
Owner

@⁠promise-ssss on GitHub · 2026-11-24 13:00 UTC · original
promise-ssss:fix/xs-create-command-list-iid → main · +10 −2 · 1 files · 1 commits · closed without merging

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)
**@⁠promise-ssss** on GitHub · 2026-11-24 13:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/728) `promise-ssss:fix/xs-create-command-list-iid` → `main` · +10 −2 · 1 files · 1 commits · closed without merging 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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:18:22 +00:00
github-bot closed this pull request 2026-11-26 09:18:22 +00:00
Author
Owner

@⁠djrolfes on GitHub · 2026-11-24 13:15 UTC · original

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.

**@⁠djrolfes** on GitHub · 2026-11-24 13:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7132561189) 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.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 13:15 UTC · original · approved these changes

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

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 13:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/728#pullrequestreview-6039836907) · **approved these changes** LGTM. Critical fallback for console-specific command-list IIDs passed to CreateCommandListX: gracefully falls back to ID3D12GraphicsCommandList on E_NOINTERFACE before wrapping.
Author
Owner

@⁠djrolfes on GitHub · 2026-11-24 14:07 UTC · original

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.

**@⁠djrolfes** on GitHub · 2026-11-24 14:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7133872052) 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.
Author
Owner

@⁠BubsMcgee on GitHub · 2026-11-25 12:19 UTC · original

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.

**@⁠BubsMcgee** on GitHub · 2026-11-25 12:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7162224342) 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.
Author
Owner

@⁠promise-ssss on GitHub · 2026-11-26 00:14 UTC · original

Superseded by the slot 73 fallback now on main.

**@⁠promise-ssss** on GitHub · 2026-11-26 00:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/728#issuecomment-7178542701) Superseded by the slot 73 fallback now on main.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.