llvm / llvm/offload-test-suite

[Metal] The Metal shader converter is unable to handle the new DXIL vectorized dot product instruction

Open
#1,481 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
18
Forks
39
Avg merge
2d 18h
Merged PRs (30d)
40

Description

Filed a bug with Apple here: https://feedbackassistant.apple.com/feedback/24450317

The following code:

```hlsl
StructuredBuffer X : register(t0);
StructuredBuffer Y : register(t1);
RWStructuredBuffer Out : register(u2);

[numthreads(1,1,1)]
void main() {
vector X5;
vector Y5;
for (uint I = 0; I < 5; ++I) {
X5[I] = X[I];
Y5[I] = Y[I];
}
Out[0] = dot(X5, Y5);
}
```

Causes an abort when compiled with shader model 6.9 (`dxc -T cs_6_9 ...`):
Failed to compile and link DXIL to Metal IR: IRErrorCodeUnsupportedInstruction

This is presumably because of long vector versions of `dx.op.dot`.

Nothing we can do but xfail until this is fixed in the shader converter. This is not technically not a driver bug but does block all Metal runtimes until it is fixed so in practice it is.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the offload test that compiles the provided HLSL with dxc -T cs_6_9 and identify how unsupported Metal shader-converter cases are recorded. Reproduce the abort, then mark this vectorized dot-product case as expected to fail until the converter supports the long dx.op.dot instruction; verify that the suite reports the expected failure.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.