docs(xbox_d3d12_xs): root-signature flags measure 0x80; 0x03000000 is absent (D3D12-RTS0-FLAGS-MEASURED) #1048

Open
github-bot wants to merge 1 commit from github-bot/gh-1048 into main AGit
Owner

@⁠robot00f on GitHub · 2026-11-24 17:20 UTC · original
robot00f:docs/agent3 → main · +74 −3 · 1 files · 1 commits · open

Claim: claiming: D3D12-RTS0-FLAGS-MEASURED (issue #14).

Item ID: D3D12-RTS0-FLAGS-MEASURED.

What

Adds docs/xbox_d3d12_xs.md §2.5 and updates the §6 table row. It records what the executable's PRIV root-signature path actually does, since the flag enum itself has no public page (§2.4):

  • FUN_14247fc40 builds a D3D12_VERSIONED_ROOT_SIGNATURE_DESC and passes it to D3D12SerializeVersionedRootSignature. It writes Version = 2 (D3D_ROOT_SIGNATURE_VERSION_1_1) and Flags = 0x80 (D3D12_ROOT_SIGNATURE_FLAG_LOCAL_ROOT_SIGNATURE) unconditionally; the description carries no parameters or samplers.
  • The resulting blob goes to FUN_140fa09f0, which does not walk the description: it checks the 8-byte DXBC chunk header PRIV (+0..+3 id, +4..+7 uint32 payload length N) plus the two-byte marker 0xDC 0xE2 at +8..+9, keys its ordered map (0x1475e7760) on the unaligned 32-bit dword at +0xb (bytes 1..4 of the compact stream), expands [chunk + 0xa, chunk + 8 + N) into a temporary ID3DBlob via FUN_1455ac630, passes the expanded bytes and IID_ID3D12RootSignature (0x1461e06c8) to ID3D12Device vtable slot 16 (+0x80, CreateRootSignature at 0x140fa0b34), and releases the temporary ID3DBlob at slot 2 (+0x10, 0x140fa0b45). In 3VS_AlphaTransmissionFullScreenTri the three containers declare PRIV chunks of 484, 480 and 480 total bytes (10-byte prefix + 474/470/470-byte compact stream), so it is not a fixed flag blob.
  • 0x03000000 occurs in neither place: 0 hits over 3,997 valid PRIV bodies from 4,000 carved containers (both byte orders), and no immediate in the three functions above across .text (0x140001000–0x145f40966). The nearest value, 0x30000000, is unrelated (instruction-dword encoding; MOV RAX, 0x300000050 is a WNDCLASSEX initialiser). 0x03000000 belongs to RTS0, which the shim already masks; that mask leaves 0x80 untouched, so the PRIV path needs no translation.

Why

The page previously only said the flags enum is undocumented, and §6 credited the layer's RTS0 high-byte mask as if it were what makes the game's signatures work. The measurements give the real value, name the chunk that carries the bindings, and separate the two numeric values so a later reader does not chase 0x03000000 on a path that never writes it.

Tested

  • python -I scripts/check_no_game_data.py docs/xbox_d3d12_xs.md -> exit 0
  • python -I 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, no runtime test: Capstone disassembly (0x14247fc40, 0x140fa09f0, 0x1455ac630, import resolution of 0x145f3fdb0), a .text (0x140001000–0x145f40966) byte sweep for 00 00 00 03 and 00 00 00 30, and a PRIV body scan over 4,000 carved containers.

GPUs tested: n/a

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

**@⁠robot00f** on GitHub · 2026-11-24 17:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1048) `robot00f:docs/agent3` → `main` · +74 −3 · 1 files · 1 commits · open Claim: `claiming: D3D12-RTS0-FLAGS-MEASURED` (issue #14). Item ID: D3D12-RTS0-FLAGS-MEASURED. ## What Adds `docs/xbox_d3d12_xs.md` §2.5 and updates the §6 table row. It records what the executable's `PRIV` root-signature path actually does, since the flag enum itself has no public page (§2.4): - `FUN_14247fc40` builds a `D3D12_VERSIONED_ROOT_SIGNATURE_DESC` and passes it to `D3D12SerializeVersionedRootSignature`. It writes `Version` = 2 (`D3D_ROOT_SIGNATURE_VERSION_1_1`) and `Flags` = `0x80` (`D3D12_ROOT_SIGNATURE_FLAG_LOCAL_ROOT_SIGNATURE`) unconditionally; the description carries no parameters or samplers. - The resulting blob goes to `FUN_140fa09f0`, which does not walk the description: it checks the 8-byte DXBC chunk header `PRIV` (`+0..+3` id, `+4..+7` `uint32` payload length `N`) plus the two-byte marker `0xDC 0xE2` at `+8..+9`, keys its ordered map (`0x1475e7760`) on the unaligned 32-bit dword at `+0xb` (bytes `1..4` of the compact stream), expands `[chunk + 0xa, chunk + 8 + N)` into a temporary `ID3DBlob` via `FUN_1455ac630`, passes the expanded bytes and `IID_ID3D12RootSignature` (`0x1461e06c8`) to `ID3D12Device` vtable slot 16 (`+0x80`, `CreateRootSignature` at `0x140fa0b34`), and releases the temporary `ID3DBlob` at slot 2 (`+0x10`, `0x140fa0b45`). In `3VS_AlphaTransmissionFullScreenTri` the three containers declare `PRIV` chunks of 484, 480 and 480 total bytes (10-byte prefix + 474/470/470-byte compact stream), so it is not a fixed flag blob. - `0x03000000` occurs in neither place: 0 hits over 3,997 valid `PRIV` bodies from 4,000 carved containers (both byte orders), and no immediate in the three functions above across `.text` (`0x140001000`–`0x145f40966`). The nearest value, `0x30000000`, is unrelated (instruction-dword encoding; `MOV RAX, 0x300000050` is a `WNDCLASSEX` initialiser). `0x03000000` belongs to `RTS0`, which the shim already masks; that mask leaves `0x80` untouched, so the `PRIV` path needs no translation. ## Why The page previously only said the flags enum is undocumented, and §6 credited the layer's `RTS0` high-byte mask as if it were what makes the game's signatures work. The measurements give the real value, name the chunk that carries the bindings, and separate the two numeric values so a later reader does not chase `0x03000000` on a path that never writes it. ## Tested - `python -I scripts/check_no_game_data.py docs/xbox_d3d12_xs.md` -> exit 0 - `python -I 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, no runtime test: Capstone disassembly (`0x14247fc40`, `0x140fa09f0`, `0x1455ac630`, import resolution of `0x145f3fdb0`), a `.text` (`0x140001000`–`0x145f40966`) byte sweep for `00 00 00 03` and `00 00 00 30`, and a `PRIV` body scan over 4,000 carved containers. GPUs tested: n/a AI-assisted: yes (Antigravity, Gemini 4 Carbon)
FUN_14247fc40 builds a D3D12_VERSIONED_ROOT_SIGNATURE_DESC with Version 2 (1_1)
and Flags 0x80 (LOCAL_ROOT_SIGNATURE) and passes it to
D3D12SerializeVersionedRootSignature. FUN_140fa09f0 keys its cache on the dword
at PRIV +0xb, expands the compact stream from +0xa with FUN_1455ac630 into a
temporary ID3DBlob, passes the expanded bytes to ID3D12Device slot 16
(CreateRootSignature), and releases the blob at slot 2. 0x03000000 occurs in
neither the code path nor any sampled PRIV body; it is an RTS0 value.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:35:13 +00:00
Author
Owner

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

Reviewed f718fbd: Docs-only; ran tests/test_docs_repo_paths.py, tests/test_docs_links.py, and scripts/check_no_game_data.py docs/xbox_d3d12_xs.md on this branch and on origin/main in the sandbox (all pass). The D3D12_VERSIONED_ROOT_SIGNATURE_DESC x64 offsets (0x00..0x28), D3D12_ROOT_SIGNATURE_FLAG_LOCAL_ROOT_SIGNATURE = 0x80 in PC d3d12.h, PRIV magic (0x56495250), and shim description (kXboxRootSignatureFlagHighByte = 0xFF000000, RTS0 flags at payload+20, 0x80 preserved) all check out. Two factual issues in §2.5 should be fixed before merge: (1) The PRIV chunk layout contradicts itself — "10 bytes of header (id, length, the 0xDC 0xE2 pair and the key)" enumerates 4+4+2+4 = 14 bytes, the 32-bit key at +0xb (bytes 11..14) sits inside the payload stated to begin at +10 (leaving +0xa unexplained), and the chunk's ~470 bytes are called "expanded payload" even though FUN_1455ac630 expands them. (2) "device vtable slot 2, CreateRootSignature" contradicts ID3D12Device (both PC SDK and the console ABI measured in docs/d3d12_command_objects.md / runtime/shims/d3d12_xs_device.cpp), where slot 2 is Release and CreateRootSignature is slot 16 (+0x80); please fix the slot or clarify if that is an engine wrapper vtable. Minor nits: the .text end VA 0x1463f975 is missing a hex digit (< 0x140001000), and the §6 table's "The executable only ever serializes version 1.1" over-generalizes §2.5's "this path". AI-assisted review.

Recommendation: Fix first

**@⁠PierreEbele** on GitHub · 2026-11-25 07:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1048#issuecomment-7155463670) Reviewed f718fbd: Docs-only; ran `tests/test_docs_repo_paths.py`, `tests/test_docs_links.py`, and `scripts/check_no_game_data.py docs/xbox_d3d12_xs.md` on this branch and on `origin/main` in the sandbox (all pass). The `D3D12_VERSIONED_ROOT_SIGNATURE_DESC` x64 offsets (`0x00`..`0x28`), `D3D12_ROOT_SIGNATURE_FLAG_LOCAL_ROOT_SIGNATURE = 0x80` in PC `d3d12.h`, `PRIV` magic (`0x56495250`), and shim description (`kXboxRootSignatureFlagHighByte = 0xFF000000`, RTS0 flags at `payload+20`, `0x80` preserved) all check out. Two factual issues in §2.5 should be fixed before merge: (1) The `PRIV` chunk layout contradicts itself — "10 bytes of header (id, length, the `0xDC 0xE2` pair and the key)" enumerates 4+4+2+4 = 14 bytes, the 32-bit key at `+0xb` (bytes 11..14) sits inside the payload stated to begin at `+10` (leaving `+0xa` unexplained), and the chunk's ~470 bytes are called "expanded payload" even though `FUN_1455ac630` expands them. (2) "device vtable slot 2, `CreateRootSignature`" contradicts `ID3D12Device` (both PC SDK and the console ABI measured in `docs/d3d12_command_objects.md` / `runtime/shims/d3d12_xs_device.cpp`), where slot 2 is `Release` and `CreateRootSignature` is slot 16 (`+0x80`); please fix the slot or clarify if that is an engine wrapper vtable. Minor nits: the `.text` end VA `0x1463f975` is missing a hex digit (`< 0x140001000`), and the §6 table's "The executable only ever serializes version 1.1" over-generalizes §2.5's "this path". AI-assisted review. **Recommendation:** Fix first
Author
Owner

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

Rebased onto main (9f9a7c5f) and addressed all four points from @⁠PierreEbele after re-checking the disassembly of FUN_140fa09f0 (0x140fa09f0–0x140fa0b45), FUN_1455ac630 (0x1455ac630–0x1455ac680), and the PE .text section header:

  1. PRIV chunk layout: Fixed the header/body boundary in §2.5. The chunk starts with a 10-byte prefix: the 8-byte DXBC chunk header (PRIV at +0..+3, uint32 payload length N at +4..+7) plus the two-byte marker 0xDC 0xE2 at +8..+9. FUN_1455ac630 receives [chunk + 0xa, chunk + 8 + N) as the compact stream (+0xa is a 1-byte count, +0xb..+0xc a uint16, +0xf a second 1-byte count) and expands it into a temporary ID3DBlob; FUN_140fa09f0 reads the unaligned 32-bit dword at +0xb (bytes 1..4 of that compact stream) as the key in its ordered map (0x1475e7760). The three 3VS_AlphaTransmissionFullScreenTri chunks are 484/480/480 total bytes (10-byte prefix + 474/470/470-byte compact stream).
  2. CreateRootSignature vtable slot: Fixed "device vtable slot 2". FUN_140fa09f0 calls ID3D12Device vtable slot 16 (+0x80, CreateRootSignature at 0x140fa0b34 on [0x148759d00]) with IID_ID3D12RootSignature (0x1461e06c8), and then calls slot 2 (+0x10, IUnknown::Release at 0x140fa0b45) on the temporary ID3DBlob.
  3. .text end VA & §6 scope: Fixed the .text range typo to 0x140001000–0x145f40966 (verified the same 1,514 00 00 00 03 count over that exact PE .text span) and scoped §6's table row to FUN_14247fc40's PRIV root-signature builder.

Re-ran check_no_game_data.py and the docs test suite (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/1048#issuecomment-7171852105) Rebased onto `main` (`9f9a7c5f`) and addressed all four points from @⁠PierreEbele after re-checking the disassembly of `FUN_140fa09f0` (`0x140fa09f0`–`0x140fa0b45`), `FUN_1455ac630` (`0x1455ac630`–`0x1455ac680`), and the PE `.text` section header: 1. **`PRIV` chunk layout:** Fixed the header/body boundary in §2.5. The chunk starts with a 10-byte prefix: the 8-byte DXBC chunk header (`PRIV` at `+0..+3`, `uint32` payload length `N` at `+4..+7`) plus the two-byte marker `0xDC 0xE2` at `+8..+9`. `FUN_1455ac630` receives `[chunk + 0xa, chunk + 8 + N)` as the **compact** stream (`+0xa` is a 1-byte count, `+0xb..+0xc` a `uint16`, `+0xf` a second 1-byte count) and expands it into a temporary `ID3DBlob`; `FUN_140fa09f0` reads the unaligned 32-bit dword at `+0xb` (bytes `1..4` of that compact stream) as the key in its ordered map (`0x1475e7760`). The three `3VS_AlphaTransmissionFullScreenTri` chunks are 484/480/480 total bytes (10-byte prefix + 474/470/470-byte compact stream). 2. **`CreateRootSignature` vtable slot:** Fixed "device vtable slot 2". `FUN_140fa09f0` calls `ID3D12Device` vtable **slot 16 (`+0x80`, `CreateRootSignature` at `0x140fa0b34` on `[0x148759d00]`)** with `IID_ID3D12RootSignature` (`0x1461e06c8`), and then calls **slot 2 (`+0x10`, `IUnknown::Release` at `0x140fa0b45`)** on the temporary `ID3DBlob`. 3. **`.text` end VA & §6 scope:** Fixed the `.text` range typo to `0x140001000`–`0x145f40966` (verified the same 1,514 `00 00 00 03` count over that exact PE `.text` span) and scoped §6's table row to `FUN_14247fc40`'s `PRIV` root-signature builder. Re-ran `check_no_game_data.py` and the docs test suite (all pass). AI-assisted: yes (Antigravity, Gemini 4 Carbon)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1048/head:github-bot/gh-1048'
git switch 'github-bot/gh-1048'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1048'
git switch 'github-bot/gh-1048'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1048'
git switch 'github-bot/gh-1048'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1048'
git switch 'main'
git merge --squash 'github-bot/gh-1048'
git switch 'main'
git merge --ff-only 'github-bot/gh-1048'
git switch 'main'
git merge 'github-bot/gh-1048'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.