microsoft / microsoft/DirectXShaderCompiler
Poor compiler failure mode for invalid GetGroupNodeOutputRecords() uniformity
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
The spec for GetGroupNodeOutputRecords() says calls and arguments must be uniform:
https://github.com/microsoft/DirectX-Specs/blob/master/d3d/WorkGraphs.md#getgroupnodeoutputrecords
A case like this, however, fails compilation (apparently for good reason):
GroupNodeOutputRecords<OutputPayload> out_payload_fe =
(svGroupId.x == 1) ? out_fe.GetGroupNodeOutputRecords(7) : out_fe.GetGroupNodeOutputRecords(recordCount + 4);
The failure manifests as "Internal Compiler error:" though. At minimum there should be better reporting of the situation here. Perhaps the spec can carve out this type of situation as well, but might not be necessary if a good compiler error message can do the job (and thus hint to applications how to refactor their code to get around it).
The diagnostic improvements should hopefully apply to any case where this situation may apply, likely many more cases than just GetGroupNodeOutputRecords().
Steps to Reproduce
Compile attached shader, e.g. dxc /T lib_6_8 PhiRepro.txt
Actual Behavior
Internal compiler error. User would be lost.
Environment
- DXC version 1.9 - 1.8.0.1 (2835e80b); dxil.dll: 1.9(1.8.2505.27)
- Host Operating System Win11
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
Start by compiling the attached PhiRepro.txt with dxc /T lib_6_8 and compare the result with the Godbolt reproduction. Trace the diagnostic path for invalid uniformity in GetGroupNodeOutputRecords() and related cases; done means the compiler reports an actionable user-facing error instead of an internal compiler error.
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
- 38/100