OLD-7998: restore old upstream PR 7998 - d3d12_device_calls: count the ID3D12Device slots the retail executable calls, from the file alone #697
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!697
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/697/head"
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?
@aslan2142 on GitHub · 2026-11-24 12:17 UTC · original
aslan2142:rt566-d3d12-device-calls→main· +1048 −1 · 4 files · 5 commits · merged 2026-11-25 22:22 UTCClaimed in the coordination issue as: OLD-7998 #14
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).
@abnalstlll-byte on GitHub · 2026-11-24 12:20 UTC · original · approved these changes
Reviewed and verified OLD-7998 restoration. The tool ools/d3d12_device_calls.py correctly conducts static inspection of ID3D12Device vtable dispatch call sites from PE headers and bytecode without loading or executing the binary. All synthetic unit tests in ests/test_d3d12_device_calls.py adhere strictly to standard library requirements and clean-room constraints. Documentation update in docs/retail_boot_chain.md matches measured behavior. LGTM.
@aslan2142 on GitHub · 2026-11-25 22:22 UTC · original
Merged:
d3d12_device_callscounts the ID3D12Device slots the retail executable calls, from the file alone.main, and no review point is open.tests/test_d3d12_device_calls.pypasses onmain+ this head (Linux, CPython 3.14).main83f791ae4+0a5c8d56e: the semantic suite passes (492 files, 6,315 tests, 0 files failed);test_d3d12_device_callspass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 4 changed files.AI-assisted (Claude Code, Claude Opus 5.5).