[SM6.10] LinAlg Validation: MatrixLoadFromDescriptor (new rules) - #8721
[SM6.10] LinAlg Validation: MatrixLoadFromDescriptor (new rules)#8721V-FEXrt wants to merge 3 commits into
Conversation
| ; RUN: not %dxv %s 2>&1 | FileCheck %s | ||
|
|
||
| target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" | ||
| target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" |
There was a problem hiding this comment.
There is a lot of test churn in the next 3 files. The majority of this is because when I wrote the tests initially, I directly wrote the DXIL which turned out to be wrong in a couple ways.
- I was using RWByteAddressBuffer as the template (which is disallowed)
- I was missing pretty much every annoteHandle which is also illegal DXIL
The new tests have the same CHECKs as before on the same operations so that should be the review focus over the exact test churn
| %14 = call %dx.types.LinAlgMatrixC8M4N8U2S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M4N8U2S0(i32 -2147483634, %dx.types.Handle %13, i32 0, i32 %9, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) | ||
| %15 = 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 | ||
|
|
||
|
|
There was a problem hiding this comment.
This is where the new test for the new rules are!
There was a problem hiding this comment.
Pull request overview
Implements new SM 6.10 validation rules for MatrixLoadFromDescriptor.
Changes:
- Adds alignment and Thread-scope resource validation.
- Adds validation diagnostics and documentation.
- Updates DXIL and code-generation tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
lib/DxilValidation/DxilValidation.cpp |
Implements the new validator checks. |
utils/hct/hctdb.py |
Defines the new validation rule. |
docs/DXIL.rst |
Documents the diagnostic. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixloadfromdescriptor.ll |
Tests descriptor-load validation. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-max-k-dim.ll |
Updates resource setup for existing dimension tests. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-illegal-component-type.ll |
Updates the illegal-component test resource. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixloadfromdescriptor/nominal.hlsl |
Uses a valid 128-byte alignment. |
Comments suppressed due to low confidence (1)
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixloadfromdescriptor.ll:63
- This negative case uses a raw buffer and therefore tests only UAV versus SRV. Add a Thread-scope load from a non-raw SRV (for example a typed or structured buffer) and expect rejection, so the
ByteAddressBufferhalf of the new rule cannot regress unnoticed.
; CHECK-NEXT: Function: main: error: Loading matrix with Thread scope requires SRV resource.
; CHECK-NEXT: note: at {{.*}} @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U0S0
%18 = call %dx.types.LinAlgMatrixC8M16N16U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M16N16U0S0(i32 -2147483634, %dx.types.Handle %17, i32 0, i32 %9, i32 0, i32 0) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| !0 = !{%dx.types.LinAlgMatrixC8M1025N1025U2S0 undef, i32 8, i32 1025, i32 1025, i32 2, i32 0} | ||
| !1 = !{%dx.types.LinAlgMatrixC8M16N129U0S0 undef, i32 8, i32 16, i32 129, i32 0, i32 0} | ||
| ; Below is intentionally removed to cause a missing metadata error |
There was a problem hiding this comment.
I don't see a check for this missing metadata error?
There was a problem hiding this comment.
Its on line 41!
; CHECK: Function: main: error: Metadata must be well-formed in operand count and types.
Fixes #8496
New validation rules were added to the spec for MatrixLoadFromDescriptor. This PR implements them and updates the tests