Skip to content

[PIX] Skip NURI handles with no instruction number - #8844

Open
Damyan Pepper (damyanp) wants to merge 1 commit into
users/damyanp/pix-fixes-02from
users/damyanp/pix-fixes-03
Open

[PIX] Skip NURI handles with no instruction number#8844
Damyan Pepper (damyanp) wants to merge 1 commit into
users/damyanp/pix-fixes-02from
users/damyanp/pix-fixes-03

Conversation

@damyanp

@damyanp Damyan Pepper (damyanp) commented Aug 27, 2026

Copy link
Copy Markdown
Member

Part 3 of 14 in the PIX instrumentation stack. It targets users/damyanp/pix-fixes-02, which supplies the shared instrumentation helpers.

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

This changes only the PIX instrumentation, so it needs no release note.


Stack created with GitHub Stacks CLIGive Feedback 💬

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

3 participants