Repository navigation
Conversation
A title linked against the console import library imports its interface ids from d3d12_xs.dll as data: the import address table slot holds the address of a GUID. The shim table had four function names and no data, so such an import fell through to the unimplemented-import thunk and the title would read 16 bytes of thunk code as its IID. Nothing is called, so LEONIDA_UNIMPLEMENTED=stop never fired. The 93 names (docs/d3d12_xs_surface.md section 2.2) are now served by name from runtime/shims/d3d12_xs_guids.inc, which tools/d3d12_xs_surface.py --inc writes from the table it already checks against the Windows SDK; a pytest check fails when the file and the tool differ. Ordinals are not served: 34 of them are derived. pe_loader_test loads a fixture DLL that imports three of the GUIDs (a standard IID, a debug GUID, a console-only IID) and checks the binding and the bytes read. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A shell redirect of the tool's output gave CRLF on Windows and UTF-16 from PowerShell 5.1, so the documented command did not reproduce the committed file. --inc now takes the path and names its encoding and line ending; the pytest regenerates the file and compares bytes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
kacper-serewis
left a comment
There was a problem hiding this comment.
ccd8aef on Windows: 86 loader checks passed. Three distinct PE data imports resolved and returned expected 16-byte GUIDs. Extended synthetic registry check (187 total) verified stable read-only addresses for all 93 names and executable memory for four functions. SDK 10.0.26100.0 independently confirmed 83 standard GUIDs, ten console values traced to the SCARAB-derived table. CPU only, AI-assisted.
|
Tested ccd8aef on Windows 11, MSVC 19.42 (VS 2022 Build Tools), Windows SDK 10.0.28000.0, NVIDIA RTX 3080 Ti, driver 616.56: pass
The values, checked against a different SDK than the one the tool's table names: No blocker found. AI-assisted (Claude Code); synthetic fixtures only, no game files. |
|
Tested
AI-assisted (Claude). No game files. |
|
Tested ccd8aef (merged onto main f847748) on NVIDIA GeForce RTX 4060 Ti, driver 610.88 (32.0.16.1088), Windows 11 26200, MSVC 14.51.36231 (VS 2026), Vulkan SDK 1.4.363.0, Windows SDK 10.0.26100.0: pass
AI-assisted (Claude). |
|
Confirmed an actual executable import covered by this PR, AI-assisted with Codex. The local Series Minecraft Preview executable imports Validation on the same worktree:
The local title stack also needs #4313, #2075 and the direct Environment: Windows 11 build 26200, MSVC 14.51, Ninja RelWithDebInfo, RTX 5070 Ti / driver 617.14. Offline functional testing; no GPU performance measurements or game artifacts. |
Kam471
left a comment
There was a problem hiding this comment.
Reviewed head ccd8aef17e82cb5d39b2fa924746cf598350ae85. Windows 11 26200, MSVC 19.44.35207, Ninja, RelWithDebInfo, Vulkan 1.4.363.
Rebased onto 561b65a83 in a scratch worktree. Green after the fix below: pe_loader 1/1 (86 checks), pytest tests/test_d3d12_xs_surface.py 9 passed 1 skipped; 93 data exports, 83 checked against SDK headers, 10 console-only. Red: reverting runtime/shims/d3d12_xs.cpp only gives 6 pe_loader failures (an imported GUID reads thunk bytes).
Blocker: it does not apply or build on main as-is. Three conflicts (docs/d3d12_xs_surface.md, runtime/CMakeLists.txt, tests/test_d3d12_xs_surface.py); after resolving them the build stops with multiple rules generate fixtures/stubs/RelWithDebInfo/d3d12_xs.dll, because main now builds d3d12_xs_stub into that folder with the same OUTPUT_NAME. Moving the new d3d12_xs_iid_stub output to fixtures/stubs/iid/ (one line) builds and passes all of the above. I did not push that change.
Verdict: content correct, needs the rebase plus that one-line output-dir fix. First-frame relevant: an unserved imported GUID binds to the unimplemented-import thunk, so the title reads code bytes as its interface id. No duplicate in the open list; #4500 touches the d3d12_xs proxy but not its data exports.
|
Integration note for When the configure finds Vulkan headers, Giving the iid stub its own folder ( The PR also conflicts with current Windows 11 26200, MSVC 14.51, Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, RTX 5070 Ti / NVIDIA 617.14. Synthetic fixtures only, no game files. AI-assisted (Claude Code). |
Claim (new item, no ID assigned yet)
AI-assisted (Claude Code). I ran everything under "Tested" on Windows.
Problem
docs/d3d12_xs_surface.md§2.2 lists 93 GUID data exports of the consoled3d12_xs.dll(IID_ID3D12Device,DXGI_DEBUG_ALL,IID_ID3D12ConsDmaCommandList, ...). A title linked against the console import library imports them: the import address table slot then holds the address of a GUID, not of a function.The shim table in
runtime/shims/d3d12_xs.cpphas four function names and no data.Loader::resolvefinds no shim, no bundled module and no hostd3d12_xs.dll, and binds the import to the unimplemented-import thunk. The title reads the first 16 bytes of that thunk's code as its interface id. Nothing is ever called, soLEONIDA_UNIMPLEMENTED=stopdoes not fire andfailchanges nothing; the first symptom would be aQueryInterfacelogging an unknown IID far from the cause.Reproduced on
mainwith a fixture DLL that imports three of them and is loaded byrt::Loader: all three bind asUnimplemented.What is not known: whether the executable imports any. The package's own DLLs import none (the six console imports in
docs/runtime_imports.mdare all functions). This is a wrong answer waiting behind an import that may or may not exist, cheap to close before the executable arrives; it is not a crash I reproduced with a real title.Change
runtime/shims/d3d12_xs_guids.inc(new, generated): one line per GUID, in ordinal order.tools/d3d12_xs_surface.py --inc PATHwrites it (UTF-8, LF, by the tool itself, not a shell redirect) from the table that tool already holds and checks against the Windows SDK headers (83 standard values) and SCARAB's published list (10 console-only values, GPL-3.0, facts only; see the doc's §4). No value is new to the repository.runtime/shims/d3d12_xs.cppdefines the 93 GUIDs from that file and registers each by name in the shim registry. The loader needs no change: a registry entry is an address, and for a data import the address of the data is what the slot must hold (the loader already binds module-to-module data imports,tiny_exported_valueinpe_loader_test).--dry-run.tests/test_d3d12_xs_surface.pyregenerates the file with--incand fails when the committed bytes differ.docs/d3d12_xs_surface.md§2.2 says what Leonida serves.Test
pe_loader_testtakes a third fixture,tiny_iid.dll, linked against a stubd3d12_xs.dllwhose GUIDs are zero (it lives infixtures/stubs, so the loader cannot bind it as a bundled module). The test loads it throughrt::Loaderand checks, for a standard IID, a debug GUID and a console-only IID, that the import isBinding::Shimand that the 16 bytes the title would read are the expected GUID. The expected values are written out in the test, not taken from the table under test.Tested
Windows 11 (build 26200), MSVC 19.44.35222, Visual Studio's CMake and
ctest3.31.6 with Ninja, RelWithDebInfo, built byscripts/build_runtime.ps1. Basef847748c(main). Windows SDK 10.0.26100.0.pe_loader_testwith the new fixture onmain'sd3d12_xs.cpp: 6 failures of 86 (each of the three imports isUnimplemented, and each read is not the GUID). With the change: OK, 86 checks.ctest --test-dir runtime/build -C RelWithDebInfowithLEONIDA_GAME_DIRset: 140 run, 134 passed, 6 skipped, 0 failed (gameinputis disabled, no SDL3 here). NVIDIA GeForce RTX 4090, driver 32.0.16.2114, for the Vulkan tests in that run; this change needs no GPU.python tools/d3d12_xs_surface.py --check --sdk: PASS, 83/83 standard GUIDs match the SDK.python -m pytest tests/test_d3d12_xs_surface.py: 8 passed, 1 skipped (the SCARAB cross-check, which needs a checkout);tests/test_docs_links.py: 5 passed.python -Iontests/test_docs_repo_paths.py,test_docs_list_items.py,test_docs_design_rows.py,test_docs_links.py: OK.--incoption, the pytest, and two comment lines at the top of the.inc; the Python tests were rerun on it, the C++ was not rebuilt.tools/d3d12_xs_surface.py.Overlap: #2098 adds function exports to the same shim table (different lines); #3520 edits
tools/d3d12_xs_surface.pyand its doc section on the four command-list IIDs that are not exported, which this does not serve either.🤖 Generated with Claude Code