Skip to content

[SM6.10] Add missing sign required for runtime data tracking - #8948

Merged
Ashley Coleman (V-FEXrt) merged 3 commits into
microsoft:mainfrom
V-FEXrt:linalg-spec-934
Sep 23, 2026
Merged

Ashley Coleman (V-FEXrt) merged 3 commits into
microsoft:mainfrom
V-FEXrt:linalg-spec-934

Conversation

@V-FEXrt

@V-FEXrt Ashley Coleman (V-FEXrt) commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Adds IsInputSigned to 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity · 1 Low severity

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 isInputSigned to 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.

Comment thread tools/clang/unittests/HLSLExec/LinAlgTests.cpp Outdated
Comment thread tools/clang/lib/Headers/hlsl/dx/linalg.h
Copilot AI review requested due to automatic review settings September 22, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity · 2 Low severity

Open (3)

Comment thread utils/hct/gen_intrin_main.txt
Copilot AI review requested due to automatic review settings September 22, 2026 21:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

Open (1)
Resolved since last review (2)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The coordinated DXIL ABI, validator, lowering, metadata, and generated-interface changes warrant final human review.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@inbelic Finn Plummer (inbelic) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@V-FEXrt
Ashley Coleman (V-FEXrt) merged commit 52e2900 into microsoft:main Sep 23, 2026
13 checks passed
@V-FEXrt
Ashley Coleman (V-FEXrt) deleted the linalg-spec-934 branch September 23, 2026 18:03
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[SM6.10] Add IsInputSigned to Fill/OuterProduct

6 participants