[PIX] Skip NURI handles with no instruction number - #8844
Open
Damyan Pepper (damyanp) wants to merge 1 commit into
Open
[PIX] Skip NURI handles with no instruction number#8844Damyan Pepper (damyanp) wants to merge 1 commit into
Damyan Pepper (damyanp) wants to merge 1 commit into
Conversation
The non-uniform resource index pass writes each diagnostic bit at an address that it computes from the PIX instruction number of the handle. If a handle has no instruction number, the value stays at 0. A debug build stops at an assertion. A release build writes the bit for instruction 0 and gives the diagnostic to an unrelated instruction. Library helper functions are the usual source of these handles. The pass ignores such a handle instead of guessing. An absent record is correct. A record at instruction 0 is wrong. The report NuriNotInstrumentedMissingInstructionNumber tells the caller that the data is not complete. The pass reads the instruction number before it makes the UAV. A module whose dynamic handles all lack an instruction number therefore gets no UAV that it cannot use. A PIX build that does not read the new report keeps its current behavior. Assisted-by: Copilot Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 40dc9de3-617e-4caf-ab0d-fba0a033ed93
Damyan Pepper (damyanp)
requested a review
from Austin Kinross (austinkinross)
August 27, 2026 23:31
Damyan Pepper (damyanp)
marked this pull request as ready for review
August 27, 2026 23:33
Contributor
There was a problem hiding this comment.
Pull request overview
Updates PIX NURI instrumentation to skip handles lacking instruction ordinals and report incomplete diagnostics.
Changes:
- Detects and reports missing instruction numbers.
- Avoids creating unused PIX UAVs.
- Adds coverage for annotated, unannotated, and library-helper handles.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
lib/DxilPIXPasses/DxilNonUniformResourceIndexInstrumentation.cpp |
Skips unnumbered handles and emits a report. |
tools/clang/test/HLSLFileCheck/pix/NonUniformResourceIndexNoInstructionNumbers.hlsl |
Tests missing-ordinal handling. |
tools/clang/test/HLSLFileCheck/pix/NonUniformResourceIndexInstructionNumber.hlsl |
Tests numbered-handle instrumentation. |
tools/clang/test/HLSLFileCheck/pix/NonUniformResourceIndexLibraryHelper.hlsl |
Tests instrumentation within library helpers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // CHECK-NOT: FoundDynamicIndexingNoNuri | ||
| // CHECK: NuriNotInstrumentedMissingInstructionNumber | ||
| // CHECK-NOT: @dx.op.waveActiveAllEqual | ||
| // CHECK-NOT: @dx.op.atomicBinOp |
Comment on lines
+3
to
+10
| // With the annotation prepass in place, the diagnostic is addressed to | ||
| // the ordinal of the createHandle that performed the unmarked dynamic | ||
| // indexing. The pass encodes that ordinal as a shift. A shift of zero | ||
| // aliases the diagnostic onto bit 0. | ||
| // | ||
| // Match any non-zero shift rather than a literal ordinal. A createHandle | ||
| // whose index comes from an interpolated input is never the first | ||
| // numbered instruction. |
Austin Kinross (austinkinross)
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The non-uniform resource index pass writes each diagnostic bit at an address that it computes from the PIX instruction number of the handle. If a handle has no instruction number, the value stays at 0. A debug build stops at an assertion. A release build writes the bit for instruction 0 and gives the diagnostic to an unrelated instruction. Library helper functions are the usual source of these handles.
The pass ignores such a handle instead of guessing. An absent record is correct. A record at instruction 0 is wrong. The report NuriNotInstrumentedMissingInstructionNumber tells the caller that the data is not complete.
The pass reads the instruction number before it makes the UAV. A module whose dynamic handles all lack an instruction number therefore gets no UAV that it cannot use.
A PIX build that does not read the new report keeps its current behavior.
Assisted-by: Copilot
Stack created with GitHub Stacks CLI • Give Feedback 💬