microsoft / microsoft/DirectXShaderCompiler

DXIL: Deadlock when loading `RayDesc` from `ByteAddressBuffer`

Open
#5,261 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Our previous shader compiler came from https://github.com/microsoft/DirectXShaderCompiler/commit/0392e60dbc87bf8aa5cbfe826622b517fe39fde0 which worked fine. We now downloaded new blobs from https://github.com/microsoft/DirectXShaderCompiler/commit/ea3623fdf712fdab2d247e9f0c4e41daef43e9b8 / https://ci.appveyor.com/project/dnovillo/directxshadercompiler/builds/47177077 and observe a deadlock with the following pattern:

repro.hlsl:

[numthreads(32, 8, 1)] void main(uint2 threadId
                                 : SV_DispatchThreadID) {
    ByteAddressBuffer buffer = ResourceDescriptorHeap[NonUniformResourceIndex(10)];
    RayDesc result = buffer.Load<RayDesc>(sizeof(RayDesc) * 1);
}

Run dxc from the above (Windows or Linux) download, and observe that the command runs indefinitely:

./dxc-artifacts/bin/dxc -E main -T cs_6_6 repro.hlsl -Fo test

I understand RayDesc to be a simple POD, and copying that into a local RayDesc2 struct and loading that doesn't deadlock.

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

Begin with repro.hlsl and run the cited dxc command against the affected build; compare the RayDesc load with the local RayDesc2 case and inspect where compilation stops. Done means the reproducer terminates instead of deadlocking on Windows and Linux, with coverage for the RayDesc ByteAddressBuffer load.

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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.