runtime: check the device creation IID inventory #1482
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1489"
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 R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-24T12:50:03Z.
Change
This adds a device-free check for the D3D12.X device-slot inventory (
src/d3d12x_device_slots.{h,cpp}).D3D12XboxCreateDeviceusesaccepts_creation_iidto accept or refuse the device IID a caller requests, andformat_iidto write the refused IID in its diagnostic.Today's callers request only three IIDs:
__uuidof(ID3D12Device), which is accepted;{7c0e1a10-…}, which differs from every accepted IID in every byte;ID3D12Device3, fromvm_translation_device_*, which must be refused.No test asks for
ID3D12Device1, the IID that the GDK samples request throughIID_GRAPHICS_PPV_ARGS, which the inventory marksdocumented_unimplementedand this path must refuse. No test asks for an IID one byte away fromID3D12Device, or for the null IID either. As a result, a GUID comparison that skipsData3or the lastData4byte would accept a neighbor ofID3D12Device, and acceptingdocumented_unimplementedrows would acceptID3D12Device1. Both left the 26 related tests passing.d3d12x_device_slotscompilessrc/d3d12x_device_slots.cppinto a small executable, with no device and no DLL. It checks:__uuidofvalues ofID3D12Device,ID3D12Device1andID3D12Device3;ID3D12Deviceare not found and not accepted, and the same forGUID{}andIUnknown;format_iidagainst hand-written lowercase strings for those IIDs, the null IID, an all-ffIID and{01234567-89ab-cdef-0123-456789abcdef}, plus the terminating NUL.d3d12x_device_slots_device1_controlruns--mutate device1, which expectsID3D12Device1to be accepted, and must fail (WILL_FAIL).The change is test, CMake and
docs/experiments.md(the "D3D12XboxCreateDevice slot inventory and fixture" section) only.Verification
Commit
93672b99(main) plus this change,devpreset (Debug), Windows 11 Pro build 26300.9974, MSVC 19.51.36260, Windows SDK 10.0.26100.0, WARP 10.0.26100.9818.The 26 related tests passed on the unmodified source, with no skips. They are the 15 non-hardware
^(d3d12x_|d3d12_xs_shim_)tests,vm_translation_*_warp,vm_translation_shared_range,xmem_page_runs_device_warpandstartup_{null_views,view_heap,plane_size_device,title_heap_device}_warp.tests/docs_links_check.py,tests/bidi_controls_check.pyandgit diff --checkpassed.Mutation probe
I applied each mutation to
src/d3d12x_device_slots.{h,cpp}alone, rebuiltd3d12_xs.dll, ran the 26 tests, then reverted. None of this is committed.d3d12x_device_slotssame_guidignoresData4[7]same_guidignoresData3accepts_creation_iidalso acceptsdocumented_unimplementedID3D12Device1accepted)find_creation_iidalso matches vtable rowsformat_iidwith uppercase hexd3d12x_device_negative_warp)format_iidwithData2/Data3swappedID3D12Devicerow corruptedE_NOINTERFACE)ID3D12Device1row corruptedThe vtable-row mutant cannot be seen through
accepts_creation_iid, because those rows areobserved_unimplemented. Only the directfind_creation_iidcheck catches it.Checklist
AI-assisted (Claude Code).