Skip to content

[SM6.10] LinAlg Validation: Rework Error Messages - #8776

Merged
Ashley Coleman (V-FEXrt) merged 2 commits into
microsoft:mainfrom
V-FEXrt:linalg-better-foo
Aug 14, 2026
Merged

[SM6.10] LinAlg Validation: Rework Error Messages#8776
Ashley Coleman (V-FEXrt) merged 2 commits into
microsoft:mainfrom
V-FEXrt:linalg-better-foo

Conversation

@V-FEXrt

@V-FEXrt Ashley Coleman (V-FEXrt) commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes #8768

Updates error messages to name specific things such as the failing matrix so that an operation with multiple failures on different matrices won't repeat an identical failure message each time

Copilot AI balanced review requested due to automatic review settings August 14, 2026 00:28

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

Reworks SM 6.10 LinAlg validation diagnostics to identify the specific matrix or operand that failed.

Changes:

  • Adds matrix-specific validation rules and messages.
  • Updates validator call sites and operand checks.
  • Refreshes DXIL documentation and validation tests.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utils/hct/hctdb.py Defines revised validation messages.
lib/DxilValidation/DxilValidation.cpp Emits matrix-specific diagnostics.
docs/DXIL.rst Documents revised rules.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-non-thread-ops.ll Updates scope diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll Updates metadata and K-dimension diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matvecmuladd.ll Updates multiply-add diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matvecmul.ll Updates multiply diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixstoretodescriptor.ll Updates store diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixloadfromdescriptor.ll Updates load diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixaccumulatetodescriptor.ll Updates descriptor accumulation diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixaccumulate.ll Tests operand-specific accumulation failures.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-illegal-component-type.ll Updates component-type diagnostics.
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-copyconvert.ll Updates source/destination diagnostics.
Suppressed comments (1)

lib/DxilValidation/DxilValidation.cpp:1529

  • Narrowing this predicate drops the prior diagnostic for malformed metadata whose scope is outside the MatrixScope enum and whose layout is not row/column major. Because target-type metadata is cast to MatrixScope without range validation, a LoadFromDescriptor with that metadata can newly pass this check. Preserve the previous non-Thread predicate (or explicitly reject invalid scopes).
  if ((RetLATT.Scope == DXIL::MatrixScope::Wave ||
       RetLATT.Scope == DXIL::MatrixScope::ThreadGroup) &&
      !LayoutIsRowColMajor)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/DxilValidation/DxilValidation.cpp
Comment on lines +1351 to +1353
if ((MatLATT.Scope == DXIL::MatrixScope::Wave ||
MatLATT.Scope == DXIL::MatrixScope::ThreadGroup) &&
!LayoutIsRowColMajor)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the opposite of a previous comment from copilot where it said to explicitly enumerate the cases instead of implicitly covering them by negation. I changed it here for code consistency with that previous comment so I'm going to keep it as it and disregard this.

Comment thread lib/DxilValidation/DxilValidation.cpp Outdated

@damyanp Damyan Pepper (damyanp) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but I think this is a functional change.

Also "changes the copy" - I was expecting this to involve copy constructors or something, but this is using "copy" to mean "the text" or "the wording".

@V-FEXrt

Copy link
Copy Markdown
Collaborator Author

but I think this is a functional change.

ack, i'll update. I wasn't sure myself but I suppose I should lean towards FC if its not 100% clear

but this is using "copy" to mean "the text" or "the wording".

yeah its more commonly used in places where the content is mainly written language. I'm not sure where/when I picked it up but I do like it lol. I see how its a bit confusing in compiler contexts though

@V-FEXrt Ashley Coleman (V-FEXrt) changed the title [SM6.10][NFC] LinAlg Validation: Rework Error Messages [SM6.10] LinAlg Validation: Rework Error Messages Aug 14, 2026
Copilot AI review requested due to automatic review settings August 14, 2026 01:42

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

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

Suppressed comments (1)

lib/DxilValidation/DxilValidation.cpp:1053

  • These new operand-validation paths are untested: the validation suite only checks K-dimension errors on return matrices and component-type errors on return matrices/InputInterp, so the new Arg N diagnostics—and the newly expanded validation behavior for matrix operands—could regress unnoticed. Add cases with invalid K/component metadata on matrix operands, ideally on a multi-matrix intrinsic to verify which argument is named.
    ValidateLinAlgKDim(CI, LATT, ValCtx, Name);
    ValidateLinAlgComponentType(CI, LATT.Type, ValCtx,
                                "arg " + std::to_string(Idx) + " matrix");

@V-FEXrt
Ashley Coleman (V-FEXrt) merged commit f304830 into microsoft:main Aug 14, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Aug 14, 2026
@V-FEXrt
Ashley Coleman (V-FEXrt) deleted the linalg-better-foo branch August 14, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

LinAlg Validation: Name the specific matrix that fails a validation rule

4 participants