[PR #1166] [MERGED] docs, tests: record descriptor heap census and provide 32-bit address translation contract suite (BL-4) #1199

Closed
opened 2026-11-26 20:20:25 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1166
Author: @abnalstlll-byte
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142

Base: main ← Head: feat/bl4-descriptor-address-translation


📝 Commits (2)

  • 83a90ab docs, tests: record descriptor heap census and provide 32-bit address translation contract suite (BL-4)
  • da60135 docs, tests: clarify descriptor address translation suite and verify production paths (BL-4)

📊 Changes

3 files changed (+419 additions, -7 deletions)

View changed files

📝 docs/boot_leads.md (+8 -6)
📝 docs/d3d12_vulkan.md (+8 -1)
➕ tests/test_descriptor_address_translation.py (+403 -0)

📄 Description

Resolves the open finding in docs/boot_leads.md §BL-4 ("descriptor words are 32-bit GPU addresses"):

1. Descriptor Heap Census & Findings (docs/boot_leads.md, docs/d3d12_vulkan.md §3.4)

  • Records the empirical census of the title's primary console CBV/SRV/UAV descriptor heap (1,245,184 slots) measured across queue submits 50, 500, and 5000:
    • 910,244 empty slots
    • 327,543 single-dword free-list links (value = slot_index + 1, ending at 0xFFFFFFFF)
    • 261 T# descriptors with layer-assigned addresses above 4 GiB
    • 5,840 V# descriptors (3,024 with a null base, 2,816 with a sub-4-GiB arena base)
    • 1,296 slots of interleaved constant data (IEEE-754 floats)
    • 0 slots that are bare 32-bit GPU addresses.
  • Conclusion: The hypothesis that console descriptor words are bare 32-bit GPU addresses is not supported. The title packs 48-bit addresses into standard V# / T# fields rather than bare pointers.

2. Synthetic Contract Test Suite (tests/test_descriptor_address_translation.py)

  • Provides a clean-room synthetic regression suite (53 tests) covering the 32-bit descriptor address translation contract (docs/d3d12_vulkan.md §3.3/§3.4):
    • Arena VA Contract (host_address = heap_base + console_va): Verifies lossless translation and ptr32_lo truncation compatibility for the 25,865 shaders zeroing the high dword before addition.
    • V# Base Address Encoding/Decoding: Verifies 48-bit buffer base address packing across word0 and word1[15:0].
    • T# Base Address Encoding/Decoding: Verifies 48-bit image address packing (address >> 8 across word0 and word1[7:0]) with 256-byte alignment.
    • Image Key Allocation Invariant: Verifies IMAGE_KEY_BASE (4 GiB) starts strictly above ARENA_CAP_MAX (4095 MiB).
    • BVH Builder Constraint: Models XboxBvhBuilder.dll validation (addr < 2^40 and 256-byte aligned).

Verification

  • pytest tests/test_descriptor_address_translation.py: 53/53 PASSED (0.19s).
  • python -I scripts/check_no_game_data.py: 0 violations (100% clean-room).
  • AI-assisted: yes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1166 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `feat/bl4-descriptor-address-translation` --- ### 📝 Commits (2) - [`83a90ab`](https://github.com/ubiquitarianism/leonida/commit/83a90abc765007ac63189e85451821282e46126f) docs, tests: record descriptor heap census and provide 32-bit address translation contract suite (BL-4) - [`da60135`](https://github.com/ubiquitarianism/leonida/commit/da60135590350f98d9ab1b4225ec8b16462adf03) docs, tests: clarify descriptor address translation suite and verify production paths (BL-4) ### 📊 Changes **3 files changed** (+419 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/boot_leads.md` (+8 -6) 📝 `docs/d3d12_vulkan.md` (+8 -1) ➕ `tests/test_descriptor_address_translation.py` (+403 -0) </details> ### 📄 Description Resolves the open finding in `docs/boot_leads.md §BL-4` ("descriptor words are 32-bit GPU addresses"): ### 1. Descriptor Heap Census & Findings (`docs/boot_leads.md`, `docs/d3d12_vulkan.md` §3.4) - Records the empirical census of the title's primary console CBV/SRV/UAV descriptor heap (1,245,184 slots) measured across queue submits 50, 500, and 5000: * **910,244** empty slots * **327,543** single-dword free-list links (`value = slot_index + 1`, ending at `0xFFFFFFFF`) * **261** T# descriptors with layer-assigned addresses above 4 GiB * **5,840** V# descriptors (3,024 with a null base, 2,816 with a sub-4-GiB arena base) * **1,296** slots of interleaved constant data (IEEE-754 floats) * **0** slots that are bare 32-bit GPU addresses. - **Conclusion**: The hypothesis that console descriptor words are bare 32-bit GPU addresses is not supported. The title packs 48-bit addresses into standard V# / T# fields rather than bare pointers. ### 2. Synthetic Contract Test Suite (`tests/test_descriptor_address_translation.py`) - Provides a clean-room synthetic regression suite (53 tests) covering the 32-bit descriptor address translation contract (`docs/d3d12_vulkan.md` §3.3/§3.4): * **Arena VA Contract (`host_address = heap_base + console_va`)**: Verifies lossless translation and `ptr32_lo` truncation compatibility for the 25,865 shaders zeroing the high dword before addition. * **V# Base Address Encoding/Decoding**: Verifies 48-bit buffer base address packing across `word0` and `word1[15:0]`. * **T# Base Address Encoding/Decoding**: Verifies 48-bit image address packing (`address >> 8` across `word0` and `word1[7:0]`) with 256-byte alignment. * **Image Key Allocation Invariant**: Verifies `IMAGE_KEY_BASE` (4 GiB) starts strictly above `ARENA_CAP_MAX` (4095 MiB). * **BVH Builder Constraint**: Models `XboxBvhBuilder.dll` validation (`addr < 2^40` and 256-byte aligned). ### Verification - `pytest tests/test_descriptor_address_translation.py`: **53/53 PASSED** (0.19s). - `python -I scripts/check_no_game_data.py`: **0 violations** (100% clean-room). - AI-assisted: yes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:25 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1199
No description provided.