docs(d3d12_xs_surface): measured arity of device extension slots (D3D12-EXTENSION-SLOT-ARITY) #1038

Merged
robot00f merged 1 commit from upstream-pr/1038 into main 2026-11-25 21:28:18 +00:00
robot00f commented 2026-11-24 17:06:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-24T17:06:30Z.


Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7138274590

What

docs/d3d12_xs_surface.md gets a new section 5.2 that measures, per slot, the arity and the receiver of the console device extension slots 86 (+0x2B0), 101 (+0x328), 108 (+0x360), 132 (+0x420) and 133 (+0x428), plus offset +0x418 (131).

The image has 243 indirect call [reg+disp] sites at those six offsets and most are not on the device, so each site is classified: a site only counts as a device site when a backward definition chain ends in a full-width load of the device pointer, which the title keeps in a block of .data aliases (0x1475DF000-0x1475DF048, 0x148759D00) filled by one constructor (0x1424785D4-0x142478621). Result: 86 -> 1 site, 101 -> 1, 108 -> 2, 132 -> 1, 133 -> 5, 131 -> 0.

Measured shapes (caller side, rcx = device unless struct-return):

  • 86: (desc, &IID_ID3D12PipelineState, out) — matches CreatePipelineState -> PC slot 47 in docs/d3d12_vulkan.md §3.1.
  • 101: (desc{3, index, ptr}, &IID_ID3D12StateObject, out) — matches CreateStateObject -> PC slot 62 in docs/d3d12_vulkan.md §3.1.
  • 108: (out16, device, 1, 1, ptr, ptr) — C-ABI 16-byte struct return in rcx, matching GetResourceAllocationInfo2 -> PC slot 68 in docs/d3d12_vulkan.md §3.1.
  • 132: (3) — single integer/enum argument on the device; unnamed.
  • 133: (va, &D3D12_RESOURCE_DESC, state, clear, &IID_ID3D12Resource, out) — matches CreatePlacedResourceX in docs/retail_boot_chain.md §3.4.

Why

The page previously had no device slot map past the presentation block. Cross-checking the static device-receiver chains against docs/d3d12_vulkan.md §3.1 and docs/retail_boot_chain.md §3.4 confirms slots 86, 101, 108 and 133 from the executable itself, pins down slot 132's single device site, and shows offset +0x418 (131) has 26 raw sites and 0 device receivers (so §9 counts five device slots, leaving 131 open).

Tested

  • python -I scripts/check_no_game_data.py docs/d3d12_xs_surface.md -> exit 0
  • python -I tests/test_d3d12_xs_surface.py, tests/test_docs_links.py, tests/test_docs_table_rows.py, tests/test_docs_repo_paths.py, tests/test_docs_cli_flags.py -> OK
  • Static only; the executable was never run.

