microsoft / microsoft/DirectXShaderCompiler
DXIL: Deadlock when loading `RayDesc` from `ByteAddressBuffer`
Nobody has claimed this yet.
- 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
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.
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