llvm / llvm/offload-test-suite

[Metal] Segfaults when trying to compile `dot2add` for Metal

Open
#341 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

```hlsl
StructuredBuffer A : register(t0);
StructuredBuffer B : register(t1);
StructuredBuffer Acc : register(t2);

RWStructuredBuffer Out : register(u3);

[numthreads(1,1,1)]
void main() {
Out[0] = dot2add(A[0], B[0], Acc[0]);
Out[1] = dot2add(A[1], B[1], Acc[1]);
Out[2] = dot2add(A[2], B[2], Acc[2]);
Out[3] = dot2add(A[3], B[3], Acc[3]);
Out[4] = dot2add(A[4], B[4], Acc[4]);
Out[5] = dot2add(A[5], B[5], Acc[5]);
Out[6] = dot2add(A[6], B[6], Acc[6]);
Out[7] = dot2add(A[7], B[7], Acc[7]);
Out[8] = dot2add(A[8], B[8], Acc[8]);
Out[9] = dot2add(A[9], B[9], Acc[9]);
Out[10] = dot2add(A[10], B[10], Acc[10]);
Out[11] = dot2add(A[11], B[11], Acc[11]);

Out[12] = dot2add(half2(1, 2), half2(3, 4), float(0));
Out[13] = dot2add(half2(-1, 2), half2(3, -4), float(10));
Out[14] = dot2add(half2(65504, 1), half2(1, 65504), float(0));
Out[15] = dot2add(half2(1, -65504), half2(-65504, 1), float(-10000000));
}
```

Error messages:
```
Exit Code: 1

Command Output (stdout):
--
Signed DxilContainer written to "/var/folders/zv/v734td6n3_3fl4qmc2hcdkcc0000gn/T/lit-tmp-mn6c6t6w/source-7c69bd.dxo"
Validation succeeded.
--
Command Output (stderr):
--
/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/dot2add.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/dot2add.test.tmp # RUN: at line 104
+ /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/dot2add.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/dot2add.test.tmp
/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/clang-dxc -metal --dxv-path=/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -HV 202x -enable-16bit-types -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/dot2add.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/dot2add.test.tmp/source.hlsl # RUN: at line 105
+ /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/clang-dxc -metal --dxv-path=/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -HV 202x -enable-16bit-types -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/dot2add.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/clang-mtl/Feature/HLSLLib/Output/dot2add.test.tmp/source.hlsl
clang-dxc: error: unable to execute command: Segmentation fault: 11
clang-dxc: error: metal-shaderconverter command failed due to signal (use -v to see invocation)
clang version 22.0.0git (https://github.com/llvm/llvm-project 5165a6c197a0af5b27f6c7f6ac172d09c18623f5)
Target: dxilv1.5-unknown-shadermodel6.5-compute
Thread model: posix
InstalledDir: /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin
Build config: +assertions
clang-dxc: note: diagnostic msg: Error generating preprocessed source(s).
```
```
Exit Code: 139

Command Output (stderr):
--
/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/dot2add.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp # RUN: at line 105
+ /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/dot2add.test /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp
"/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin/dxc-3.7" -metal -enable-16bit-types -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp/source.hlsl # RUN: at line 106
+ /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin/dxc-3.7 -metal -enable-16bit-types -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp/source.hlsl
/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.script: line 3: 40539 Segmentation fault: 11 "/Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin/dxc-3.7" -metal -enable-16bit-types -T cs_6_5 -Fo /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp.o /Users/cbieneman/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot2add.test.tmp/source.hlsl
```

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 with OffloadTest/test/Feature/HLSLLib/dot2add.test and reproduce the failure using the clang-dxc and dxc-3.7 Metal commands shown in the report. Trace the Metal compilation path around this test to identify the segfault; done means the test completes without either compiler crashing.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.