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

Merged
robot00f merged 1 commit from upstream-pr/1048 into main 2026-11-28 18:23:54 +00:00
robot00f commented 2026-11-24 17:20:04 +00:00 (Migrated from github.com)

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


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476981231 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1048). Originally posted by [robot00f](https://github.com/robot00f) on 2026-11-24T17:20:04Z. --- 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)
PierreEbele commented 2026-11-25 07:04:44 +00:00 (Migrated from github.com)

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


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155463670 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1048#issuecomment-7155463670). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T07:04:44Z. --- 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
robot00f commented 2026-11-25 19:07:31 +00:00 (Migrated from github.com)

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


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7171852105 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1048#issuecomment-7171852105). Originally posted by [robot00f](https://github.com/robot00f) on 2026-11-25T19:07:31Z. --- 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)
MoonEyes commented 2026-11-28 18:23:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:23:51Z.


Red/green: Docs only: Adds the measured root-signature flag 0x80 and the PRIV path to docs/xbox_d3d12_xs.md, consistent with the RTS0-only mask in the shim on main.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. Docs checked by a separate reviewer against the code on main.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243759045 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1048#issuecomment-7243759045). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:23:51Z. --- Red/green: Docs only: Adds the measured root-signature flag 0x80 and the PRIV path to docs/xbox_d3d12_xs.md, consistent with the RTS0-only mask in the shim on main. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. Docs checked by a separate reviewer against the code on main. AI-assisted (Claude Code, Claude Opus 5.5)
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!1048
No description provided.