KhronosGroup / KhronosGroup/SPIRV-Tools

Spirv-Val Does Not Validate Against Empty Structs

Open
#5,861 5 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.