[SM6.10] LinAlg Validation: Fill GetElem SetElem GetCoord - #8759
Open
Ashley Coleman (V-FEXrt) wants to merge 1 commit into
Open
[SM6.10] LinAlg Validation: Fill GetElem SetElem GetCoord#8759Ashley Coleman (V-FEXrt) wants to merge 1 commit into
Ashley Coleman (V-FEXrt) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SM 6.10 validation requiring selected LinAlg matrix operations to use Wave or ThreadGroup scope.
Changes:
- Adds scope validation and diagnostics for Fill, GetElement, SetElement, and GetCoordinate.
- Adds invalid Thread-scope validation coverage.
- Updates affected LinAlg tests to use valid initialization paths and scopes.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
utils/hct/hctdb.py |
Defines the new scope-mismatch rule. |
lib/DxilValidation/DxilValidation.cpp |
Implements scope validation. |
docs/DXIL.rst |
Documents the diagnostic. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-non-thread-ops.ll |
Tests rejected Thread scopes. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-copyconvert.ll |
Avoids invalid Thread-scope Fill setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl |
Updates library metadata expectations. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl |
Updates compute metadata expectations. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiplyadd/nominal.hlsl |
Loads Thread matrices from descriptors. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixvectormultiply/nominal.hlsl |
Replaces invalid Thread-scope Fill. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl |
Uses a valid Wave-scoped accumulator. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl |
Covers valid Wave and ThreadGroup Fill operations. |
Suppressed comments (4)
lib/DxilValidation/DxilValidation.cpp:1121
- This only rejects the known
Threadenumerator, so malformed target metadata with any other scope value passes even though the rule requires the scope to be eitherWaveorThreadGroup. Check the two allowed values explicitly.
if (MatLATT.Scope == DXIL::MatrixScope::Thread)
lib/DxilValidation/DxilValidation.cpp:1356
- This only rejects the known
Threadenumerator, so malformed target metadata with any other scope value passes even though the rule requires the scope to be eitherWaveorThreadGroup. Check the two allowed values explicitly.
if (RetMatLATT.Scope == DXIL::MatrixScope::Thread)
lib/DxilValidation/DxilValidation.cpp:1393
- This only rejects the known
Threadenumerator, so malformed target metadata with any other scope value passes even though the rule requires the output scope to be eitherWaveorThreadGroup. Check the two allowed values explicitly.
if (RetMatLATT.Scope == DXIL::MatrixScope::Thread)
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl:33
- The new comment says this is a 3×4 matrix, but the attributes and checks use M=8 and N=4. Keep the explanatory type synchronized with the test input.
// Matrix<U32, 3, 4, A, ThreadGroup>
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return; | ||
| LinAlgTargetType MatLATT = MatIt->second; | ||
|
|
||
| if (MatLATT.Scope == DXIL::MatrixScope::Thread) |
Comment on lines
+1347
to
+1348
| DxilInst_LinAlgMatrixSetElement Op(CI); | ||
| Type *RetMatTy = CI->getType(); |
Comment on lines
+1388
to
+1391
| if (InMatLATT.Scope == DXIL::MatrixScope::Thread) | ||
| ValCtx.EmitInstrFormatError( | ||
| CI, ValidationRule::InstrLinAlgMatrixScopeMismatch2, | ||
| {MatrixScopeToString(InMatLATT.Scope), "Wave", "ThreadGroup"}); |
| ValidationContext &ValCtx) { | ||
| ValidateLinAlgOpParameters(CI, ValCtx); | ||
|
|
||
| DxilInst_LinAlgMatrixGetCoordinate Op(CI); |
| __builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(5, 3, 4, 0, 0)]] mat2; | ||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M8N4U0S1*, float)" | ||
| // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M8N4U0S1* {{.*}}, float 0x40091EB860000000) | ||
| // Matrix<U32, 3, 4, A, Wave> |
| // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M3N4U0S0* {{.*}}, i64 %{{.+}}) | ||
| // CHECK2: call void @"dx.hl.op..void (i32, %dx.types.LinAlgMatrixC5M4N4U1S1*, i64)" | ||
| // CHECK2-SAME: (i32 402, %dx.types.LinAlgMatrixC5M4N4U1S1* {{.*}}, i64 %{{.+}}) | ||
| // Matrix<U32, 3, 4, B, Wave> |
Damyan Pepper (damyanp)
requested review from
Jack Elliott (JoeCitizen) and
Finn Plummer (inbelic)
August 11, 2026 18:03
Jack Elliott (JoeCitizen)
approved these changes
Aug 11, 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.
Fixes #8698
Fixes #8699
Fixes #8700
Fixes #8701
Implements validation rules for Fill, GetElement, SetElement, and GetCoordinate that all share the same singular rule