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

Manually merged
github merged 1 commit from gh-pr/1038/head into gh-pr/1038/base 2026-11-26 09:34:42 +00:00
Owner

@⁠robot00f on GitHub · 2026-11-24 17:06 UTC · original
robot00f:docs/agent1 → main · +105 −3 · 1 files · 1 commits · merged 2026-11-25 21:28 UTC

Claim: #14

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)

**@⁠robot00f** on GitHub · 2026-11-24 17:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1038) `robot00f:docs/agent1` → `main` · +105 −3 · 1 files · 1 commits · merged 2026-11-25 21:28 UTC Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ## 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)
Adds section 5.2: per-slot receiver proof, register/stack shape and arity for
device slots 86, 101, 108, 132 and 133 (and offset +0x418 / 131), from the 243
raw call sites at those offsets. Cross-references d3d12_vulkan.md §3.1 and
retail_boot_chain.md §3.4 for slots 86, 101, 108 and 133; offset +0x418 (131)
has 0 device sites and stays open.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:34:40 +00:00
github manually merged commit b6d6b70202 into gh-pr/1038/base 2026-11-26 09:34:42 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 07:03 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 07:03 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1038#issuecomment-7155442241) 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
Author
Owner

@⁠robot00f on GitHub · 2026-11-25 19:07 UTC · original

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)

**@⁠robot00f** on GitHub · 2026-11-25 19:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1038#issuecomment-7171850127) 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)
This discussion has been locked. Commenting is limited to contributors.
No description provided.