Skip to content

Commit 0219c73

Browse files
authored
Add NonSemantic.Graph.DebugInfo extended instruction set (#406)
* Add NonSemantic.Graph.DebugInfo extended instruction set Change-Id: Ide03ca8a8abf3348a71ad0872dc735902ea560e3 * explain why a separate instruction set Change-Id: I6347aaf10dc9b563df822af9cf3bc55e630ee91d
1 parent f859b8a commit 0219c73

2 files changed

Lines changed: 169 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Note: we no longer push the HTML along side the extension.
218218
* [NonSemantic.ClspvReflection ]( https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.ClspvReflection.html)
219219
* [NonSemantic.DebugBreak ]( https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.DebugBreak.html)
220220
* [NonSemantic.DebugPrintf ]( https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.DebugPrintf.html)
221+
* [NonSemantic.Graph.DebugInfo ]( https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Graph.DebugInfo.html)
221222
* [NonSemantic.Shader.DebugInfo ]( https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html)
222223

223224
## Extended Instruction Set Specifications
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
SPIR-V Non-Semantic Graph DebugInfo Instructions
2+
================================================
3+
4+
Version 1
5+
6+
Contact
7+
-------
8+
9+
To report problems with this extended instruction set, please open a new issue at:
10+
11+
https://github.com/KhronosGroup/SPIRV-Headers
12+
13+
Contributors
14+
------------
15+
16+
- Kévin Petit, Arm Ltd.
17+
- Jan-Harald Fredriksen, Arm Ltd.
18+
- Derek Lamberti, Arm Ltd.
19+
- Davide Grohmann, Arm Ltd.
20+
21+
Notice
22+
------
23+
24+
Copyright (c) 2022-2026 Arm Ltd.
25+
26+
Status
27+
------
28+
29+
Draft.
30+
31+
Version
32+
-------
33+
34+
[width="40%",cols="25,25"]
35+
|========================================
36+
| Last Modified Date | 2026-05-15
37+
| Revision | 1
38+
|========================================
39+
40+
Dependencies
41+
------------
42+
43+
This instruction set requires SPIR-V 1.0.
44+
45+
This instruction set requires SPV_KHR_non_semantic_info.
46+
47+
This instruction set requires SPV_ARM_graph.
48+
49+
1. Introduction
50+
---------------
51+
52+
This document specifies the `NonSemantic.Graph.DebugInfo` extended instruction
53+
set. This instruction set can be used to record information about the
54+
higher-level graph representation a SPIR-V graph was produced from.
55+
56+
Import this extended instruction set using an *OpExtInstImport*
57+
`NonSemantic.Graph.DebugInfo.<ver>` instruction, where `<ver>` indicates the
58+
version.
59+
60+
2. Version
61+
----------
62+
63+
This extended instruction set is versioned. The version is specified via the
64+
import string. It must be an integer between 1 and the version specified at the
65+
beginning of this instruction set. Differences between the version are
66+
specified below.
67+
68+
3. Binary Form
69+
---------------
70+
71+
The return type for all instructions must be *OpTypeVoid*.
72+
73+
None of the instructions support forward references in their operands.
74+
75+
Instructions
76+
------------
77+
78+
[cols="2*1,3*2,1,2*2"]
79+
|=====
80+
8+|[[DebugGraph]]*DebugGraph* +
81+
+
82+
Describe a graph. +
83+
+
84+
'Graph' must be an *OpGraphARM*. +
85+
+
86+
'Name' must be an *OpString* specifying the name of the graph as it appears in the source format. +
87+
+
88+
1+| 7 | 12 | '<id>' +
89+
'Result Type' | 'Result' +
90+
'<id>' | '<id>' +
91+
'Set' | 1 | '<id>' +
92+
'Graph' |
93+
'<id>' +
94+
'Name'
95+
|=====
96+
97+
[cols="2*1,3*2,1,3*2"]
98+
|=====
99+
9+|[[DebugOperation]]*DebugOperation* +
100+
+
101+
Describe an operation. +
102+
+
103+
'DebugGraph' must be an the 'Result Id' of a *DebugGraph* instruction specifying the
104+
graph the operation is a part of. +
105+
+
106+
'Name' must be an *OpString* specifying the name of the operation. +
107+
+
108+
'Instructions' must be the 'Result Id' of instructions within the graph described by 'DebugGraph'. +
109+
+
110+
1+| 8+ | 12 | '<id>' +
111+
'Result Type' | 'Result' +
112+
'<id>' | '<id>' +
113+
'Set' | 2 | '<id>' +
114+
'DebugGraph' | '<id'> +
115+
'Name' |
116+
'<id>, <id>, ...' +
117+
'Instructions'
118+
|=====
119+
120+
[cols="2*1,3*2,1,3*2"]
121+
|=====
122+
9+|[[DebugTensor]]*DebugTensor* +
123+
+
124+
Describe a tensor. +
125+
+
126+
'Tensor' must be an _<id>_ of a value whose type is *OpTypeTensorARM* or a
127+
composite type whose top-level constituents all are of *OpTypeTensorARM* type.
128+
If 'Tensor' is a composite, then 'Index' must be present. +
129+
+
130+
'Name' must be an *OpString* specifying the name of the tensor. +
131+
+
132+
'Index' must be a 32-bit unsigned integer and must come from a constant
133+
instruction. When 'Index' is present, 'Tensor' must be a value of composite
134+
type and 'Index' specifies the individual constituent being described. +
135+
+
136+
1+| 7+ | 12 | '<id>' +
137+
'Result Type' | 'Result' +
138+
'<id>' | '<id>' +
139+
'Set' | 3 | '<id>' +
140+
'Tensor' | '<id'> +
141+
'Name' |
142+
'Optional <id>' +
143+
'Index'
144+
|=====
145+
146+
Issues
147+
------
148+
149+
1) Why is this a separate instruction set and not included in
150+
`NonSemantic.Shader.DebugInfo`? +
151+
+
152+
*RESOLVED*: Graphs are still a fairly new construct and currently defined by
153+
a vendor extension. A separate instruction set allows for greater freedom
154+
of exploration and makes it easier to deprecate and/or remove functionality
155+
in the future with a lower impact on the users of `NonSemantic.Shader.DebugInfo`.
156+
+
157+
158+
Revision History
159+
----------------
160+
161+
[cols="5,15,15,70"]
162+
[grid="rows"]
163+
[options="header"]
164+
|========================================
165+
|Rev|Date|Author|Changes
166+
|1|2026-05-15|Kevin Petit|Initial revision
167+
|========================================
168+

0 commit comments

Comments
 (0)