microsoft / microsoft/DirectXShaderCompiler
[Debug Info] Work graph node input/output objects have no usable debug info
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Version: dxcompiler.dll 1.9(5402-0d3ee6b5)(1.9.0.5402) - 1.9.0.5402 (0d3ee6b55-dirty)
dxc -T lib_6_8 -Zi -Qembed_debug -Od -Fc <name>.ll <name>.hlsl
(a) Node object parameters get no debug info at all
Every node object parameter is absent from the emitted metadata. No
DILocalVariable, no dbg.value. Only ordinary locals and system values
survive.
| repro | node object parameter | emitted DILocalVariables |
|---|---|---|
24-DispatchNodeInputRecord.hlsl |
DispatchNodeInputRecord<MyRecord> input |
DTid, idx, val |
25-GroupNodeInputRecords.hlsl |
GroupNodeInputRecords<MyRecord> input |
groupIndex, count, record |
26-ThreadNodeInputRecord.hlsl |
ThreadNodeInputRecord<MyRecord> input |
rec |
27-EmptyNodeInput.hlsl |
EmptyNodeInput input_records |
groupIndex, recordCount |
28-NodeOutput.hlsl |
NodeOutput<MyOutputRecord> output |
val, outputRec |
29-NodeOutputArray.hlsl |
NodeOutputArray<MyOutputRecord> outputs |
selector, outputRec |
30-EmptyNodeOutput.hlsl |
EmptyNodeOutput output |
val |
The node object parameter is missing from the right column in every row. Rows
28-30 also drop their input record parameter.
(b) Record handle locals get a zeroinitializer and an empty type
GroupNodeOutputRecords<T> and ThreadNodeOutputRecords<T> locals do get a
DILocalVariable, but it carries no information:
; 31-GroupNodeOutputRecords.ll
call void @llvm.dbg.value(metadata %"struct.GroupNodeOutputRecords<MyOutputRecord>" zeroinitializer, i64 0, metadata !65, metadata !54) ; var:"outputRec" !DIExpression()
!65 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "outputRec", scope: !6, file: !1, line: 21, type: !66)
!66 = !DICompositeType(tag: DW_TAG_structure_type, name: "GroupNodeOutputRecords<MyOutputRecord>", file: !1, line: 21, size: 32, align: 32, elements: !2, templateParams: !67)
; 32-ThreadNodeOutputRecords.ll
call void @llvm.dbg.value(metadata %"struct.ThreadNodeOutputRecords<MyOutputRecord>" zeroinitializer, i64 0, metadata !67, metadata !53) ; var:"outputRec" !DIExpression()
!68 = !DICompositeType(tag: DW_TAG_structure_type, name: "ThreadNodeOutputRecords<MyOutputRecord>", file: !1, line: 20, size: 32, align: 32, elements: !2, templateParams: !69)
The value is a constant zeroinitializer and elements: !2 is the empty tuple.
The handle reports as 0 and the type exposes no members. The shader writes
outputRec.Get(0).result immediately afterwards.
Expected
A DILocalVariable for each node input/output parameter, with a location that
reaches the underlying record. The record payload type is already present in
templateParams:. At minimum it should be reachable and its fields addressable.
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 with the supplied work_graph_repros.zip files, especially 24-32, and run the documented dxc command to inspect the emitted .ll debug metadata. Compare node input/output parameters and record handles against the Expected section; done means each has usable local-variable metadata and the record payload fields are reachable.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100