KhronosGroup / KhronosGroup/SPIRV-Tools
Spirv-Val Does Not Validate Against Empty Structs
- Dominant language
- C++
- Stars
- 1.4k
- Forks
- 709
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 28
Description
Upstream issue https://github.com/shader-slang/slang/issues/5351. You can see the problematic spirv includes a `%5 = OpTypeStruct` which is an OpTypeStruct with no arguments. This causes nvidia's drivers to segfault and causes mesa to outright the reject the pipeline.
As far as I can tell this is indeed invalid, so it would be nice to get validation against this, as it went unnoticed.
Contributor guide
Research direction
Start from the reported `%5 = OpTypeStruct` with no members and compare it with the validation path for OpTypeStruct; use the linked upstream issue as reproducer context. Add a regression case showing the construct is rejected, and confirm the validator reports an error instead of accepting it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100