microsoft / microsoft/DirectXShaderCompiler

[Frontend] DXC crashed with asuint()

Open
#6,713 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug crash low-hanging-fruit
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
LLVM assertion failed.

Steps to Reproduce
dxc -T cs_6_0 -spirv path/to/file.hlsl

HLSL code:

RWSturcturedBuffer<uint> Out;
[numthreads(1, 1, 1)]
void main()
{
	Out[0] = asuint(-1);
}

If we change the code as follows, the issue is not occurred.

Out[0] = asuint(-1 * 1);

Actual Behavior

Assertion failed: (SI.isSigned() == E->getType()->isSignedIntegerOrEnumerationType() && "Invalid evaluation result."), function Success, file ExprConstant.cpp, line 6199.

Environment

  • DXC version: libdxcompiler.dylib: 1.8(dev;4640-45018c75)
  • Host Operating System: Windows 11 23H2 and macOS 14.5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash with dxc -T cs_6_0 -spirv and the HLSL snippet in the issue. Inspect the constant-evaluation assertion at ExprConstant.cpp line 6199 and compare it with the non-crashing asuint(-1 * 1) case; done means the original command completes without the assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.