Skip to content

docs/d3d12_vulkan: what the retail import table says about DXGI and the BVH builder - #7598

Closed
phish32786 wants to merge 1 commit into
ProjectLeonida:mainfrom
phish32786:docs-exe-import-answers
Closed

phish32786 wants to merge 1 commit into
ProjectLeonida:mainfrom
phish32786:docs-exe-import-answers

Conversation

@phish32786

Copy link
Copy Markdown
Contributor

What

Two rows of the Unknown / open questions table (§8.2) in docs/d3d12_vulkan.md, plus the §4.5 sentence that contradicts one of them, resolved from the retail executable's static import table (68 DLLs, 587 imports, normal and delay-load, plus the DLL names it holds as strings).

Question 6 — the title never touches DXGI. No dxgi.dll, no d3d12.dll; the only D3D-related import is d3d12_xs.dll with three functions, and the string-only load candidates are dbghelp.dll, kernel32.dll, rpcrt4.dll and xgameruntime.dll — no dxgi string either. So CreateDXGIFactory* and CreateSwapChain* are unreachable and there is no DXGI import to shim: the adapter comes from D3D12XboxCreateDevice's adapter parameter. §4.5 previously stated the opposite ("the executable imports it from the system (or from the GDK). That import must be shimmed"), and §8.2 asked for exactly this check ("check the executable's dxgi/d3d12_xs imports"). What remains open is the dynamic half: the PresentX/SuspendX/ResumeX slots and the D3D12XBOX_* layouts. The DXGI bullet list stays documented as the fallback path, now labelled as such.

