OLD-7998: restore old upstream PR 7998 - d3d12_device_calls: count the ID3D12Device slots the retail executable calls, from the file alone #697
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/697"
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?
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T12:17:25Z.
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).
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T12:20:22Z.
Review: APPROVED
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.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T22:22:37Z.
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).