[SM6.10] LinAlg Validation: Rework Error Messages - #8776
Conversation
There was a problem hiding this comment.
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.
| if ((MatLATT.Scope == DXIL::MatrixScope::Wave || | ||
| MatLATT.Scope == DXIL::MatrixScope::ThreadGroup) && | ||
| !LayoutIsRowColMajor) |
There was a problem hiding this comment.
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.
Damyan Pepper (damyanp)
left a comment
There was a problem hiding this comment.
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".
ack, i'll update. I wasn't sure myself but I suppose I should lean towards FC if its not 100% clear
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 |
There was a problem hiding this comment.
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 Ndiagnostics—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");
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