Skip to content

runtime: add unit test suite for console command list IID mapping (RT-XS-COMMAND-LIST-IID-COVERAGE) - #2039

Open
abnalstlll-byte wants to merge 1 commit into
ProjectLeonida:mainfrom
abnalstlll-byte:feat/rt-xs-command-list-iid-coverage
Open

abnalstlll-byte wants to merge 1 commit into
ProjectLeonida:mainfrom
abnalstlll-byte:feat/rt-xs-command-list-iid-coverage

Conversation

@abnalstlll-byte

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: RT-XS-COMMAND-LIST-IID-COVERAGE (claim)

What and why

runtime/shims/d3d12_xs_command_list_iid.h provides mapping for console command-list interface IDs passed to device slot 73 (CreateCommandListX). The console passes a specific GUID whose PC counterpart is ID3D12GraphicsCommandList6 (sharing identical first 32 bits Data1). Unmapped console IIDs fail on the PC device with E_NOINTERFACE.

Previously, d3d12_xs_command_list_iid.h had no dedicated unit test.

This adds runtime/test/d3d12_xs_command_list_iid_test.cpp verifying:

  1. kCommandListIidPairs & command_list_iid_for_pc:
    • Maps measured console command list IID c3827890-4024-474c-98cf-645b51dc4874 to PC ID3D12GraphicsCommandList6 (c3827890-e548-4cfa-96cf-5689a9370f80), verifying identical Data1 and setting mapped == true.
    • Safely handles mapped == nullptr.
  2. is_pc_command_list_iid:
    • Validates that standard PC command list interfaces (ID3D12CommandList, ID3D12GraphicsCommandList, and 1 through 7) are recognized as PC IIDs.
    • Rejects non-command list interfaces (IUnknown, ID3D12Device, ID3D12Resource) and console IIDs.
  3. Pass-through of unmodified PC IIDs and unknown random IIDs (mapped == false).

Registers d3d12_xs_command_list_iid_test and CTest in runtime/CMakeLists.txt.

Tested

  • Unit test execution: 24/24 checks passed (0 failures).
  • python -I tests/test_ci_registration.py: 16/16 pass.
  • python -I tests/test_text_write_line_endings.py: 3/3 pass.
  • python -I scripts/check_no_game_data.py: clean (0 violations, no game data).

AI-assisted (Claude Code)

…-XS-COMMAND-LIST-IID-COVERAGE)

Add standalone CPU-only unit test runtime/test/d3d12_xs_command_list_iid_test.cpp covering console command list IID mapping to PC ID3D12GraphicsCommandList6, classification of PC command list IIDs (is_pc_command_list_iid), and pass-through of PC and unknown IIDs.

Register d3d12_xs_command_list_iid_test executable and CTest in runtime/CMakeLists.txt.

AI-assisted (Claude Code)
@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Verified on Windows 11 (10.0.26200.9974) with MSVC 19.44.35228 (x64, Windows SDK 10.0.26100+, /std:c++20 /EHsc /W4 /permissive- /utf-8 /O2) against main d48a957bb + c22177dd67 (claim #2570#issuecomment-7239425776):

  • Line-by-line diff audit: Clean (runtime/CMakeLists.txt, runtime/test/d3d12_xs_command_list_iid_test.cpp); adds Win32/D3D12 unit coverage for command_list_iid_for_pc (console GCL6 -> PC ID3D12GraphicsCommandList6, mapped out-pointer & nullptr safety, PC/unknown pass-through) and is_pc_command_list_iid (ID3D12CommandList..ID3D12GraphicsCommandList7 vs IUnknown/ID3D12Device/ID3D12Resource/console IID). check_no_game_data.py clean.
  • Red (d48a957bb / fault injection): d3d12_xs_command_list_iid_test.cpp is absent on main (C1083), and mutating 0xe548 -> 0xe549 in d3d12_xs_command_list_iid.h fails Red (rc=1, FAIL console command list IID maps to PC ID3D12GraphicsCommandList6, 22/24 checks passed).
  • Green (d48a957bb + c22177dd67 merge): Auto-merges cleanly (rc=0), compiles with 0 warnings under /W4 /permissive-, and passes (24/24 checks passed, rc=0).
  • Coordination note with #2034: Both #2034 and #2039 insert adjacent blocks at the same lines of runtime/CMakeLists.txt (git merge-tree rc=1 trivial additive conflict once the first merges).

AI-assisted.

@OreoFR

OreoFR commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Verified by OreoFR

  • Base: main aa918e5d9 + PR head c22177dd6
  • Test: ctest -R ^d3d12_xs_command_list_iid$
  • Red on main: passes (test-only PR, the new test covers behaviour already on main)
  • Green with the PR: passes; package builds, full ctest shows no new failure
  • Verdict: NO RED (test-only PR, no fix to show)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

Note: shares runtime/CMakeLists.txt with the open #2566; a rebase may be needed if #2566 lands first.

AI-assisted (Claude Code, Claude Opus 5.5).

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.

3 participants