[SM6.10] Add missing sign required for runtime data tracking - #8948
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The execution-test helper derives FillMatrix input signedness from the destination type, producing invalid unsigned-float combinations for U32 cases.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Updates SM6.10 LinAlg operations to preserve input signedness through lowering, validation, runtime metadata, and tests.
Changes:
- Adds
isInputSignedto FillMatrix and OuterProduct. - Propagates signedness through DXIL lowering and PSV generation.
- Updates validation and test baselines, including unsigned inputs.
| File | Description |
|---|---|
utils/hct/hctdb.py |
Defines new DXIL operands. |
utils/hct/gen_intrin_main.txt |
Updates builtin signatures. |
tools/clang/unittests/HLSLExec/LinAlgTests.cpp |
Updates execution shaders and signedness defines. |
tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl |
Updates availability tests. |
tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl |
Updates stage diagnostics. |
tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl |
Updates AST expectations. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-vs.ll |
Updates vertex-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-raygeneration.ll |
Updates ray-generation DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ps.ll |
Updates pixel-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-node.ll |
Updates node-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ms.ll |
Updates mesh-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-miss.ll |
Updates miss-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-intersection.ll |
Updates intersection-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-hs.ll |
Updates hull-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-gs.ll |
Updates geometry-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-ds.ll |
Updates domain-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-cs.ll |
Updates compute-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-closesthit.ll |
Updates closest-hit DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-callable.ll |
Updates callable-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-as.ll |
Updates amplification-stage DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-stage-anyhit.ll |
Updates any-hit DXIL. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-outerproduct.ll |
Tests OuterProduct signedness validation. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-non-thread-ops.ll |
Tests FillMatrix signedness validation. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast3.ll |
Updates FillMatrix declaration. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast2.ll |
Updates FillMatrix call and declaration. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-no-bitcast1.ll |
Updates FillMatrix call and declaration. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-matrixaccumulate.ll |
Updates matrix setup calls. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory.ll |
Updates groupshared test setup. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-groupshared-vector-memory-invalid.ll |
Updates invalid groupshared test. |
tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-copyconvert.ll |
Updates copy-convert setup. |
tools/clang/test/DXC/dumpPSV_LinAlgAccumulate.hlsl |
Tests unsigned PSV runtime metadata. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-lib.hlsl |
Updates library metadata tests. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/trim-target-types-metadata-compute.hlsl |
Updates compute metadata tests. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/matrix-target-type-in-struct.hlsl |
Updates struct lowering expectations. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/vector-array.hlsl |
Updates vector-array setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretomemory/nominal.hlsl |
Updates store-to-memory setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixstoretodescriptor/nominal.hlsl |
Updates descriptor-store setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixsetelement/nominal.hlsl |
Updates set-element setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixouterproduct/nominal.hlsl |
Verifies new OuterProduct lowering. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiplyaccumulate/nominal.hlsl |
Updates multiply-accumulate setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixmatrixmultiply/nominal.hlsl |
Updates multiply setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixlength/nominal.hlsl |
Updates length-test setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement/nominal.hlsl |
Updates get-element setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetcoordinate/nominal.hlsl |
Updates coordinate-test setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/vector-array.hlsl |
Updates vector accumulation setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetomemory/nominal.hlsl |
Updates memory accumulation setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulatetodescriptor/nominal.hlsl |
Updates descriptor accumulation setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixaccumulate/nominal.hlsl |
Updates matrix accumulation setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/fillmatrix/nominal.hlsl |
Verifies new FillMatrix lowering. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/copyconvertmatrix/nominal.hlsl |
Updates copy-convert setup. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl |
Tests unsigned OuterProduct API lowering. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-multiply.hlsl |
Tests unsigned Splat API lowering. |
tools/clang/test/CodeGenDXIL/hlsl/linalg/api/matrix-class.hlsl |
Updates Matrix API expectations. |
tools/clang/lib/Headers/hlsl/dx/linalg.h |
Derives signedness from input types. |
lib/HLSL/HLOperationLower.cpp |
Passes signedness into DXIL calls. |
lib/DxilValidation/DxilValidation.cpp |
Validates signedness constants and floats. |
lib/DxilContainer/DxilContainerAssembler.cpp |
Records signed vector component types. |
lib/DXIL/DxilOperations.cpp |
Updates operation signatures and overload extraction. |
include/dxc/DXIL/DxilInstructions.h |
Updates generated operand accessors. |
💡 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.
Copilot review overview
🟡 Changes recommended
U32 execution tests pass unsigned signedness for float FillMatrix operands, causing validation failures, and release-note coverage is missing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The signature changes are consistently propagated through generation, lowering, validation, runtime metadata, APIs, and comprehensive tests.
Review effort: Balanced
Findings: 1
Resolved since last review (2)
433fdb3 to
7726a9b
Compare
Finn Plummer (inbelic)
left a comment
There was a problem hiding this comment.
Mostly LGTM, just one comment to be addressed
| DXASSERT_NOMSG(isa<PointerType>(MatrixPtr->getType())); | ||
| Type *MatrixType = MatrixPtr->getType()->getPointerElementType(); | ||
| Value *Scalar = CI->getArgOperand(2); | ||
| Value *IsInputSigned = CI->getArgOperand(2); |
There was a problem hiding this comment.
In all the examples this value is an immediate val and from the validator it seems like it always has to be. Is that true? Can we create a compile time error if it isn't rather than relying on the validator? Maybe DXC doesn't have a precedent of doing so?
If it doesn't have to be a constant then maybe a test case for it would be good
There was a problem hiding this comment.
DXC doesn't have a good way (nor precedent) to surface compile-time errors. Also, at this point we're mid-optimization so even if it isn't a constant (yet) it might be before we finalize the DXIL.


Adds
IsInputSignedto FillMatrix and OuterProduct per microsoft/hlsl-specs#934 then implements on the required down stream changes.Fixes #8954
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com