d3d12_xs: restore the console command-list IID mapping lost in a merge #641

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

@⁠ExCorvus on GitHub · 2026-11-24 10:44 UTC · original
ExCorvus:restore/console-list-iid-mapping → main · +93 −4 · 3 files · 1 commits · closed without merging

d3d12_xs: restore the console command-list IID mapping lost in a merge

Claimed in the coordination issue as: none exists yet — this PR is the claim, as with PR #2.
Relates to issue #47 (the boot ladder): the command-list IID wall its comments name after the
slot-26 and copy-queue stops.

AI-assisted: yes (Qwen4 Max Preview / Alibaba Token Plan).

What and why

3c95a4a95 ("d3d12_xs: map the console list IID in QI and CreateCommandListX") added
runtime/shims/d3d12_xs_command_list_iid.h — the measured console→PC IID pair for device
slot 73 — and wired it into list_query_interface and the slot-73 path. The commit is an
ancestor of main, but the header is not in the tree
(git ls-tree main -- runtime/shims/d3d12_xs_command_list_iid.h is empty) and both wiring points forward the
requested IID unchanged again. A later merge dropped them — the same loss pattern PR #131
restored for the DirectStorage shim.

The retail executable asks slot 73 (CreateCommandListX) for the console command-list IID
c3827890-4024-474c-98cf-645b51dc4874. Unmapped, the PC CreateCommandList refuses it
(the Vulkan layer logs QueryInterface: unknown IID), the slot returns a failing HRESULT,
and the title asserts on it — a fatal int3 right after the call, confirmed statically with
tools/int3_cause.py (the assert branches on the slot-73 result's sign).

The change

  • Restore the header byte-for-byte from 3c95a4a95 (blob fc149cea9); its provenance
    notes (TomBox GPL-3.0 measurement, Windows SDK 10.0.26100.0) stay intact.
  • Map the requested IID through command_list_iid_for_pc in list_query_interface and in
    the slot-73 CreateCommandList call, adapted to the current ListProxy: wrap_list QIs
    through list_query_interface, so the wrapped proxy answers the console IID as well.
  • xs_proxy_mock_test: a console-IID slot-73 case asserts the mapped PC IID
    (ID3D12GraphicsCommandList6) reaches CreateCommandList and the proxy's QI answers the
    console IID.

No behavior change for PC IIDs or IIDs outside the table (forwarded unchanged, logged once,
as the original header documents).

Tested

Host: Windows 11, AMD Radeon RX 9070 XT, driver 32.0.32029.2010, LEONIDA_D3D12=vulkan.

  • xs_proxy_mock_test builds and exits 0 with the new case.
  • gta6rt --run on my own 1.0.2.1 package (108/108 files SHA-256 verified), main
    8f481cf16 + this change (the three touched files are byte-identical at 21625bca8):
    • Before: 13 D3D12 calls; CreateCommandList refuses the console IID; the title's
      fatal assert ends the run ~2.2 s in.
    • After: 1,639 D3D12 calls — command lists, ~1,600 allocators, slot 25
      GetResourceAllocationInfo, slot 127 CreateCommittedResource3, SRV/RTV/UAV creation —
      before the next, unrelated assert (a bounds check on a title global; a new rung on the
      #47 ladder, not a regression).
  • The restore applies cleanly on 21625bca8; the header is byte-identical to the 3c95a4a95
    blob. If main moves again, the two wiring points are small and local.
  • Not tested: Wine, other GPUs, a full retail boot (the project does not boot yet).

Checklist

  • No game data, keys or decryption in the diff, tests or this description (call shapes,
    export names and counts only; the IID is a public-interface identifier already named
    in 3c95a4a95's public commit message).
  • No new translator rule (not applicable).
  • Restored code keeps its original provenance comments; no GPL-incompatible code.
**@⁠ExCorvus** on GitHub · 2026-11-24 10:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/641) `ExCorvus:restore/console-list-iid-mapping` → `main` · +93 −4 · 3 files · 1 commits · closed without merging # d3d12_xs: restore the console command-list IID mapping lost in a merge Claimed in the coordination issue as: **none exists yet** — this PR is the claim, as with PR #2. Relates to issue #47 (the boot ladder): the command-list IID wall its comments name after the slot-26 and copy-queue stops. AI-assisted: yes (Qwen4 Max Preview / Alibaba Token Plan). ## What and why `3c95a4a95` ("d3d12_xs: map the console list IID in QI and CreateCommandListX") added `runtime/shims/d3d12_xs_command_list_iid.h` — the measured console→PC IID pair for device slot 73 — and wired it into `list_query_interface` and the slot-73 path. **The commit is an ancestor of main, but the header is not in the tree** (`git ls-tree main -- runtime/shims/d3d12_xs_command_list_iid.h` is empty) and both wiring points forward the requested IID unchanged again. A later merge dropped them — the same loss pattern PR #131 restored for the DirectStorage shim. The retail executable asks slot 73 (`CreateCommandListX`) for the console command-list IID `c3827890-4024-474c-98cf-645b51dc4874`. Unmapped, the PC `CreateCommandList` refuses it (the Vulkan layer logs `QueryInterface: unknown IID`), the slot returns a failing HRESULT, and the title asserts on it — a fatal `int3` right after the call, confirmed statically with `tools/int3_cause.py` (the assert branches on the slot-73 result's sign). ## The change - Restore the header **byte-for-byte** from `3c95a4a95` (blob `fc149cea9`); its provenance notes (TomBox GPL-3.0 measurement, Windows SDK 10.0.26100.0) stay intact. - Map the requested IID through `command_list_iid_for_pc` in `list_query_interface` and in the slot-73 `CreateCommandList` call, adapted to the current `ListProxy`: `wrap_list` QIs through `list_query_interface`, so the wrapped proxy answers the console IID as well. - `xs_proxy_mock_test`: a console-IID slot-73 case asserts the mapped PC IID (`ID3D12GraphicsCommandList6`) reaches `CreateCommandList` and the proxy's QI answers the console IID. No behavior change for PC IIDs or IIDs outside the table (forwarded unchanged, logged once, as the original header documents). ## Tested Host: Windows 11, AMD Radeon RX 9070 XT, driver `32.0.32029.2010`, `LEONIDA_D3D12=vulkan`. - `xs_proxy_mock_test` builds and exits 0 with the new case. - `gta6rt --run` on my own 1.0.2.1 package (108/108 files SHA-256 verified), main `8f481cf16` + this change (the three touched files are byte-identical at `21625bca8`): - **Before:** 13 D3D12 calls; `CreateCommandList` refuses the console IID; the title's fatal assert ends the run ~2.2 s in. - **After:** 1,639 D3D12 calls — command lists, ~1,600 allocators, slot 25 `GetResourceAllocationInfo`, slot 127 `CreateCommittedResource3`, SRV/RTV/UAV creation — before the next, unrelated assert (a bounds check on a title global; a new rung on the #47 ladder, not a regression). - The restore applies cleanly on `21625bca8`; the header is byte-identical to the `3c95a4a95` blob. If main moves again, the two wiring points are small and local. - Not tested: Wine, other GPUs, a full retail boot (the project does not boot yet). ## Checklist - [x] No game data, keys or decryption in the diff, tests or this description (call shapes, export names and counts only; the IID is a public-interface identifier already named in `3c95a4a95`'s public commit message). - [x] No new translator rule (not applicable). - [x] Restored code keeps its original provenance comments; no GPL-incompatible code.
3c95a4a95 ("d3d12_xs: map the console list IID in QI and CreateCommandListX")
added d3d12_xs_command_list_iid.h and wired it into list_query_interface and
the slot-73 CreateCommandListX path. The commit is an ancestor of main, but
the header is not in the tree and both wiring points forward the requested
IID unchanged again: a later merge dropped them, the same kind of loss PR
#131 restored for the DirectStorage shim.

The retail executable asks slot 73 for the console command-list IID
c3827890-4024-474c-98cf-645b51dc4874. Unmapped, the PC CreateCommandList
refuses it and the title asserts on the failing HRESULT.

- Restore the header byte-for-byte from 3c95a4a95 (the measured console->PC
  pair and its TomBox/Windows SDK provenance notes intact).
- Map the requested IID in list_query_interface and in the slot-73
  CreateCommandList call, adapted to the current ListProxy: wrap_list QIs
  through list_query_interface, so the proxy answers the console IID too.
- xs_proxy_mock_test: a console-IID slot-73 case checks the mapped PC IID
  reaches CreateCommandList and the proxy's QI answers the console IID.

Tests: xs_proxy_mock_test exits 0. On Windows 11 / RX 9070 XT with
LEONIDA_D3D12=vulkan, gta6rt --run on a verified 1.0.2.1 package goes from
13 D3D12 calls (CreateCommandList refused, title assert) to 1,639 calls
through command lists, committed resources and views before the next,
unrelated assert.

AI-assisted: Qwen4 Max Preview (Alibaba Token Plan).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:13:23 +00:00
github-bot closed this pull request 2026-11-26 09:13:23 +00:00
Author
Owner

@⁠ExCorvus on GitHub · 2026-11-24 10:47 UTC · original

Cross-links for the maintainers: issue #523 independently measured the same stop on the same base (8f481cf1): 13 D3D12 calls without the mapping, 1,639 with it — the same numbers this PR's test section reports. PRs #601 (RT-XS-LIST-X-IID, claimed in #14), #142, #359 and #445 are parallel approaches to the same console IID.

This PR's distinguishing point is the root cause: the mapping already existed (3c95a4a95, the measured console→PC pair with its provenance notes) and was lost in a later merge — the commit is an ancestor of main but the header is absent from the tree, the same loss pattern #131 restored for DirectStorage. The restore is byte-identical to the accepted code plus the two wirings adapted to the current ListProxy, so it is the smallest option if you prefer to keep the original measured table. Happy to defer to whichever approach lands; the boot evidence is identical.

**@⁠ExCorvus** on GitHub · 2026-11-24 10:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/641#issuecomment-7129249047) Cross-links for the maintainers: issue #523 independently measured the same stop on the same base (`8f481cf1`): 13 D3D12 calls without the mapping, 1,639 with it — the same numbers this PR's test section reports. PRs #601 (RT-XS-LIST-X-IID, claimed in #14), #142, #359 and #445 are parallel approaches to the same console IID. This PR's distinguishing point is the root cause: the mapping already existed (`3c95a4a95`, the measured console→PC pair with its provenance notes) and was lost in a later merge — the commit is an ancestor of main but the header is absent from the tree, the same loss pattern #131 restored for DirectStorage. The restore is byte-identical to the accepted code plus the two wirings adapted to the current ListProxy, so it is the smallest option if you prefer to keep the original measured table. Happy to defer to whichever approach lands; the boot evidence is identical.
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 10:52 UTC · original · reviewed

Reviewing from my side (I have no write access on this repository, so this is a review, not a gate). Two things, and the second is a caution before merging.

Their history claim checks out

From a clone that carries upstream main as a remote:

  • git merge-base --is-ancestor 3c95a4a95 refs/remotes/succ/main — it is an ancestor of main.
  • git cat-file -e 3c95a4a95:runtime/shims/d3d12_xs_command_list_iid.h — the blob is there, 3069 bytes.
  • git log --oneline refs/remotes/succ/main -- runtime/shims/d3d12_xs_command_list_iid.h — empty. git grep -c c3827890 refs/remotes/succ/main -- runtime docs — no hits. main carries neither the file nor the GUID.
  • I then scanned every merge in 3c95a4a95..main (457 of them) for one where a parent had the file and the merge result did not. There is exactly one: 6dece9231 "Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims" — parent d2d9b2657 has the file, the merge tree does not. So the drop has an exact cause, and it is the same loss pattern PR #131 describes for the DirectStorage shim.

I also checked the PC half of the table against the installed SDK rather than taking it on trust: Include/10.0.26100.0/um/d3d12.h:31129 declares MIDL_INTERFACE("c3827890-e548-4cfa-96cf-5689a9370f80") ID3D12GraphicsCommandList6. The mapping is verifiable from the SDK. It also explains an oddity I had recorded about the console GUID — that it shares Data1 with IID_ID3D12GraphicsCommandList6 — which is what the same interface number looks like from the two sides.

Caution: my open PR #601 answers the same IID

#601 (mine) declares the same GUID inline in d3d12_xs_device.cpp, widens is_list_iid with it, answers it in list_query_interface without consulting the real object, and rebuilds the slot-73 call as ID3D12GraphicsCommandList when the console IID was asked. It touches runtime/shims/d3d12_xs_device.cpp and runtime/test/xs_proxy_mock_test.cpp — both of which this PR also touches — so the two cannot both merge without a conflict. Someone should pick one rather than merge both and resolve it by hand.

On the merits I think this PR is the better change and I would merge it and close mine:

  • it restores a file the project already had, provenance notes intact (the GPL-3.0 measurement, the SDK version), instead of restating the constant inline;
  • it maps the console IID onto a PC interface that genuinely exists, rather than answering an IID no PC object implements;
  • mapping first leaves is_list_iid and supports_iid alone instead of widening both.

Two small things mine has that are worth carrying over, both optional: a one-line log naming the IID slot 73 was asked for (is_pc_command_list_iid covers the same ground from the other direction — and note it stops at ID3D12GraphicsCommandList7, so a title asking for L8 would take the "not in the table" branch and log once), and a docs/retail_boot_chain.md row for this wall, which this PR does not update. If this one merges, I will re-target the documentation part onto it and close #601: I would rather this land once, with the original header.

About the "next, unrelated assert" this run reaches

I have measured that rung on my own copy of the same package version, on an AMD host (gfx1036 iGPU, LEONIDA_D3D12=vulkan), and it is worth naming before someone else spends time on it:

  • It is the title's own size check right after the first descriptor heap: (end − start) + a title global, compared against 0x1FFFFF at exe+0x247af14–exe+0x247af25, with the int 3 at exe+0x247af2d. In my runs the span value is 64 MiB, picked from two constants the title selects (64 MiB / 82 MiB) through a flag read out of its own data; no allocation of that size appears anywhere in the run.
  • The record for that span is registered and retired by the title's own code (exe+0x5c8f990, and the unlink in the routine starting at exe+0x5c8fa70), so it is not something the runtime leaked. The list it sits on is reachable two ways: directly, and as element 128 of a header table at exe+0x6843370 indexed by bits 16..23 of a category value. Details in the tracking issue (results 7128602446 and 7128744918).
  • LEONIDA_GUEST_POKE (the loader setting in #582, "<module basename>:<rva hex>:<hex bytes>", ;-separated) lets anyone replace CC with 90 in one command. Suppressing both title traps takes the same boot past this assert and through device-table entries 25, 127, 20, 16, 62, 27, 39, 41, 61 and 70, the queue, fence and allocator proxies, and two heap allocations — and it then stops inside the runtime: 0xC0000005 in rt::d3d12::anonymous namespace'::Device::CreateMetaCommand, reached from rt::d3d12_xs::anonymous namespace'::proxy_slot<61>, i.e. the console device table's entry 61 forwarded to the PC device's 61st slot. That is the rung after the one this PR uncovers, and it reads like the same console→PC mapping question, which is what #47's ladder is for.

I have not run this branch, so I am not reviewing the test case they added or the Wine behaviour.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 10:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/641#pullrequestreview-6037896360) · **reviewed** Reviewing from my side (I have no write access on this repository, so this is a review, not a gate). Two things, and the second is a caution before merging. ## Their history claim checks out From a clone that carries upstream `main` as a remote: - `git merge-base --is-ancestor 3c95a4a95 refs/remotes/succ/main` — it is an ancestor of `main`. - `git cat-file -e 3c95a4a95:runtime/shims/d3d12_xs_command_list_iid.h` — the blob is there, 3069 bytes. - `git log --oneline refs/remotes/succ/main -- runtime/shims/d3d12_xs_command_list_iid.h` — empty. `git grep -c c3827890 refs/remotes/succ/main -- runtime docs` — no hits. `main` carries neither the file nor the GUID. - I then scanned every merge in `3c95a4a95..main` (457 of them) for one where a parent had the file and the merge result did not. There is **exactly one**: `6dece9231` "Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims" — parent `d2d9b2657` has the file, the merge tree does not. So the drop has an exact cause, and it is the same loss pattern PR #131 describes for the DirectStorage shim. I also checked the PC half of the table against the installed SDK rather than taking it on trust: `Include/10.0.26100.0/um/d3d12.h:31129` declares `MIDL_INTERFACE("c3827890-e548-4cfa-96cf-5689a9370f80") ID3D12GraphicsCommandList6`. The mapping is verifiable from the SDK. It also explains an oddity I had recorded about the console GUID — that it shares `Data1` with `IID_ID3D12GraphicsCommandList6` — which is what the same interface number looks like from the two sides. ## Caution: my open PR #601 answers the same IID #601 (mine) declares the same GUID inline in `d3d12_xs_device.cpp`, widens `is_list_iid` with it, answers it in `list_query_interface` without consulting the real object, and rebuilds the slot-73 call as `ID3D12GraphicsCommandList` when the console IID was asked. It touches `runtime/shims/d3d12_xs_device.cpp` and `runtime/test/xs_proxy_mock_test.cpp` — both of which this PR also touches — so the two cannot both merge without a conflict. Someone should pick one rather than merge both and resolve it by hand. On the merits I think this PR is the better change and I would merge it and close mine: - it restores a file the project already had, provenance notes intact (the GPL-3.0 measurement, the SDK version), instead of restating the constant inline; - it maps the console IID onto a PC interface that genuinely exists, rather than answering an IID no PC object implements; - mapping first leaves `is_list_iid` and `supports_iid` alone instead of widening both. Two small things mine has that are worth carrying over, both optional: a one-line log naming the IID slot 73 was asked for (`is_pc_command_list_iid` covers the same ground from the other direction — and note it stops at `ID3D12GraphicsCommandList7`, so a title asking for L8 would take the "not in the table" branch and log once), and a `docs/retail_boot_chain.md` row for this wall, which this PR does not update. If this one merges, I will re-target the documentation part onto it and close #601: I would rather this land once, with the original header. ## About the "next, unrelated assert" this run reaches I have measured that rung on my own copy of the same package version, on an AMD host (`gfx1036` iGPU, `LEONIDA_D3D12=vulkan`), and it is worth naming before someone else spends time on it: - It is the title's own size check right after the first descriptor heap: `(end − start) + a title global`, compared against `0x1FFFFF` at `exe+0x247af14`–`exe+0x247af25`, with the `int 3` at `exe+0x247af2d`. In my runs the span value is 64 MiB, picked from two constants the title selects (64 MiB / 82 MiB) through a flag read out of its own data; no allocation of that size appears anywhere in the run. - The record for that span is registered and retired by the title's own code (`exe+0x5c8f990`, and the unlink in the routine starting at `exe+0x5c8fa70`), so it is not something the runtime leaked. The list it sits on is reachable two ways: directly, and as element 128 of a header table at `exe+0x6843370` indexed by bits 16..23 of a category value. Details in the tracking issue (results 7128602446 and 7128744918). - `LEONIDA_GUEST_POKE` (the loader setting in #582, `"<module basename>:<rva hex>:<hex bytes>"`, `;`-separated) lets anyone replace `CC` with `90` in one command. Suppressing both title traps takes the same boot past this assert and through device-table entries 25, 127, 20, 16, 62, 27, 39, 41, 61 and 70, the queue, fence and allocator proxies, and two heap allocations — and it then stops **inside the runtime**: `0xC0000005` in `rt::d3d12::`anonymous namespace'::Device::CreateMetaCommand`, reached from `rt::d3d12_xs::`anonymous namespace'::proxy_slot<61>`, i.e. the console device table's entry 61 forwarded to the PC device's 61st slot. That is the rung after the one this PR uncovers, and it reads like the same console→PC mapping question, which is what #47's ladder is for. I have not run this branch, so I am not reviewing the test case they added or the Wine behaviour. Written with an AI assistant.
Author
Owner

@⁠DesertGamer on GitHub · 2026-11-24 13:28 UTC · original

Measured on a second native-Windows machine, as support for merging this PR (fiestorra recommends it over the other slot-73 answers on #601). Windows 11, RTX 5070, driver 617.14, LEONIDA_D3D12=vulkan, own 1.0.2.1 copy, gta6rt --run for 200 s (my timeout ends it).

Stack: main 21625bca8 + this PR + #427 + #727 (the rebased #219) + #602 + #387 + #357 + #432. Result: 400,154 PresentX ok, 14,469,902 D3D12 calls, no exception. The same stack with #359 in place of this PR reached 401,976 PresentX ok in 200 s, and with #142, 888,983 in 420 s (#14), so on this machine the three slot-73 answers behave the same once the rest of the stack is there. On main alone with this PR the run stops after 1,639 D3D12 calls on the title's int3, as before the other PRs.

No game data: counts only.

AI-assisted: yes (Claude Code, Sonnet 5.5)

**@⁠DesertGamer** on GitHub · 2026-11-24 13:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/641#issuecomment-7132879890) Measured on a second native-Windows machine, as support for merging this PR (fiestorra recommends it over the other slot-73 answers on #601). Windows 11, RTX 5070, driver 617.14, `LEONIDA_D3D12=vulkan`, own 1.0.2.1 copy, `gta6rt --run` for 200 s (my timeout ends it). Stack: `main` 21625bca8 + this PR + #427 + #727 (the rebased #219) + #602 + #387 + #357 + #432. Result: 400,154 `PresentX ok`, 14,469,902 D3D12 calls, no exception. The same stack with #359 in place of this PR reached 401,976 `PresentX ok` in 200 s, and with #142, 888,983 in 420 s (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14), so on this machine the three slot-73 answers behave the same once the rest of the stack is there. On `main` alone with this PR the run stops after 1,639 D3D12 calls on the title's int3, as before the other PRs. No game data: counts only. AI-assisted: yes (Claude Code, Sonnet 5.5)
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:50 UTC · original

Thanks for the careful history work. The merge that dropped the header is well documented here. Closing it because main already has the fix:

  • #359 is merged and handles the same slot-73 stop: the console list IID is created as ID3D12GraphicsCommandList in one call and the list proxy answers QueryInterface for it, with a mock test.
  • The owner asked on #142 to keep console IIDs out of the repository. #359 already names this one once, inline, and this PR would add a second copy in a new header and table.
  • It conflicts with main on the same lines (list_query_interface, proxy_create_command_list_x, the slot-73 test).
  • The boot result is the same: DesertGamer's run above shows #359 and this PR reaching the same point on the same stack.
  • If a log line for unknown list IIDs is still wanted, a small follow-up on top of main would be welcome.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 19:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/641#issuecomment-7142663251) Thanks for the careful history work. The merge that dropped the header is well documented here. Closing it because `main` already has the fix: - #359 is merged and handles the same slot-73 stop: the console list IID is created as `ID3D12GraphicsCommandList` in one call and the list proxy answers `QueryInterface` for it, with a mock test. - The owner asked on #142 to keep console IIDs out of the repository. #359 already names this one once, inline, and this PR would add a second copy in a new header and table. - It conflicts with `main` on the same lines (`list_query_interface`, `proxy_create_command_list_x`, the slot-73 test). - The boot result is the same: DesertGamer's run above shows #359 and this PR reaching the same point on the same stack. - If a log line for unknown list IIDs is still wanted, a small follow-up on top of `main` would be welcome. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

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