KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
Add SPIR-V undefined behavior (Sanitizer)
Open
@spencer-lunarg is already working on this.
Since Mar 7, 2025.
GPU-AV
Incomplete
- Dominant language
- C++
- Stars
- 1k
- Forks
- 505
- Avg merge
- 11h 25m
- Merged PRs (30d)
- 229
Description
The SPIR-V spec has many SPIR-V Behavior is undefined spots we could add to GPU-AV
- Divide by zero for ints (
OpUDiv,OpSDiv,OpUMod,OpSMod,OpSRem) (vectors and 8/16/64-bit) - Divide by zero undefined value (
OpFMod,OpFRem) - Overflow (
OpSDiv,OpSRem, andOpSMod) - Handle
SRem/Smodfrom maintenance8 ( https://gitlab.khronos.org/vulkan/vulkan/-/issues/3870) -
OpUnreachableis hit -
ClusterSizeis not a power of 2 (OpGroupNonUniformFAdd) -
DepthReplacingand not write toFragDepth -
OpImageGathercomponent is not0, 1, 2 or 3 -
Result Typeis not wide enough to hold the converted value (OpConvertFToU,OpConvertFToS) -
(to much to track going fromResult Typedoes not match (OpConvertUToPtr,OpBitcast)PtrToU, see https://gitlab.khronos.org/spirv/SPIR-V/-/issues/906) -
OpAccessChain/OpPtrAccessChainindexes are OOB (https://gitlab.khronos.org/vulkan/vulkan/-/issues/4781)- Type punning OOB with Untyped Pointers https://gitlab.khronos.org/vulkan/vulkan/-/issues/4869
- https://registry.khronos.org/SPIR-V/specs/unified1/GLSL.std.450.html
-
Atan2if x and y are both 0. -
Powif x < 0 -
Powif if x = 0 and y ≤ 0 -
FMin/FMaxif one of the operands is a NaN -
FClamp/UClamp/SClamp/NClampif minVal > maxVal -
SmoothStepif edge0 ≥ edge1
-
Contributor guide
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.
Assessment
This issue has not been assessed yet.