Skip to content

d3d12: --trace-d3d12 records the outcome of CreateCommandSignature, CreateQueryHeap and CreateHeap - #7617

Closed
sennecools wants to merge 2 commits into
ProjectLeonida:mainfrom
sennecools:d3d12-trace-create-outcomes
Closed

sennecools wants to merge 2 commits into
ProjectLeonida:mainfrom
sennecools:d3d12-trace-create-outcomes

Conversation

@sennecools

@sennecools sennecools commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: claim

Depends on: none. It conflicts on adjacent lines with open PRs that edit the same two functions: #3929, #5129, #7330 (CreateCommandSignature) and #1846, #5808, #6257 (CreateHeap; #6569 has merged and main is merged into this branch). Whichever lands second keeps the d3d12_trace::result wrap on its returns; #1846's CreateHeap1 delegates to CreateHeap.

What and why

--trace-d3d12 left no line for CreateCommandSignature, CreateQueryHeap and CreateHeap on the Vulkan device: they returned bare HRESULTs. On the retail boot path the title calls the first two, and a refused command signature (E_NOTIMPL) was invisible in the numbered trace, so boot_trace.py counted no failed call at that stop.

Every return of the three methods now goes through d3d12_trace::result, as CreateDescriptorHeap does. HRESULTs, checks and their order are unchanged. Root signatures and pipeline creation are left to #4853.

Tested

Windows 11, MSVC (VS 2022 Build Tools), RX 9070 XT (driver 32.0.32029.2010).

  • New ctest d3d12_trace_queue (check_d3d12_trace.py --queue on d3d12_com_test, which no ctest ran before): seven new lines, ok / unsupported / failed for a command signature, ok / failed for a query heap and a heap. It fails without the .cpp change ("Missing or out-of-order trace entry") and passes with it; exit 77 skips without a Vulkan device.
  • d3d12_com, d3d12_gcl8, d3d12_trace pass; d3d12_com_test exits 0 under LEONIDA_VK_VALIDATION=1.
  • No game files used.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (no translator rule here)

…utcomes

These three device methods returned bare HRESULTs, so --trace-d3d12 left no
line for them. Every return now goes through d3d12_trace::result; the results
are unchanged. d3d12_com_test makes the calls on a device over its own Vulkan
device, and a new d3d12_trace_queue test checks the ok, unsupported and failed
lines.

AI-assisted.
@gabrielcruzg3

Copy link
Copy Markdown

Tested e8a3c08 (merged onto main 18559d50f) on NVIDIA GeForce RTX 3060 Ti (driver 621.01), Windows 11, MSVC 19.52 (VS 18), Ninja, Vulkan SDK 1.4.363.1: pass

  • ctest -R "^(d3d12_com|d3d12_trace|d3d12_trace_queue)$" (validation off): 3/3 passed (d3d12_com, d3d12_trace, d3d12_trace_queue).
  • ctest -R "^(d3d12_com|d3d12_trace|d3d12_trace_queue)$" (LEONIDA_VK_VALIDATION=1): 3/3 passed.

No game files used. AI-assisted testing.

runtime/shims/d3d12_vulkan_device.cpp conflicted in CreateHeap with ItsNotRexed#6569 (heap_desc_refusal now takes state_.uma);
kept main's call and this branch's traced d3d12_trace::result returns.

AI-assisted.
@sennecools

Copy link
Copy Markdown
Contributor Author

Merged main 867d922f0 into the branch (e8affec43): #6569 had made it conflict in CreateHeap. Kept main's heap_desc_refusal(*desc, state_.uma) call and this PR's traced returns. Main added no new return to the three functions, so all 17 still go through d3d12_trace::result (7 in CreateCommandSignature, 4 in CreateQueryHeap, 6 in CreateHeap); #6569's new UMA refusal is traced as failed through the existing return.

Re-tested: d3d12_com, d3d12_gcl8, d3d12_trace, d3d12_trace_queue pass on the RX 9070 XT (32.0.32029.2010) and on the gfx1036 iGPU, where #6569 changes behaviour; d3d12_com_test is clean under LEONIDA_VK_VALIDATION=1. With one CreateHeap return made bare again, d3d12_trace_queue fails. #6569 is now off the list of overlapping PRs in the description. AI-assisted.

@emreYilmaz28845

Copy link
Copy Markdown

Tested e8affec43 (fast-forward on main 867d922f0) on Windows 11 (SDK 10.0.26100.0, MSVC 19.44.35230.0, VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0): pass on two GPUs.

  • NVIDIA GeForce RTX 5070 Ti (driver 621.1, Vulkan 1.4.357): ctest -R ^(d3d12_com|d3d12_gcl8|d3d12_trace|d3d12_trace_queue)$ 4/4 pass; d3d12_com and d3d12_trace_queue 2/2 pass with LEONIDA_VK_VALIDATION=1.
  • AMD Radeon(TM) Graphics (RDNA2 iGPU gfx1036, Vulkan 2.0.353): ctest -R ^(d3d12_com|d3d12_gcl8|d3d12_trace|d3d12_trace_queue)$ 4/4 pass; d3d12_com and d3d12_trace_queue 2/2 pass with LEONIDA_VK_VALIDATION=1.
  • Negative control (reverting runtime/shims/d3d12_vulkan_device.cpp to 867d922f0 while keeping the PR's test changes): d3d12_trace_queue fails with Missing or out-of-order trace entry 'ID3D12Device::CreateCommandSignature ok'.

AI-assisted. No game files used.

@milas6669

Copy link
Copy Markdown

Checked head e8affec43 (main 867d922f0 already merged into it by the author) merged onto main: 4 files, +83/-17, merges cleanly. Windows 11 26200, MSVC 19.44 RelWithDebInfo, RTX 3070 (Ampere, 621.24), LEONIDA_VK_VALIDATION=1. The earlier check is an RTX 3060 Ti at e8a3c08, before main was merged in.

No game data. AI-assisted (Claude Code).

@OlaiFG7

OlaiFG7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Reviewed e8affec, code read only (not built, no MSVC or GPU here), AI-assisted: all 17 returns in CreateCommandSignature, CreateQueryHeap and CreateHeap go through d3d12_trace::result, the HRESULTs and their order are unchanged, the trace line is fixed text (method name plus ok / failed / unsupported), written under a mutex and flushed, and nothing happens when the flag is off. The new ctest returns 77 without a Vulkan device. Notes: S_FALSE is traced as "ok" (fine, but unmentioned), and the checker matches an ordered subsequence, so extra lines would not fail it. LGTM; the other open PRs on the same functions are already listed in the description.

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