Skip to content

[SPIR-V] min and max hitting assert on 16 bit integers for Vulkan target #7691

Closed

Description

@kmpeng

https://godbolt.org/z/TEaK3sazE

Discovered while running the offload-test-suite. This constant-folding case:

// RUN: %dxc -spirv -fspv-target-env=vulkan1.3 -T cs_6_5 -enable-16bit-types %s

StructuredBuffer<int16_t4> X0 : register(t0);
StructuredBuffer<int16_t4> Y0 : register(t1);

RWStructuredBuffer<int16_t4> Out0 : register(u4);

[numthreads(1,1,1)]
void main() {
  Out0[3] = min(int16_t4(0, 0, 10, 10000), int16_t4(0, 256, 4, 10001));
}

is producing this error:

# .---command stderr------------
# | Internal compiler error: LLVM Assert
# `-----------------------------
# error: command failed with exit status: 0xe0000001
Error: assert((!HasStatus(inst) || Status(inst) != SSAPropagator::kNotInteresting) && "Unsettled value")
File:
/home/kaitlinpeng/DirectXShaderCompiler/external/SPIRV-Tools/source/opt/propagator.cpp(265)
Func:   operator()
Illegal instruction (core dumped)

The same error occurs when using uint64_t.
The same error occurs with both types for the max operation as well.

Activity

  1. added
    bug
    needs-triage
    on Aug 9, 2025
  2. changed the title [-][SPIR-V] `min` hitting assert on 16 bit integers for Vulkan target[/-] [+][SPIR-V] `min` and `max` hitting assert on 16 bit integers for Vulkan target[/+] on Aug 11, 2025
  3. added a commit that references this issue on Aug 18, 2025
  4. luciechoi commented on Aug 19, 2025

    @luciechoi
    Collaborator
  5. added a commit that references this issue on Aug 19, 2025
  6. moved this from New to In progress in HLSL Roadmapon Aug 20, 2025
  7. added
    needs-triage
    and removed
    needs-triage
    on Aug 21, 2025
  8. spall commented on Aug 27, 2025

    @spall
    Collaborator

    Seeing same error with 16 bit clamp as well.

  9. moved this from In progress to Done in HLSL Roadmapon Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugspirv

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions