docs(d3d12_vulkan): what the title does with GetDescriptorHandleIncrementSize (D3D12-DESCRIPTOR-INCREMENTS) #1143

Merged
robot00f merged 1 commit from upstream-pr/1143 into main 2026-11-29 14:38:58 +00:00
robot00f commented 2026-11-24 19:10:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-24T19:10:44Z.


Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141413757 (ID D3D12-DESCRIPTOR-INCREMENTS; earlier Spanish wording: #issuecomment-7140235047)

What

docs/d3d12_vulkan.md marked the console's GetDescriptorHandleIncrementSize values Open (section 3.4, and sections 3.2, 4, 8.2 referred to them the same way). This measures what the retail executable does with device slot 15 (offset 0x78).

The index holds 943 indirect calls through [device vtable + 0x78]. Resolving rcx from each function's start with capstone, 10 reach the device (the 0x148759D00 BSS device global or its 0x1475DF000-0x1475DF048 aliases); the other 933 call the same slot on another object and are counted, not attributed. Of the 10 device sites, all five D3D12_DESCRIPTOR_HEAP_TYPE values are passed and the return is used as a slot stride (add rdi, rax in two SRV-table builders), as a heap size (imul), as a slot count (div from a byte count) and once cached in a global; four of the five bootstrap queries discard it.

Why

So the layer knows it must answer with the host heap's increment, not a console constant: the game turns the value into sizes, divisions and GPU handle addresses, so a wrong stride corrupts every table it builds. The numeric console values stay Open (the doc says so); this also settles that the game does not hardcode them.

Nothing outside section 3.4 is reformatted; §7.1 (PR #1125) is untouched.

Tested

  • python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md — exit 0
  • python -I tests/test_docs_links.py — 16 tests OK
  • python -I tests/test_docs_table_rows.py — 2 tests OK
  • Docs only; the executable was not run.

GPUs tested: n/a

AI-assisted: yes (OpenCode)

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478622083 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1143). Originally posted by [robot00f](https://github.com/robot00f) on 2026-11-24T19:10:44Z. --- Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141413757 (ID `D3D12-DESCRIPTOR-INCREMENTS`; earlier Spanish wording: #issuecomment-7140235047) ## What `docs/d3d12_vulkan.md` marked the console's `GetDescriptorHandleIncrementSize` values **Open** (section 3.4, and sections 3.2, 4, 8.2 referred to them the same way). This measures what the retail executable does with device slot 15 (offset `0x78`). The index holds 943 indirect calls through `[device vtable + 0x78]`. Resolving `rcx` from each function's start with capstone, 10 reach the device (the `0x148759D00` BSS device global or its `0x1475DF000`-`0x1475DF048` aliases); the other 933 call the same slot on another object and are counted, not attributed. Of the 10 device sites, all five `D3D12_DESCRIPTOR_HEAP_TYPE` values are passed and the return is used as a slot stride (`add rdi, rax` in two SRV-table builders), as a heap size (`imul`), as a slot count (`div` from a byte count) and once cached in a global; four of the five bootstrap queries discard it. ## Why So the layer knows it must answer with the *host* heap's increment, not a console constant: the game turns the value into sizes, divisions and GPU handle addresses, so a wrong stride corrupts every table it builds. The numeric console values stay **Open** (the doc says so); this also settles that the game does not hardcode them. Nothing outside section 3.4 is reformatted; §7.1 (PR #1125) is untouched. ## Tested - `python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md` — exit 0 - `python -I tests/test_docs_links.py` — 16 tests OK - `python -I tests/test_docs_table_rows.py` — 2 tests OK - Docs only; the executable was not run. GPUs tested: n/a AI-assisted: yes (OpenCode)
abnalstlll-byte commented 2026-11-24 19:13:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:13:15Z.

Review: APPROVED


Reviewed and verified. Documents that the retail title actively derives descriptor strides, heap byte counts, and slot divisions from ID3D12Device::GetDescriptorHandleIncrementSize (slot 15) return values rather than hardcoding console constants. Concludes that returning host Vulkan descriptor sizes is essential to avoid table corruption. Clean-room compliant.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045692061 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1143#pullrequestreview-6045692061). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:13:15Z. **Review:** APPROVED --- Reviewed and verified. Documents that the retail title actively derives descriptor strides, heap byte counts, and slot divisions from `ID3D12Device::GetDescriptorHandleIncrementSize` (slot 15) return values rather than hardcoding console constants. Concludes that returning host Vulkan descriptor sizes is essential to avoid table corruption. Clean-room compliant.
Deedlyy commented 2026-11-24 20:13:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:13:38Z.


Recommendation: [MERGE]

Reasoning: Docs: replaces the "Open" GetDescriptorHandleIncrementSize entries with a static measurement of the 10 device-reaching call sites of slot 15 and how the title uses the values. Documentation only, with method and evidence described. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143218356 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1143#issuecomment-7143218356). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:13:38Z. --- **Recommendation:** [MERGE] **Reasoning:** Docs: replaces the "Open" `GetDescriptorHandleIncrementSize` entries with a static measurement of the 10 device-reaching call sites of slot 15 and how the title uses the values. Documentation only, with method and evidence described. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
zmasi commented 2026-11-28 23:32:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:32:59Z.


Native Windows 11 Verification (75cf835c3d) — PASS

Diff-audited docs/d3d12_vulkan.md (+34/-9) and verified merged onto origin/main (ba8b77b390) on Windows 11 (10.0.26200, Python 3.12.10 with -I).

Results

  • Technical & Source Cross-Check:
    • Verified device vtable slot 15 (+0x78 = 15 * 8 x64 vtable offset), all five D3D12_DESCRIPTOR_HEAP_TYPE arguments (0..4: CBV_SRV_UAV, SAMPLER, RTV, DSV, NUM_DESCRIPTOR_HEAP_TYPES), and host-increment forwarding in runtime/shims/d3d12_vulkan_device.cpp (GetDescriptorHandleIncrementSize).
  • Documentation & Policy Suites (PR #1143 merged onto origin/main):
    • python -I tests/test_docs_links.py: Ran 17 tests — OK
    • python -I tests/test_docs_repo_paths.py: Ran 5 tests — OK
    • python -I tests/test_docs_table_rows.py: Ran 2 tests — OK
    • python -I tests/test_docs_list_items.py: Ran 3 tests — OK
    • python -I tests/test_docs_encoding.py: Ran 1 test — OK
    • python -I tests/test_docs_cli_flags.py: Ran 4 tests — OK
    • python -I tests/test_docs_env_vars.py: Ran 5 tests — OK
    • python -I scripts/check_no_game_data.py & tests/test_text_write_line_endings.py (3/3): OK.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247504823 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1143#issuecomment-7247504823). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T23:32:59Z. --- ### Native Windows 11 Verification (`75cf835c3d`) — PASS Diff-audited `docs/d3d12_vulkan.md` (`+34/-9`) and verified merged onto `origin/main` (`ba8b77b390`) on Windows 11 (`10.0.26200`, Python `3.12.10` with `-I`). #### Results - **Technical & Source Cross-Check**: - Verified device vtable slot `15` (`+0x78` = `15 * 8` x64 vtable offset), all five `D3D12_DESCRIPTOR_HEAP_TYPE` arguments (`0..4`: `CBV_SRV_UAV`, `SAMPLER`, `RTV`, `DSV`, `NUM_DESCRIPTOR_HEAP_TYPES`), and host-increment forwarding in `runtime/shims/d3d12_vulkan_device.cpp` (`GetDescriptorHandleIncrementSize`). - **Documentation & Policy Suites (`PR #1143` merged onto `origin/main`)**: - `python -I tests/test_docs_links.py`: **`Ran 17 tests — OK`** - `python -I tests/test_docs_repo_paths.py`: **`Ran 5 tests — OK`** - `python -I tests/test_docs_table_rows.py`: **`Ran 2 tests — OK`** - `python -I tests/test_docs_list_items.py`: **`Ran 3 tests — OK`** - `python -I tests/test_docs_encoding.py`: **`Ran 1 test — OK`** - `python -I tests/test_docs_cli_flags.py`: **`Ran 4 tests — OK`** - `python -I tests/test_docs_env_vars.py`: **`Ran 5 tests — OK`** - `python -I scripts/check_no_game_data.py` & `tests/test_text_write_line_endings.py` (`3/3`): **`OK`**. AI-assisted.
enlight3d commented 2026-11-29 08:57:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T08:57:24Z.


Validation run of this PR on a Windows PC.

  • PR head: 75cf835c3d
  • main: 54b2a81e95
  • Tested merged: yes, git merge --no-ff of the PR head into main was clean.

This PR only changes docs/d3d12_vulkan.md; there is no ctest test for it, so there is no red/green pair. I ran the repository's docs tests on the merged tree:

git fetch origin pull/1143/head:pr-1143
git checkout --detach origin/main && git merge --no-edit --no-ff pr-1143
for f in tests/test_docs_*.py; do python -I $f; done
  • Result: 11 of 13 docs tests pass (adjacent_fenced_blocks, design_rows, encoding, env_vars, list_items, pr_template, python_deps, repeated_lines, repo_paths, table_ids, table_rows). test_docs_cli_flags and test_docs_links fail on a README flag and on README anchors; both fail the same way on plain main, so they are not caused by this PR.
  • Not checked: the claims about what the shipped title does with the increment (they need the game files, which this run does not use), so this run says nothing about whether they are accurate.
  • Link: no code changes, so gta6rt.exe was not rebuilt for this PR (the baseline main build has 703 imports).

Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7253440651 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1143#issuecomment-7253440651). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T08:57:24Z. --- Validation run of this PR on a Windows PC. - PR head: 75cf835c3d7e719b42cf732586376818b0d0b213 - main: 54b2a81e95c470c953ddee6177fd6255cbaf041d - Tested merged: yes, `git merge --no-ff` of the PR head into main was clean. This PR only changes `docs/d3d12_vulkan.md`; there is no ctest test for it, so there is no red/green pair. I ran the repository's docs tests on the merged tree: ``` git fetch origin pull/1143/head:pr-1143 git checkout --detach origin/main && git merge --no-edit --no-ff pr-1143 for f in tests/test_docs_*.py; do python -I $f; done ``` - Result: 11 of 13 docs tests pass (adjacent_fenced_blocks, design_rows, encoding, env_vars, list_items, pr_template, python_deps, repeated_lines, repo_paths, table_ids, table_rows). `test_docs_cli_flags` and `test_docs_links` fail on a README flag and on README anchors; both fail the same way on plain main, so they are not caused by this PR. - Not checked: the claims about what the shipped title does with the increment (they need the game files, which this run does not use), so this run says nothing about whether they are accurate. - Link: no code changes, so `gta6rt.exe` was not rebuilt for this PR (the baseline main build has 703 imports). Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44.
MoonEyes commented 2026-11-29 14:39:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:39:02Z.


Merged at head 75cf835. Docs-only (docs/d3d12_vulkan.md), reviewed on this head by enlight3d, zmasi; no test applies. AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257468336 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1143#issuecomment-7257468336). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T14:39:02Z. --- Merged at head 75cf835. Docs-only (docs/d3d12_vulkan.md), reviewed on this head by enlight3d, zmasi; no test applies. AI-assisted: yes.
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!1143
No description provided.