Skip to content

Runtime: trace D3D12 compute setup and dispatch - #2042

Merged
ItsNotRexed merged 3 commits into
ItsNotRexed:mainfrom
Vonsek:codex/d3d12-compute-trace
Nov 22, 2026
Merged

ItsNotRexed merged 3 commits into
ItsNotRexed:mainfrom
Vonsek:codex/d3d12-compute-trace

Conversation

@Vonsek

@Vonsek Vonsek commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: trace compute setup and dispatch

What and why

Record opt-in trace entries for SetComputeRootSignature and Dispatch before validation. This shows whether startup reaches those methods, even if the dispatch cannot be recorded because compute setup is incomplete. Both entries use the existing method-name-only trace format.

Tested

  • Windows, MSVC 19.44, CPU-only synthetic command-list fixture. Before the fix, d3d12_trace failed at the missing SetComputeRootSignature entry, and the captured trace also had no Dispatch entry.
  • After the fix, ctest --test-dir build-review --output-on-failure -R '^d3d12_(gcl8|trace)$' passed both tests, including the expected trace order and the invalid command list's close result.
  • python -B -I tests/test_ctest_registration.py passed 4 tests.

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. (Not applicable.)

Notes

The two CTest cases and four Python tests above were rerun on current head 8d43271bcd727cb9732301bcc8cb9ac2b3d071f8 after merging main at ec8ec4c9. The merge keeps main's deferred bundle dispatch and records the trace when the API is called. Independent GPU comments here apply to earlier heads. No GPU was needed for the latest local checks.

AI-assisted.

Startup traces need to show whether compute setup reaches Dispatch before a graphics draw.
@itsonlysimbo

Copy link
Copy Markdown
Contributor

Tested ea9dcd17 on RTX 4070, NVIDIA 621.14, Windows 11 (10.0.26300), MSVC 19.44, Vulkan SDK 1.4.363: pass.

AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): no regression. RTX 4080 SUPER: 115/116. Not from this PR: d3d12_draw (the bundle-blend regression on main, fixed by #1995). The other Intel UHD 770 failures are known (#2078): d3d12_descriptor, d3d12_present, d3d12_m3_frame, d3d12_subgroup.

Keep the newly merged graphics descriptor trace coverage ahead of the compute calls in the shared fixture.
@ezwinxdlmao

Copy link
Copy Markdown
Contributor

Tested ea9dcd1 on an NVIDIA GeForce RTX 3050 Laptop GPU, driver 32.0.16.2101, Windows 11, native MSVC (VS 2022 Build Tools, Ninja, RelWithDebInfo), with llvm-mc 21.1.8 for the translated-shader tests: pass.

  • ctest -R d3d12_gcl8: pass. The compute trace calls compile and link with MSVC.
  • Full ctest -j3: 115/116. The one failure is d3d12_draw (bundle blend pixel 127,0,127,255; TEST-266, fixed by Tests: wait for the bundle blend draws in d3d12_draw (fence 31, not 21) #1995), which fails identically on unmodified main 4eb6155d (this PR's base) on the same GPU. No build warnings in the files this PR touches.

AI-assisted (Claude Code).

@Jadiac5

Jadiac5 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 538a9fd7 on Windows 11, MSVC 19.44.35222, Vulkan SDK 1.4.363.1, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass. This is the new head (merge of main 49475796); the earlier checks here are for ea9dcd17.

  • Ran: full ctest, then d3d12_gcl8 and d3d12_trace with -V, plain and with LEONIDA_VK_VALIDATION=1, and python -B -I tests/test_ctest_registration.py.
  • Full ctest: 125 listed, 124 run (gameinput disabled), 124 pass. d3d12_draw, which fails on 4eb6155d, passes here.
  • d3d12_trace prints "D3D12 trace verified with 18 ordered entries", also with validation on. test_ctest_registration: 4 OK.
  • The PR's own change is still the same six lines at the new head.
  • Not done: I did not build 49475796 without the PR, so "no regression" rests on 0 failures, not on a side-by-side count.

AI-assisted (Claude Code).

@NRXM

NRXM commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested ea9dcd1 (on main 4eb6155; the head has since moved to 538a9fd, not re-run) on an NVIDIA RTX 4090 (621.24) and an AMD Radeon iGPU (Ryzen 7000, RDNA2 gfx1036, driver 26.11.2 / Vulkan 2.0.353), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, RelWithDebInfo: pass for this PR.

  • the changed d3d12_gcl8 passes on both GPUs, as does its trace check in ctest
  • ctest 109/110 on each GPU; the one failure is d3d12_draw, the known TEST-266 failure on that base (fixed by Tests: wait for the bundle blend draws in d3d12_draw (fence 31, not 21) #1995, now on main)
  • LEONIDA_VK_VALIDATION=1, implicit layers off: no validation messages apart from that d3d12_draw case's VUID-vkDestroyPipeline-pipeline-00765

(AI-assisted test run.)

Trace at the Dispatch entry point while preserving the newly merged bundle replay path.
@ItsNotRexed
ItsNotRexed merged commit 5abbc60 into ItsNotRexed:main Nov 22, 2026
2 of 4 checks passed
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.

7 participants