Linalg vali matrixstoretodescriptor - #8771
Conversation
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Pull request overview
Adds DXIL validation rules for LinAlgMatrixStoreToDescriptor.
Changes:
- Validates layout, matrix scope, UAV resource type, and alignment.
- Adds diagnostics and negative validation tests.
- Updates existing fixtures to use valid layout and alignment values.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
utils/hct/hctdb.py |
Adds the layout validation rule. |
lib/DxilValidation/DxilValidation.cpp |
Implements descriptor-store validation. |
docs/DXIL.rst |
Documents the new diagnostic. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixstoretodescriptor.ll |
Tests invalid operands and matrix scope. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll |
Uses valid store arguments. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll |
Updates ray-tracing fixtures. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl |
Updates nominal alignment expectations. |
Suppressed comments (1)
lib/DxilValidation/DxilValidation.cpp:1188
- The nonconstant
Alignrejection is also untested: current cases cover zero and a non-multiple only. Add a runtime i32 alignment case and verify the immediate-constant diagnostic so this branch cannot regress.
} else
ValCtx.EmitInstrFormatError(CI, ValidationRule::InstrOpConst,
{"Align", "LinAlgMatrixStoreToDescriptor"});
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (2)
lib/DxilValidation/DxilValidation.cpp:1131
- This adds user-visible validation behavior for experimental Shader Model 6.10. Please add a single-sentence entry under
### Upcoming Preview Releaseindocs/ReleaseNotes.md, as required for significant compiler behavior changes byCONTRIBUTING.md.
ValidateLinAlgOpParameters(CI, ValCtx);
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixstoretodescriptor.ll:28
- This case uses an SRV RawBuffer, so it exercises only the UAV-class half of the new resource check; it would still pass if the
RawBuffer-kind check were removed. Add a second case using a UAV of a non-RawBuffer kind (for example, a typed or structured UAV) and verify the same diagnostic.
%6 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 11, i32 0 }) ; AnnotateHandle(res,props) resource: ByteAddressBuffer
call void @dx.op.linAlgMatrixStoreToDescriptor.mC8M4N4U0S1(i32 -2147483628, %dx.types.LinAlgMatrixC8M4N4U0S1 %4, %dx.types.Handle %6, i32 0, i32 0, i32 0, i32 128) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align)
Joshua Batista (bob80905)
left a comment
There was a problem hiding this comment.
Only one nit comment that I'm curious about, but it looks good to me!
| assert(dxilutil::IsHLSLLinAlgMatrixType(MatTy) && "Must be LinAlg type"); | ||
| auto MatIt = ValCtx.LinAlgTargetTypeMap.find(MatTy); | ||
| if (MatIt == ValCtx.LinAlgTargetTypeMap.end()) | ||
| return; |
There was a problem hiding this comment.
Should this really exit without a validation diagnostic?
Fixes #8497
Implements validation rules for MatrixStoreToDescriptor