GPUs tested: n/a
AI-assisted: yes (Antigravity, Gemini 4 Carbon)

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476771827 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1038). Originally posted by [robot00f](https://github.com/robot00f) on 2026-11-24T17:06:30Z. --- Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7138274590 ## What `docs/d3d12_xs_surface.md` gets a new section 5.2 that measures, per slot, the **arity and the receiver** of the console device extension slots 86 (`+0x2B0`), 101 (`+0x328`), 108 (`+0x360`), 132 (`+0x420`) and 133 (`+0x428`), plus offset `+0x418` (131). The image has 243 indirect `call [reg+disp]` sites at those six offsets and most are **not** on the device, so each site is classified: a site only counts as a device site when a backward definition chain ends in a full-width load of the device pointer, which the title keeps in a block of `.data` aliases (`0x1475DF000`-`0x1475DF048`, `0x148759D00`) filled by one constructor (`0x1424785D4`-`0x142478621`). Result: 86 -> 1 site, 101 -> 1, 108 -> 2, 132 -> 1, 133 -> 5, **131 -> 0**. Measured shapes (caller side, `rcx` = device unless struct-return): - **86**: `(desc, &IID_ID3D12PipelineState, out)` — matches `CreatePipelineState` -> PC slot 47 in `docs/d3d12_vulkan.md` §3.1. - **101**: `(desc{3, index, ptr}, &IID_ID3D12StateObject, out)` — matches `CreateStateObject` -> PC slot 62 in `docs/d3d12_vulkan.md` §3.1. - **108**: `(out16, device, 1, 1, ptr, ptr)` — C-ABI 16-byte struct return in `rcx`, matching `GetResourceAllocationInfo2` -> PC slot 68 in `docs/d3d12_vulkan.md` §3.1. - **132**: `(3)` — single integer/enum argument on the device; unnamed. - **133**: `(va, &D3D12_RESOURCE_DESC, state, clear, &IID_ID3D12Resource, out)` — matches `CreatePlacedResourceX` in `docs/retail_boot_chain.md` §3.4. ## Why The page previously had no device slot map past the presentation block. Cross-checking the static device-receiver chains against `docs/d3d12_vulkan.md` §3.1 and `docs/retail_boot_chain.md` §3.4 confirms slots 86, 101, 108 and 133 from the executable itself, pins down slot 132's single device site, and shows offset `+0x418` (131) has 26 raw sites and 0 device receivers (so §9 counts five device slots, leaving 131 open). ## Tested - `python -I scripts/check_no_game_data.py docs/d3d12_xs_surface.md` -> exit 0 - `python -I tests/test_d3d12_xs_surface.py`, `tests/test_docs_links.py`, `tests/test_docs_table_rows.py`, `tests/test_docs_repo_paths.py`, `tests/test_docs_cli_flags.py` -> OK - Static only; the executable was never run. GPUs tested: n/a AI-assisted: yes (Antigravity, Gemini 4 Carbon)
PierreEbele commented 2026-11-25 07:03:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T07:03:32Z.


Reviewed 8ec5744: Docs-only; ran tests/test_d3d12_xs_surface.py, tests/test_docs_repo_paths.py, tests/test_docs_links.py, and scripts/check_no_game_data.py on this branch and on main in the sandbox (all pass; SDK and SCARAB cross-checks skip because Windows SDK headers and SCARAB_REF are absent, and test_docs_repo_paths.py excludes docs/d3d12_xs_surface.md). The §5.2 checks hold: 243 raw sites, 10 device sites, offset = 8*slot for all six, IIDs match §3 and the SDK IID_ID3D12StateObject, and slot 133 matches docs/retail_boot_chain.md §3.4 and runtime/shims/d3d12_xs_device.cpp CreatePlacedResourceX(va, desc, state, clear, riid, out). One blocking issue: this branch predates main's docs/d3d12_vulkan.md (lines 93-113) and runtime/shims/d3d12_xs_device.{h,cpp}, which already name and route slot 86 CreatePipelineState(desc, riid, out), slot 101 CreateStateObject(desc, riid, out), and slot 108 GetResourceAllocationInfo2 with the exact C-ABI layout §5.2 measures (16-byte D3D12_RESOURCE_ALLOCATION_INFO out in RCX, device in RDX, visible_mask=1, count=1, descs, info1). Please rebase and cross-reference docs/d3d12_vulkan.md so §5.2 does not land claiming slot 108 is an unnamed "GUID-returning query" or that "108, 131 and 132 have no name at all" (131 and 132 stay unnamed). Minor nit: the §5.2 heading and §9's closing "adds six device slots" count slot 131 even though §5.2 finds 0 device sites ("a device form is unproven") and §9's table lists five device slots. AI-assisted review.

Recommendation: Fix first

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155442241 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1038#issuecomment-7155442241). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T07:03:32Z. --- Reviewed 8ec5744: Docs-only; ran `tests/test_d3d12_xs_surface.py`, `tests/test_docs_repo_paths.py`, `tests/test_docs_links.py`, and `scripts/check_no_game_data.py` on this branch and on `main` in the sandbox (all pass; SDK and SCARAB cross-checks skip because Windows SDK headers and `SCARAB_REF` are absent, and `test_docs_repo_paths.py` excludes `docs/d3d12_xs_surface.md`). The §5.2 checks hold: 243 raw sites, 10 device sites, offset = `8*slot` for all six, IIDs match §3 and the SDK `IID_ID3D12StateObject`, and slot 133 matches `docs/retail_boot_chain.md` §3.4 and `runtime/shims/d3d12_xs_device.cpp` `CreatePlacedResourceX(va, desc, state, clear, riid, out)`. One blocking issue: this branch predates `main`'s `docs/d3d12_vulkan.md` (lines 93-113) and `runtime/shims/d3d12_xs_device.{h,cpp}`, which already name and route slot 86 `CreatePipelineState(desc, riid, out)`, slot 101 `CreateStateObject(desc, riid, out)`, and slot 108 `GetResourceAllocationInfo2` with the exact C-ABI layout §5.2 measures (16-byte `D3D12_RESOURCE_ALLOCATION_INFO` out in `RCX`, device in `RDX`, `visible_mask=1`, `count=1`, `descs`, `info1`). Please rebase and cross-reference `docs/d3d12_vulkan.md` so §5.2 does not land claiming slot 108 is an unnamed "GUID-returning query" or that "108, 131 and 132 have no name at all" (131 and 132 stay unnamed). Minor nit: the §5.2 heading and §9's closing "adds six device slots" count slot 131 even though §5.2 finds 0 device sites ("a device form is unproven") and §9's table lists five device slots. AI-assisted review. **Recommendation:** Fix first
robot00f commented 2026-11-25 19:07:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-25T19:07:25Z.


Rebased onto main (9f9a7c5f) and addressed both points from @PierreEbele:

  1. Cross-referenced docs/d3d12_vulkan.md §3.1 (runtime/shims/d3d12_xs_device.cpp): §5.2's table, per-slot notes, "What this does not say" bullet, and §9 row #2 now tie device slots 86 (CreatePipelineState -> PC slot 47), 101 (CreateStateObject -> PC slot 62), and 108 (GetResourceAllocationInfo2 -> PC slot 68, with the 16-byte D3D12_RESOURCE_ALLOCATION_INFO C-ABI return buffer in rcx and device in rdx) to main's routes instead of calling slot 108 a GUID-returning query or unnamed. Offsets +0x418 (131) and +0x420 (132) remain unnamed, with 131 having 0 device sites.
  2. Device-slot count nit: §5.2's heading and §9's closing sentence now count five device slots (86, 101, 108, 132, 133), leaving offset +0x418 (131) explicitly separate/open with 0 device sites.

Dependent #1117 (docs/b3) has also been restacked cleanly onto this commit.

Re-ran check_no_game_data.py, test_d3d12_xs_surface.py, test_docs_links.py, test_docs_table_rows.py, test_docs_repo_paths.py, test_docs_cli_flags.py, and test_i18n_index.py (all pass).

AI-assisted: yes (Antigravity, Gemini 4 Carbon)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7171850127 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1038#issuecomment-7171850127). Originally posted by [robot00f](https://github.com/robot00f) on 2026-11-25T19:07:25Z. --- Rebased onto `main` (`9f9a7c5f`) and addressed both points from @PierreEbele: 1. **Cross-referenced `docs/d3d12_vulkan.md` §3.1 (`runtime/shims/d3d12_xs_device.cpp`):** §5.2's table, per-slot notes, "What this does not say" bullet, and §9 row `#2` now tie device slots **86** (`CreatePipelineState` -> PC slot 47), **101** (`CreateStateObject` -> PC slot 62), and **108** (`GetResourceAllocationInfo2` -> PC slot 68, with the 16-byte `D3D12_RESOURCE_ALLOCATION_INFO` C-ABI return buffer in `rcx` and device in `rdx`) to `main`'s routes instead of calling slot 108 a GUID-returning query or unnamed. Offsets `+0x418` (131) and `+0x420` (132) remain unnamed, with 131 having 0 device sites. 2. **Device-slot count nit:** §5.2's heading and §9's closing sentence now count **five** device slots (`86, 101, 108, 132, 133`), leaving offset `+0x418` (131) explicitly separate/open with 0 device sites. Dependent #1117 (`docs/b3`) has also been restacked cleanly onto this commit. Re-ran `check_no_game_data.py`, `test_d3d12_xs_surface.py`, `test_docs_links.py`, `test_docs_table_rows.py`, `test_docs_repo_paths.py`, `test_docs_cli_flags.py`, and `test_i18n_index.py` (all pass). AI-assisted: yes (Antigravity, Gemini 4 Carbon)
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!1038
No description provided.