GPU: add opt-in D3D12 pipeline validation diagnostics #59

Open
github-bot wants to merge 1 commit from github-bot/gh-59 into main AGit
Owner

@⁠RoachxD on GitHub · 2026-11-26 00:20 UTC · original
RoachxD:feat/d3d12-pso-diagnostics → main · +277 −10 · 5 files · 1 commits · open

Summary

  • Report debug-layer and InfoQueue activation and register an InfoQueue1 callback where supported.
  • Correlate root/pipeline load/create results with same-thread validation messages using bounded attempt IDs; report messages without a scope as unassigned.
  • Keep expected pipeline-library misses at debug level with separate quotas from creation failures. Document opt-in controls, limitations and a sanitized wave-size validation example.

Microsoft documents that callbacks can run on a different thread and must not call D3D APIs from the callback (https://devblogs.microsoft.com/directx/d3d12-debug-layer-message-callback/). This implementation has no D3D API calls in the callback, uses process-lifetime state with no borrowed context, and catches unwinds. The device belongs to a process-lifetime singleton; explicit unregister would be required if this lifetime changes. Logging is synchronous and opt-in; attribution is temporal, not causal. Unassigned messages have a separate bounded quota. The legacy queue remains available for device-removed diagnostics.

Validation

An earlier version was exercised on native NVIDIA hardware and distinguished ID 622 during pipeline creation from ID 971 during pipeline-library load. The revised standalone contribution passed Windows-target test compilation checks with and without the diagnostics feature, and the native Windows bounded_counter_and_nested_scope test (one passed, 209 filtered out). Asset-policy and diff checks passed. The identical five-file revised implementation was subsequently exercised in a native Windows startup on an RTX 3060 Laptop GPU, combined with PR #40 solely for validation. InfoQueue1 callback registration succeeded. Four targeted compute PSOs each missed the pipeline library; two were created successfully and two failed with message 622 (requested wave64 on a wave32-only device). The process exited normally. The 64-message unassigned quota was exhausted, including 62 cache misses; targeted diagnostics remained functional. Separating unassigned cache misses is a possible follow-up. Repository-wide rustfmt checks report existing deviations and six new or modified formatting hunks; the reviewed, native-tested tree is retained. PR #40 is excluded from this contribution. No rendering correctness or performance claim. No game-specific filters, shader extraction or compatibility workaround included (the optional hash selector only limits diagnostic logging).

AI assistance was used to develop and review this contribution. The author is responsible for the changes.

**@⁠RoachxD** on GitHub · 2026-11-26 00:20 UTC · [original](https://github.com/DexNom/VIctory/pull/59) `RoachxD:feat/d3d12-pso-diagnostics` → `main` · +277 −10 · 5 files · 1 commits · open ## Summary - Report debug-layer and InfoQueue activation and register an InfoQueue1 callback where supported. - Correlate root/pipeline load/create results with same-thread validation messages using bounded attempt IDs; report messages without a scope as unassigned. - Keep expected pipeline-library misses at debug level with separate quotas from creation failures. Document opt-in controls, limitations and a sanitized wave-size validation example. Microsoft documents that callbacks can run on a different thread and must not call D3D APIs from the callback (https://devblogs.microsoft.com/directx/d3d12-debug-layer-message-callback/). This implementation has no D3D API calls in the callback, uses process-lifetime state with no borrowed context, and catches unwinds. The device belongs to a process-lifetime singleton; explicit unregister would be required if this lifetime changes. Logging is synchronous and opt-in; attribution is temporal, not causal. Unassigned messages have a separate bounded quota. The legacy queue remains available for device-removed diagnostics. ## Validation An earlier version was exercised on native NVIDIA hardware and distinguished ID 622 during pipeline creation from ID 971 during pipeline-library load. The revised standalone contribution passed Windows-target test compilation checks with and without the diagnostics feature, and the native Windows bounded_counter_and_nested_scope test (one passed, 209 filtered out). Asset-policy and diff checks passed. The identical five-file revised implementation was subsequently exercised in a native Windows startup on an RTX 3060 Laptop GPU, combined with PR #40 solely for validation. InfoQueue1 callback registration succeeded. Four targeted compute PSOs each missed the pipeline library; two were created successfully and two failed with message 622 (requested wave64 on a wave32-only device). The process exited normally. The 64-message unassigned quota was exhausted, including 62 cache misses; targeted diagnostics remained functional. Separating unassigned cache misses is a possible follow-up. Repository-wide rustfmt checks report existing deviations and six new or modified formatting hunks; the reviewed, native-tested tree is retained. PR #40 is excluded from this contribution. No rendering correctness or performance claim. No game-specific filters, shader extraction or compatibility workaround included (the optional hash selector only limits diagnostic logging). AI assistance was used to develop and review this contribution. The author is responsible for the changes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:32:56 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/59/head:github-bot/gh-59'
git switch 'github-bot/gh-59'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-59'
git switch 'github-bot/gh-59'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-59'
git switch 'github-bot/gh-59'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-59'
git switch 'main'
git merge --squash 'github-bot/gh-59'
git switch 'main'
git merge --ff-only 'github-bot/gh-59'
git switch 'main'
git merge 'github-bot/gh-59'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.