mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:00:52 +01:00
[PR #697] [MERGED] OLD-7998: restore old upstream PR 7998 - d3d12_device_calls: count the ID3D12Device slots the retail executable calls, from the file alone #737
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#737
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/697
Author: @aslan2142
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:rt566-d3d12-device-calls📝 Commits (5)
d13044bd3d12_device_calls: count the ID3D12Device slots the executable calls, from the file alone (RT-566)117d6b2d3d12_device_calls: count a method in rax only through a verified dispatch routine (review of old upstream PR 7998)ff4392edocs/retail_boot_chain.md §5: the census reads the executable only; TreXito's call shapes for unnamed slotsc9013c0d3d12_device_calls: a jmp within the walked function is a branch, not a tail call (review of old upstream PR 7998)0a5c8d5d3d12_device_calls: summary counts calls and tail jumps apart; wording; tupacfan04's open points (old upstream PR 7998)📊 Changes
4 files changed (+1048 additions, -1 deletions)
View changed files
📝
docs/README.md(+1 -1)📝
docs/retail_boot_chain.md(+50 -0)➕
tests/test_d3d12_device_calls.py(+409 -0)➕
tools/d3d12_device_calls.py(+588 -0)📄 Description
Claimed in the coordination issue as: OLD-7998 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7131077757
Restoration of my original pull request, old upstream PR 7998 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at21625bca8c; thedocs/README.mdconflict is resolved by keeping main's index and extending itsretail_boot_chain.mdrow with this tool, and the old pull request numbers in the docs, test comments and commit messages are now plain text. The code is unchanged.What and why
tools/d3d12_device_calls.py(standard library,python -I). It counts whichID3D12Devicevtable slots the executable calls and how often. It reads only the file; nothing is run.D3D12XboxCreateDevice/D3D12CreateDeviceto the globals and stack slots that hold the device. Then it counts thecall [vtable+disp],call regand verified-dispatch (method in rax) sites for each slot.rcx, orrdxfor the console's return-buffer form);jmpinside the walked range is a branch, not a tail call.--outis required.docs/retail_boot_chain.md§5 describes the method, its limits and the census.Tested
python -I tests/test_d3d12_device_calls.py:ModuleNotFoundError, the tool is missing);python -m compileall -q tools tests: clean.tests/test_docs_*.pyandtests/test_text_write_line_endings.py: 56 tests in 13 files pass, the same as on main.git diff --check: clean.python -I scripts/check_no_game_data.pyon the four changed files: clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.AI-assisted (Claude Code, Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.