@plasius/gpu-debug 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +231 -0
- package/LICENSE +203 -0
- package/README.md +332 -0
- package/dist/index.cjs +993 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +295 -0
- package/dist/index.d.ts +295 -0
- package/dist/index.js +961 -0
- package/dist/index.js.map +1 -0
- package/legal/CLA-REGISTRY.csv +2 -0
- package/legal/CLA.md +22 -0
- package/legal/CORPORATE_CLA.md +57 -0
- package/legal/INDIVIDUAL_CLA.md +91 -0
- package/package.json +99 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
type GpuDebugQueueClass = "render" | "simulation" | "lighting" | "post-processing" | "voxel" | "transfer" | "custom";
|
|
2
|
+
type GpuResourceCategory = "buffer" | "texture" | "bind-group" | "pipeline" | "custom";
|
|
3
|
+
type GpuPipelinePhase = "simulation" | "secondary-simulation" | "scene-preparation" | "render";
|
|
4
|
+
interface GpuVector3 {
|
|
5
|
+
x: number;
|
|
6
|
+
y?: number;
|
|
7
|
+
z?: number;
|
|
8
|
+
}
|
|
9
|
+
interface GpuDebugAdapterInfo {
|
|
10
|
+
label?: string;
|
|
11
|
+
vendor?: string;
|
|
12
|
+
architecture?: string;
|
|
13
|
+
driver?: string;
|
|
14
|
+
maxBufferSizeBytes?: number;
|
|
15
|
+
maxStorageBufferBindingSizeBytes?: number;
|
|
16
|
+
maxComputeInvocationsPerWorkgroup?: number;
|
|
17
|
+
maxComputeWorkgroupsPerDimension?: number;
|
|
18
|
+
memoryCapacityHintBytes?: number;
|
|
19
|
+
coreCountHint?: number;
|
|
20
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
21
|
+
}
|
|
22
|
+
interface GpuDebugSessionOptions {
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
adapter?: GpuDebugAdapterInfo;
|
|
25
|
+
maxRetainedDispatches?: number;
|
|
26
|
+
maxRetainedQueueSamples?: number;
|
|
27
|
+
maxRetainedReadyLaneSamples?: number;
|
|
28
|
+
maxRetainedDependencyUnlockSamples?: number;
|
|
29
|
+
maxRetainedPipelinePhaseSamples?: number;
|
|
30
|
+
maxRetainedWavefrontSamples?: number;
|
|
31
|
+
maxRetainedFrameSamples?: number;
|
|
32
|
+
maxTrackedAllocations?: number;
|
|
33
|
+
}
|
|
34
|
+
interface TrackedGpuAllocation {
|
|
35
|
+
id: string;
|
|
36
|
+
owner: string;
|
|
37
|
+
category: GpuResourceCategory;
|
|
38
|
+
sizeBytes: number;
|
|
39
|
+
label?: string;
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
}
|
|
42
|
+
interface GpuQueueSample {
|
|
43
|
+
owner: string;
|
|
44
|
+
queueClass: GpuDebugQueueClass;
|
|
45
|
+
depth: number;
|
|
46
|
+
capacity?: number;
|
|
47
|
+
frameId?: string;
|
|
48
|
+
signal?: AbortSignal;
|
|
49
|
+
}
|
|
50
|
+
interface GpuReadyLaneSample {
|
|
51
|
+
owner: string;
|
|
52
|
+
queueClass: GpuDebugQueueClass;
|
|
53
|
+
laneId: string;
|
|
54
|
+
priority?: number;
|
|
55
|
+
depth: number;
|
|
56
|
+
capacity?: number;
|
|
57
|
+
frameId?: string;
|
|
58
|
+
signal?: AbortSignal;
|
|
59
|
+
}
|
|
60
|
+
interface GpuDispatchSample {
|
|
61
|
+
id?: string;
|
|
62
|
+
owner: string;
|
|
63
|
+
queueClass: GpuDebugQueueClass;
|
|
64
|
+
jobType: string;
|
|
65
|
+
frameId?: string;
|
|
66
|
+
durationMs?: number;
|
|
67
|
+
workgroups: GpuVector3;
|
|
68
|
+
workgroupSize?: GpuVector3;
|
|
69
|
+
bytesRead?: number;
|
|
70
|
+
bytesWritten?: number;
|
|
71
|
+
signal?: AbortSignal;
|
|
72
|
+
}
|
|
73
|
+
interface GpuFrameSample {
|
|
74
|
+
frameId?: string;
|
|
75
|
+
frameTimeMs: number;
|
|
76
|
+
targetFrameTimeMs?: number;
|
|
77
|
+
gpuBusyMs?: number;
|
|
78
|
+
dropped?: boolean;
|
|
79
|
+
signal?: AbortSignal;
|
|
80
|
+
}
|
|
81
|
+
interface GpuDependencyUnlockSample {
|
|
82
|
+
owner: string;
|
|
83
|
+
queueClass: GpuDebugQueueClass;
|
|
84
|
+
sourceJobType: string;
|
|
85
|
+
unlockedJobType: string;
|
|
86
|
+
priority?: number;
|
|
87
|
+
unlockCount?: number;
|
|
88
|
+
frameId?: string;
|
|
89
|
+
signal?: AbortSignal;
|
|
90
|
+
}
|
|
91
|
+
interface GpuPipelinePhaseSample {
|
|
92
|
+
owner: string;
|
|
93
|
+
pipeline: GpuPipelinePhase;
|
|
94
|
+
stage: string;
|
|
95
|
+
frameId?: string;
|
|
96
|
+
durationMs?: number;
|
|
97
|
+
snapshotFrameId?: string;
|
|
98
|
+
snapshotAgeFrames?: number;
|
|
99
|
+
snapshotAgeMs?: number;
|
|
100
|
+
signal?: AbortSignal;
|
|
101
|
+
}
|
|
102
|
+
interface GpuWavefrontHitKindSample {
|
|
103
|
+
kind: string;
|
|
104
|
+
count: number;
|
|
105
|
+
}
|
|
106
|
+
interface GpuWavefrontTerminationSample {
|
|
107
|
+
reason: string;
|
|
108
|
+
count: number;
|
|
109
|
+
}
|
|
110
|
+
interface GpuWavefrontTelemetrySample {
|
|
111
|
+
owner: string;
|
|
112
|
+
queueClass: GpuDebugQueueClass;
|
|
113
|
+
frameId?: string;
|
|
114
|
+
bounceDepth: number;
|
|
115
|
+
activeRayCount: number;
|
|
116
|
+
queueCapacity?: number;
|
|
117
|
+
overflowCount?: number;
|
|
118
|
+
hitBufferCount?: number;
|
|
119
|
+
hitKinds?: readonly GpuWavefrontHitKindSample[];
|
|
120
|
+
terminationReasons?: readonly GpuWavefrontTerminationSample[];
|
|
121
|
+
signal?: AbortSignal;
|
|
122
|
+
}
|
|
123
|
+
interface GpuDebugMemorySnapshot {
|
|
124
|
+
totalTrackedBytes: number;
|
|
125
|
+
peakTrackedBytes: number;
|
|
126
|
+
allocationCount: number;
|
|
127
|
+
trackedUsageRatio?: number;
|
|
128
|
+
byOwner: readonly {
|
|
129
|
+
owner: string;
|
|
130
|
+
bytes: number;
|
|
131
|
+
}[];
|
|
132
|
+
byCategory: readonly {
|
|
133
|
+
category: GpuResourceCategory;
|
|
134
|
+
bytes: number;
|
|
135
|
+
}[];
|
|
136
|
+
}
|
|
137
|
+
interface GpuDebugDispatchSnapshot {
|
|
138
|
+
sampleCount: number;
|
|
139
|
+
totalDurationMs: number;
|
|
140
|
+
averageDurationMs?: number;
|
|
141
|
+
estimatedWorkgroups: number;
|
|
142
|
+
estimatedInvocations: number;
|
|
143
|
+
averageBytesRead?: number;
|
|
144
|
+
averageBytesWritten?: number;
|
|
145
|
+
busyRatio?: number;
|
|
146
|
+
byQueueClass: readonly {
|
|
147
|
+
queueClass: GpuDebugQueueClass;
|
|
148
|
+
dispatches: number;
|
|
149
|
+
totalDurationMs: number;
|
|
150
|
+
estimatedInvocations: number;
|
|
151
|
+
}[];
|
|
152
|
+
}
|
|
153
|
+
interface GpuDebugQueueSnapshot {
|
|
154
|
+
sampleCount: number;
|
|
155
|
+
averageDepth: number;
|
|
156
|
+
peakDepth: number;
|
|
157
|
+
peakUtilizationRatio?: number;
|
|
158
|
+
hottestQueues: readonly {
|
|
159
|
+
owner: string;
|
|
160
|
+
queueClass: GpuDebugQueueClass;
|
|
161
|
+
depth: number;
|
|
162
|
+
capacity?: number;
|
|
163
|
+
utilizationRatio?: number;
|
|
164
|
+
}[];
|
|
165
|
+
}
|
|
166
|
+
interface GpuDebugFrameSnapshot {
|
|
167
|
+
sampleCount: number;
|
|
168
|
+
latestFrameTimeMs?: number;
|
|
169
|
+
averageFrameTimeMs?: number;
|
|
170
|
+
averageTargetFrameTimeMs?: number;
|
|
171
|
+
droppedFrameRatio?: number;
|
|
172
|
+
averageGpuBusyMs?: number;
|
|
173
|
+
}
|
|
174
|
+
interface GpuDebugDagSnapshot {
|
|
175
|
+
readyLaneSampleCount: number;
|
|
176
|
+
averageReadyLaneDepth: number;
|
|
177
|
+
peakReadyLaneDepth: number;
|
|
178
|
+
peakReadyLaneUtilizationRatio?: number;
|
|
179
|
+
hottestReadyLanes: readonly {
|
|
180
|
+
owner: string;
|
|
181
|
+
queueClass: GpuDebugQueueClass;
|
|
182
|
+
laneId: string;
|
|
183
|
+
priority?: number;
|
|
184
|
+
depth: number;
|
|
185
|
+
capacity?: number;
|
|
186
|
+
utilizationRatio?: number;
|
|
187
|
+
}[];
|
|
188
|
+
dependencyUnlockSampleCount: number;
|
|
189
|
+
totalUnlockCount: number;
|
|
190
|
+
bySourceJobType: readonly {
|
|
191
|
+
owner: string;
|
|
192
|
+
queueClass: GpuDebugQueueClass;
|
|
193
|
+
sourceJobType: string;
|
|
194
|
+
unlockCount: number;
|
|
195
|
+
}[];
|
|
196
|
+
byUnlockedJobType: readonly {
|
|
197
|
+
owner: string;
|
|
198
|
+
queueClass: GpuDebugQueueClass;
|
|
199
|
+
unlockedJobType: string;
|
|
200
|
+
priority?: number;
|
|
201
|
+
unlockCount: number;
|
|
202
|
+
}[];
|
|
203
|
+
}
|
|
204
|
+
interface GpuDebugPipelineSnapshot {
|
|
205
|
+
sampleCount: number;
|
|
206
|
+
totalDurationMs: number;
|
|
207
|
+
averageDurationMs?: number;
|
|
208
|
+
averageSnapshotAgeMs?: number;
|
|
209
|
+
maxSnapshotAgeMs?: number;
|
|
210
|
+
maxSnapshotAgeFrames?: number;
|
|
211
|
+
byPipeline: readonly {
|
|
212
|
+
pipeline: GpuPipelinePhase;
|
|
213
|
+
sampleCount: number;
|
|
214
|
+
totalDurationMs: number;
|
|
215
|
+
averageDurationMs?: number;
|
|
216
|
+
averageSnapshotAgeMs?: number;
|
|
217
|
+
maxSnapshotAgeMs?: number;
|
|
218
|
+
maxSnapshotAgeFrames?: number;
|
|
219
|
+
}[];
|
|
220
|
+
hottestStages: readonly {
|
|
221
|
+
owner: string;
|
|
222
|
+
pipeline: GpuPipelinePhase;
|
|
223
|
+
stage: string;
|
|
224
|
+
frameId?: string;
|
|
225
|
+
durationMs?: number;
|
|
226
|
+
snapshotFrameId?: string;
|
|
227
|
+
snapshotAgeFrames?: number;
|
|
228
|
+
snapshotAgeMs?: number;
|
|
229
|
+
}[];
|
|
230
|
+
}
|
|
231
|
+
interface GpuDebugWavefrontSnapshot {
|
|
232
|
+
sampleCount: number;
|
|
233
|
+
averageActiveRayCount: number;
|
|
234
|
+
peakActiveRayCount: number;
|
|
235
|
+
peakQueueUtilizationRatio?: number;
|
|
236
|
+
maxBounceDepth?: number;
|
|
237
|
+
totalOverflowCount: number;
|
|
238
|
+
peakOverflowCount: number;
|
|
239
|
+
averageHitBufferCount?: number;
|
|
240
|
+
peakHitBufferCount?: number;
|
|
241
|
+
byBounceDepth: readonly {
|
|
242
|
+
bounceDepth: number;
|
|
243
|
+
sampleCount: number;
|
|
244
|
+
averageActiveRayCount: number;
|
|
245
|
+
peakActiveRayCount: number;
|
|
246
|
+
averageHitBufferCount?: number;
|
|
247
|
+
peakHitBufferCount?: number;
|
|
248
|
+
totalOverflowCount: number;
|
|
249
|
+
}[];
|
|
250
|
+
byTerminationReason: readonly {
|
|
251
|
+
reason: string;
|
|
252
|
+
count: number;
|
|
253
|
+
}[];
|
|
254
|
+
byHitKind: readonly {
|
|
255
|
+
kind: string;
|
|
256
|
+
count: number;
|
|
257
|
+
}[];
|
|
258
|
+
}
|
|
259
|
+
interface GpuDebugSnapshot {
|
|
260
|
+
enabled: boolean;
|
|
261
|
+
adapter: Readonly<GpuDebugAdapterInfo>;
|
|
262
|
+
memory: GpuDebugMemorySnapshot;
|
|
263
|
+
dispatch: GpuDebugDispatchSnapshot;
|
|
264
|
+
queues: GpuDebugQueueSnapshot;
|
|
265
|
+
frames: GpuDebugFrameSnapshot;
|
|
266
|
+
dag: GpuDebugDagSnapshot;
|
|
267
|
+
pipeline: GpuDebugPipelineSnapshot;
|
|
268
|
+
wavefront: GpuDebugWavefrontSnapshot;
|
|
269
|
+
limitations: readonly string[];
|
|
270
|
+
}
|
|
271
|
+
interface GpuDebugSession {
|
|
272
|
+
isEnabled(): boolean;
|
|
273
|
+
setEnabled(enabled: boolean): void;
|
|
274
|
+
trackAllocation(allocation: TrackedGpuAllocation): () => void;
|
|
275
|
+
releaseAllocation(id: string): boolean;
|
|
276
|
+
recordQueue(sample: GpuQueueSample): boolean;
|
|
277
|
+
recordReadyLane(sample: GpuReadyLaneSample): boolean;
|
|
278
|
+
recordDispatch(sample: GpuDispatchSample): boolean;
|
|
279
|
+
recordDependencyUnlock(sample: GpuDependencyUnlockSample): boolean;
|
|
280
|
+
recordPipelinePhase(sample: GpuPipelinePhaseSample): boolean;
|
|
281
|
+
recordWavefrontTelemetry(sample: GpuWavefrontTelemetrySample): boolean;
|
|
282
|
+
recordFrame(sample: GpuFrameSample): boolean;
|
|
283
|
+
getSnapshot(): GpuDebugSnapshot;
|
|
284
|
+
reset(): void;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
declare function estimateDispatchInvocations(sample: GpuDispatchSample): number;
|
|
288
|
+
declare function createGpuDebugSession(options?: GpuDebugSessionOptions): GpuDebugSession;
|
|
289
|
+
declare function summarizeWavefrontTelemetry(snapshot: GpuDebugWavefrontSnapshot | undefined): readonly string[];
|
|
290
|
+
|
|
291
|
+
declare const gpuDebugQueueClasses: readonly ("render" | "simulation" | "lighting" | "post-processing" | "voxel" | "transfer" | "custom")[];
|
|
292
|
+
declare const gpuResourceCategories: readonly ("custom" | "buffer" | "texture" | "bind-group" | "pipeline")[];
|
|
293
|
+
declare const gpuPipelinePhases: readonly ("render" | "simulation" | "secondary-simulation" | "scene-preparation")[];
|
|
294
|
+
|
|
295
|
+
export { type GpuDebugAdapterInfo, type GpuDebugDagSnapshot, type GpuDebugDispatchSnapshot, type GpuDebugFrameSnapshot, type GpuDebugMemorySnapshot, type GpuDebugPipelineSnapshot, type GpuDebugQueueClass, type GpuDebugQueueSnapshot, type GpuDebugSession, type GpuDebugSessionOptions, type GpuDebugSnapshot, type GpuDebugWavefrontSnapshot, type GpuDependencyUnlockSample, type GpuDispatchSample, type GpuFrameSample, type GpuPipelinePhase, type GpuPipelinePhaseSample, type GpuQueueSample, type GpuReadyLaneSample, type GpuResourceCategory, type GpuVector3, type GpuWavefrontHitKindSample, type GpuWavefrontTelemetrySample, type GpuWavefrontTerminationSample, type TrackedGpuAllocation, createGpuDebugSession, estimateDispatchInvocations, gpuDebugQueueClasses, gpuPipelinePhases, gpuResourceCategories, summarizeWavefrontTelemetry };
|