llvm / llvm/offload-test-suite
[SPIRV][MoltenVK] WaveReadLaneAt.Int.64.test. generating call to nonexistant function`simd_shuffle`
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18
- Forks
- 39
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 40
Description
## godbolt
https://godbolt.org/z/f119TW1YP
The error is:
```
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
```
This is very likely to be a bug we need to file in https://github.com/KhronosGroup/SPIRV-Cross. This is a place holder for now until we file an actionable ticket for them. It seems very similar to https://github.com/KhronosGroup/SPIRV-Cross/issues/2538 but don't want to reopen it prematurely.
```
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:14:46: warning: implicit conversion changes signedness: 'const long' to 'unsigned long' [-Wsign-conversion]
14 | uint64_t4 ThreadInInt = {InInt[TID.x].xyz, InInt[TID.x].w};
| ~ ^~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:14:28: warning: implicit conversion changes signedness: 'const long' to 'unsigned long' [-Wsign-conversion]
14 | uint64_t4 ThreadInInt = {InInt[TID.x].xyz, InInt[TID.x].w};
| ~^~~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:14:28: warning: implicit conversion changes signedness: 'const long' to 'unsigned long' [-Wsign-conversion]
14 | uint64_t4 ThreadInInt = {InInt[TID.x].xyz, InInt[TID.x].w};
| ~^~~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:14:28: warning: implicit conversion changes signedness: 'const long' to 'unsigned long' [-Wsign-conversion]
14 | uint64_t4 ThreadInInt = {InInt[TID.x].xyz, InInt[TID.x].w};
| ~^~~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:15:25: warning: implicit conversion changes signedness: 'uint64_t4' (aka 'vector') to 'vector' (vector of 4 'long' values) [-Wsign-conversion]
15 | OutInt[OutIdx + 1] = WaveReadLaneAt(ThreadInInt, TID.x);;
| ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:20:47: warning: implicit conversion changes signedness: 'const unsigned long' to 'long' [-Wsign-conversion]
20 | int64_t4 ThreadInUInt = {InUInt[TID.x].xyz, InUInt[TID.x].w};
| ~ ^~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:20:28: warning: implicit conversion changes signedness: 'const unsigned long' to 'long' [-Wsign-conversion]
20 | int64_t4 ThreadInUInt = {InUInt[TID.x].xyz, InUInt[TID.x].w};
| ~^~~~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:20:28: warning: implicit conversion changes signedness: 'const unsigned long' to 'long' [-Wsign-conversion]
20 | int64_t4 ThreadInUInt = {InUInt[TID.x].xyz, InUInt[TID.x].w};
| ~^~~~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:20:28: warning: implicit conversion changes signedness: 'const unsigned long' to 'long' [-Wsign-conversion]
20 | int64_t4 ThreadInUInt = {InUInt[TID.x].xyz, InUInt[TID.x].w};
| ~^~~~~~~~~~~~~~~~~
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/source.hlsl:21:26: warning: implicit conversion changes signedness: 'int64_t4' (aka 'vector') to 'vector' (vector of 4 'unsigned long' values) [-Wsign-conversion]
21 | OutUInt[OutIdx + 1] = WaveReadLaneAt(ThreadInUInt, TID.x);;
| ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 warnings generated.
/Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/bin/offloader -debug-layer -adapter-substring="MoltenVK" /Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/pipeline.yaml /Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp.o # RUN: at line 110
+ /Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/bin/offloader -debug-layer -adapter-substring=MoltenVK /Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp/pipeline.yaml /Users/farzon/Projects/builds/llvm_relwithdebinfo_offload/tools/OffloadTest/test/clang-vk/WaveOps/Output/WaveReadLaneAt.Int.64.test.tmp.o
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
program_source:91:30: warning: unused variable '_str' [-Wunused-variable]
spvUnsafeArray _str = spvUnsafeArray({ uchar(73), uchar(110), uchar(73), uchar(110), uchar(116), uchar(0) });
^
program_source:92:30: warning: unused variable '_str_2' [-Wunused-variable]
spvUnsafeArray _str_2 = spvUnsafeArray({ uchar(79), uchar(117), uchar(116), uchar(73), uchar(110), uchar(116), uchar(0) });
^
program_source:93:30: warning: unused variable '_str_4' [-Wunused-variable]
spvUnsafeArray _str_4 = spvUnsafeArray({ uchar(73), uchar(110), uchar(85), uchar(73), uchar(110), uchar(116), uchar(0) });
^
program_source:94:30: warning: unused variable '_str_6' [-Wunused-variable]
spvUnsafeArray _str_6 = spvUnsafeArray({ uchar(79), uchar(117), uchar(116), uchar(85), uchar(73), uchar(110), uchar(116), uchar(0) });
^
program_source:50:12: error: no matching function for call to 'simd_shuffle'
return simd_shuffle(value, lane);
^~~~~~~~~~~~
program_source:96:44: note: in instantiation of function template specialization 'spvSubgroupShuffle' requested here
(*spvDescriptorSet0.OutInt)._m0[_59] = spvSubgroupShuffle((*spvDescriptorSet0.InInt)._m0[gl_LocalInvocationID.x], gl_LocalInvocationID.x);
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.850/include/metal/metal_simdgroup:207:14: note: candidate template ignored: requirement '__is_valid_simdgroup_type::value' was not satisfied [with T = unsigned long __attribute__((ext_vector_type(4)))]
METAL_FUNC T simd_shuffle(T data METAL_MAYBE_UNDEF, ushort simd_lane_id)
^
program_source:50:12: error: no matching function for call to 'simd_shuffle'
return simd_shuffle(value, lane);
^~~~~~~~~~~~
program_source:100:18: note: in instantiation of function template specialization 'spvSubgroupShuffle' requested here
ulong2 _72 = spvSubgroupShuffle(_70.xy, gl_LocalInvocationID.x);
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.850/include/metal/metal_simdgroup:207:14: note: candidate template ignored: requirement '__is_valid_simdgroup_type::value' was not satisfied [with T = unsigned long __attribute__((ext_vector_type(2)))]
METAL_FUNC T simd_shuffle(T data METAL_MAYBE_UNDEF, ushort simd_lane_id)
^
.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Compute shader function could not be compiled into pipeline. See previous logged error.
gpu-exec: error: Failed to create pipeline.
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the WaveReadLaneAt.Int.64.test case and the Godbolt reproduction, then inspect the generated Metal source around spvSubgroupShuffle and compare the failure with SPIRV-Cross issue 2538. Done means producing an actionable upstream report or confirming the translation issue is resolved.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100