Question 7 — acceleration structures go through XboxBvhBuilder. The executable statically imports seven of its entry points: the constructor (ID3D12Device11*, bool), the destructor, GetRaytracingAccelerationStructurePrebuildInfo(..., const D3D12XBOX_XDXR_STREAM_DESC*, ...), BuildRaytracingAccelerationStructureBatched2X(ID3D12GraphicsCommandList6*, ...), RehydrateRaytracingAccelerationStructureBatched2X(ID3D12GraphicsCommandList8*, ...), CopyRaytracingAccelerationStructure(ID3D12GraphicsCommandList4*, ...) and Set64BitMortonCodes(bool) — the same seven already listed from the DLL side in docs/d3d12_command_objects.md §3.1. So the device's standard BuildRaytracingAccelerationStructure/Copy.../Emit...PostbuildInfo are not the title's path, and the layer must hand out ID3D12Device11 plus command-list interfaces 4, 6 and 8. Serving those exports is D3D-178 (#7333 claim by @romainveurrier); this PR is docs only and touches no code.

Claim: #7333 (comment)

Independent of my #7371, which edits a different row of the same file (the sibling-module inventory at line 3752); the two do not overlap.

Tested

  • python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md → clean.
  • python -I tests/test_docs_repo_paths.py, test_docs_repeated_lines.py, test_docs_table_ids.py → OK.
  • python -I tests/test_docs_links.py → the one pre-existing failure on main (docs/dev-tools.md: ../runtime/README.md#a-600-frame-headless-guest-scene, anchor not found); nothing from this change. Found while testing — filing it in the coordination issue rather than fixing it here.
  • Docs only: no build, no GPU. Windows 11 Pro 10.0.26300, Python 3.14. The measurement needs the executable to re-run; reading the claims is a doc comparison.

AI-assisted (Claude, on the user's machine).

@Kev-Ball

Copy link
Copy Markdown

I independently checked the SHA-256-verified Xbox 1.0.2.1 executable on CachyOS. The PE inventory gives 68 distinct DLLs and 587 imports, all from the normal import directory, with three functions from d3d12_xs.dll and seven from XboxBvhBuilder.dll. Neither DXGI nor desktop D3D12 appears in those imports. The package dependency walk also has zero edges to either DLL across 8 local images and 195 edges.

Could §4.5 and §8.2 row 6 keep the runtime conclusion open? “The executable has no static DXGI import to shim” follows directly from the measurement. “CreateSwapChain* is unreachable” also requires knowing what interfaces the title receives or queries at runtime: a COM method call through an existing interface does not need a named PE import. The seven builder imports likewise establish a route available to the title; a call-site or runtime observation would establish which route it actually uses. AI-assisted QA.

@kapitche

Copy link
Copy Markdown
Collaborator

Tested 0831876 merged with main 3ae0654 on Linux/Python 3.12.16: fail

The merge is clean (docs/d3d12_vulkan.md only), but it breaks a docs test that passes on main.

  • python -I tests/test_docs_table_rows.py with the PR merged: Ran 2 tests, FAILED (failures=1): AssertionError: docs/d3d12_vulkan.md:3870: table row without a table header. With docs/d3d12_vulkan.md restored from main the same test is OK.
  • Cause: the rewritten row 6 of the open-questions table (starts at the | 6 | Which swapchain/present path ... line, around L3862) contains hard line breaks: the text after "d3d12.dll at all" continues on new lines ((the only D3D-related import is ..., swapchain and ..., parameter. Still open: ..., PresentX` + frame-event presenter first ... |). A markdown table row must be one line, so the continuation lines are parsed as a stray row and row 6 is split. Joining that cell into a single line should fix it.
  • The other tests/test_docs_*.py results match main: test_docs_cli_flags (docs/embedded_shaders.md:372) and test_docs_links (docs/dev-tools.md) fail on main too; the rest are OK.
  • I did not re-check the 68-DLL / 587-import / seven-entry-point figures against the executable; only the doc structure and the linked sections were checked.

@phish32786
phish32786 force-pushed the docs-exe-import-answers branch from 0831876 to 22225d9 Compare November 23, 2026 17:23
…he BVH builder

Question 6: the executable imports no dxgi.dll and no d3d12.dll, and holds no
dxgi string, so CreateSwapChain* is unreachable and there is no DXGI import to
shim; its adapter comes from D3D12XboxCreateDevice's adapter parameter. §4.5
said the opposite.

Question 7: the executable imports the seven XboxBvhBuilder entry points, so
acceleration-structure builds go through the builder rather than the device's
standard calls, and the layer has to hand out ID3D12Device11 and command-list
interfaces 4, 6 and 8.
@phish32786

Copy link
Copy Markdown
Contributor Author

Force-pushed one correction after measuring the device call site (#7333 (comment)): this PR's new §4.5 sentence and question 6 said the title "takes its adapter from D3D12XboxCreateDevice's adapter parameter". Measured at the single call site, that parameter is null, so the sentence was wrong in the direction that matters — the layer has to choose the adapter. Both places now say that. Also collapsed question 6's table row back onto one line; the earlier version wrapped it across four lines, which breaks the markdown table.

Checks re-run on the rebased head (origin/main at d6f8a66fc): scripts/check_no_game_data.py docs/d3d12_vulkan.md clean, test_docs_table_ids.py and test_docs_repeated_lines.py OK, test_docs_links.py down to the one pre-existing docs/dev-tools.md anchor failure (filed at #7333 (comment)).

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

AI-assisted check of the table repair on Windows. I ran py -3.14 -I tests/test_docs_table_rows.py on both revisions. At 083187618, one of two tests fails at row 3862 in docs/d3d12_vulkan.md. At 22225d9a3, both tests pass. This check covers the Markdown table structure only.

@BatSmacker84

Copy link
Copy Markdown

Checked 22225d9a3 (merges cleanly onto main 5d74c2723) against the retail executable and package on Windows 11 26200. Static reads and CPU tests only.

Pass

  • 68 DLLs and 587 normal imports, zero delay imports, no DXGI or desktop D3D12 import; the four published string-only candidates, three console-D3D imports and all seven named builder imports.
  • The single direct D3D12XboxCreateDevice call passes a null adapter.
  • Changed-document table checks 2/2.

Needs changes

  • No static DXGI import doesn't rule out DXGI at run time. Suggested: "The retail executable has no static DXGI import. Runtime DXGI use remains open."
  • The builder imports establish a path, not the routing. Suggested: "The seven static imports establish a builder path. Actual acceleration-structure routing remains open."
  • Note: this and Docs: record retail XboxBvhBuilder call sites for Q7 #9413 both rewrite the Q7 row in docs/d3d12_vulkan.md.

AI-assisted: Codex GPT-6.2 Sol ran the checks, Claude Opus 5.5 reviewed the report. The retail executable (SHA-256 e95020b2…8993) and package PE images were read in place; static reads and CPU tests only, and only names and counts are given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants