Skip to content

[SM6.10] LinAlg Validation: CopyConvert Builtin#8612

Open
V-FEXrt wants to merge 2 commits into
microsoft:mainfrom
V-FEXrt:linalg-validation-copyconvert
Open

[SM6.10] LinAlg Validation: CopyConvert Builtin#8612
V-FEXrt wants to merge 2 commits into
microsoft:mainfrom
V-FEXrt:linalg-validation-copyconvert

Conversation

@V-FEXrt

@V-FEXrt V-FEXrt commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #8495

Add validation rules for the copy covert builtin

@alsepkow alsepkow 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.

A few comments from your friendly pair pr reviews @inbelic @Icohedron

Comment thread lib/DxilValidation/DxilValidation.cpp Outdated
auto DstIt = ValCtx.LinAlgTargetTypeMap.find(DstMatTy);
auto SrcIt = ValCtx.LinAlgTargetTypeMap.find(SrcMatTy);
if (DstIt == ValCtx.LinAlgTargetTypeMap.end())
break;

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.

Am I missing something here, I would have thought these should be an error condition. But the break seems to imply we do nothing?

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.

My friend copilot pointed out that they are already validated via the ValidateLinAlg* calls at the start of the switch case. So maybe these should be asserts instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

They are validated via those calls! We don't want to assert here though as the validation raises validation errors that should be pretty printed and all that jazz. Instead we just stop processing knowing that an error has already been raised and will be reported to the user (along with any other errors seen along the way)

@@ -0,0 +1,81 @@
; REQUIRES: dxil-1-10

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.

Do we plan on adding passing test cases for this later? I noticed that some test files have a filename-passing.ll variant. Looks like all of the existing linalg tests right now are just failing cases?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We already have passing tests! They are under tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/<builtin name>/nominal.hlsl

My understanding is that LitDxilValidation is for testing things that should raise validation failures

Co-authored-by: Alex Sepkowski <alexsepkowski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

LinAlg Validation: CopyConvertMatrix

3 participants