@zenfg/inspector 0.1.0-beta.3 → 0.1.0
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/GUIDE.md +182 -0
- package/README.md +61 -89
- package/THEMING.md +124 -0
- package/dist/FrameGraphInspector.d.ts +23 -4
- package/dist/FrameGraphInspector.d.ts.map +1 -1
- package/dist/FrameGraphInspector.js +137 -29
- package/dist/FrameGraphInspector.js.map +1 -1
- package/dist/capture.d.ts +5 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +2 -0
- package/dist/capture.js.map +1 -0
- package/dist/debugCaptureModel.d.ts +19 -0
- package/dist/debugCaptureModel.d.ts.map +1 -1
- package/dist/debugCaptureModel.js +36 -2
- package/dist/debugCaptureModel.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/panelAliasAnalysis.d.ts +1 -0
- package/dist/panelAliasAnalysis.d.ts.map +1 -1
- package/dist/panelAliasAnalysis.js +23 -54
- package/dist/panelAliasAnalysis.js.map +1 -1
- package/dist/panelCytoscapeGraphRenderer.d.ts +15 -2
- package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -1
- package/dist/panelCytoscapeGraphRenderer.js +145 -23
- package/dist/panelCytoscapeGraphRenderer.js.map +1 -1
- package/dist/panelDetailLayout.d.ts +27 -0
- package/dist/panelDetailLayout.d.ts.map +1 -0
- package/dist/panelDetailLayout.js +174 -0
- package/dist/panelDetailLayout.js.map +1 -0
- package/dist/panelDetailStyles.d.ts +2 -0
- package/dist/panelDetailStyles.d.ts.map +1 -0
- package/dist/panelDetailStyles.js +57 -0
- package/dist/panelDetailStyles.js.map +1 -0
- package/dist/panelDiagnosticsView.d.ts +10 -1
- package/dist/panelDiagnosticsView.d.ts.map +1 -1
- package/dist/panelDiagnosticsView.js +166 -57
- package/dist/panelDiagnosticsView.js.map +1 -1
- package/dist/panelDomHelpers.d.ts.map +1 -1
- package/dist/panelDomHelpers.js +6 -5
- package/dist/panelDomHelpers.js.map +1 -1
- package/dist/panelGraphLayout.d.ts +3 -2
- package/dist/panelGraphLayout.d.ts.map +1 -1
- package/dist/panelGraphLayout.js +6 -5
- package/dist/panelGraphLayout.js.map +1 -1
- package/dist/panelGraphRenderer.d.ts +10 -0
- package/dist/panelGraphRenderer.d.ts.map +1 -1
- package/dist/panelGraphRenderer.js.map +1 -1
- package/dist/panelGraphScene.d.ts +1 -0
- package/dist/panelGraphScene.d.ts.map +1 -1
- package/dist/panelGraphScene.js +69 -32
- package/dist/panelGraphScene.js.map +1 -1
- package/dist/panelGraphSearch.d.ts +16 -0
- package/dist/panelGraphSearch.d.ts.map +1 -0
- package/dist/panelGraphSearch.js +93 -0
- package/dist/panelGraphSearch.js.map +1 -0
- package/dist/panelGraphView.d.ts +82 -0
- package/dist/panelGraphView.d.ts.map +1 -1
- package/dist/panelGraphView.js +15 -4
- package/dist/panelGraphView.js.map +1 -1
- package/dist/panelGraphVisuals.d.ts +14 -6
- package/dist/panelGraphVisuals.d.ts.map +1 -1
- package/dist/panelGraphVisuals.js +126 -51
- package/dist/panelGraphVisuals.js.map +1 -1
- package/dist/panelInspectorView.d.ts +8 -0
- package/dist/panelInspectorView.d.ts.map +1 -1
- package/dist/panelInspectorView.js +242 -48
- package/dist/panelInspectorView.js.map +1 -1
- package/dist/panelListStyles.d.ts +3 -0
- package/dist/panelListStyles.d.ts.map +1 -0
- package/dist/panelListStyles.js +155 -0
- package/dist/panelListStyles.js.map +1 -0
- package/dist/panelMemoryStyles.d.ts +3 -0
- package/dist/panelMemoryStyles.d.ts.map +1 -0
- package/dist/panelMemoryStyles.js +42 -0
- package/dist/panelMemoryStyles.js.map +1 -0
- package/dist/panelMemoryView.d.ts +13 -1
- package/dist/panelMemoryView.d.ts.map +1 -1
- package/dist/panelMemoryView.js +161 -41
- package/dist/panelMemoryView.js.map +1 -1
- package/dist/panelPassesView.d.ts +15 -0
- package/dist/panelPassesView.d.ts.map +1 -1
- package/dist/panelPassesView.js +202 -72
- package/dist/panelPassesView.js.map +1 -1
- package/dist/panelRawView.d.ts +15 -0
- package/dist/panelRawView.d.ts.map +1 -0
- package/dist/panelRawView.js +105 -0
- package/dist/panelRawView.js.map +1 -0
- package/dist/panelResourcesView.d.ts +8 -0
- package/dist/panelResourcesView.d.ts.map +1 -1
- package/dist/panelResourcesView.js +62 -31
- package/dist/panelResourcesView.js.map +1 -1
- package/dist/panelSelection.d.ts +9 -1
- package/dist/panelSelection.d.ts.map +1 -1
- package/dist/panelSelection.js +34 -4
- package/dist/panelSelection.js.map +1 -1
- package/dist/panelTheme.d.ts +13 -0
- package/dist/panelTheme.d.ts.map +1 -0
- package/dist/panelTheme.js +104 -0
- package/dist/panelTheme.js.map +1 -0
- package/dist/panelTypes.d.ts +10 -1
- package/dist/panelTypes.d.ts.map +1 -1
- package/dist/panelTypes.js.map +1 -1
- package/dist/panelVisualTheme.d.ts +147 -50
- package/dist/panelVisualTheme.d.ts.map +1 -1
- package/dist/panelVisualTheme.js +34 -44
- package/dist/panelVisualTheme.js.map +1 -1
- package/dist/panelWorkbenchHelpers.d.ts +12 -1
- package/dist/panelWorkbenchHelpers.d.ts.map +1 -1
- package/dist/panelWorkbenchHelpers.js +62 -1
- package/dist/panelWorkbenchHelpers.js.map +1 -1
- package/dist/panelWorkbenchStyles.d.ts +2 -0
- package/dist/panelWorkbenchStyles.d.ts.map +1 -0
- package/dist/panelWorkbenchStyles.js +101 -0
- package/dist/panelWorkbenchStyles.js.map +1 -0
- package/dist/panelWorkbenchView.d.ts +16 -0
- package/dist/panelWorkbenchView.d.ts.map +1 -1
- package/dist/panelWorkbenchView.js +228 -50
- package/dist/panelWorkbenchView.js.map +1 -1
- package/dist/query.js.map +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +147 -195
- package/dist/styles.js.map +1 -1
- package/dist/theme.d.ts +22 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +10 -0
- package/dist/theme.js.map +1 -0
- package/dist/themeDefinitions.d.ts +251 -0
- package/dist/themeDefinitions.d.ts.map +1 -0
- package/dist/themeDefinitions.js +96 -0
- package/dist/themeDefinitions.js.map +1 -0
- package/dist/themePalette.d.ts +66 -0
- package/dist/themePalette.d.ts.map +1 -0
- package/dist/themePalette.js +37 -0
- package/dist/themePalette.js.map +1 -0
- package/dist/themes.css +165 -0
- package/package.json +44 -10
- package/src/FrameGraphInspector.ts +130 -31
- package/src/capture.ts +4 -0
- package/src/debugCaptureModel.ts +53 -2
- package/src/index.ts +6 -2
- package/src/panelAliasAnalysis.ts +24 -70
- package/src/panelCytoscapeGraphRenderer.ts +140 -23
- package/src/panelDetailLayout.ts +155 -0
- package/src/panelDetailStyles.ts +56 -0
- package/src/panelDiagnosticsView.ts +166 -85
- package/src/panelDomHelpers.ts +4 -5
- package/src/panelGraphLayout.ts +6 -5
- package/src/panelGraphRenderer.ts +7 -0
- package/src/panelGraphScene.ts +68 -30
- package/src/panelGraphSearch.ts +96 -0
- package/src/panelGraphView.ts +14 -4
- package/src/panelGraphVisuals.ts +122 -52
- package/src/panelInspectorView.ts +227 -48
- package/src/panelListStyles.ts +154 -0
- package/src/panelMemoryStyles.ts +41 -0
- package/src/panelMemoryView.ts +178 -53
- package/src/panelPassesView.ts +190 -137
- package/src/panelRawView.ts +99 -0
- package/src/panelResourcesView.ts +69 -56
- package/src/panelSelection.ts +37 -5
- package/src/panelTheme.ts +85 -0
- package/src/panelTypes.ts +7 -1
- package/src/panelVisualTheme.ts +38 -49
- package/src/panelWorkbenchHelpers.ts +60 -2
- package/src/panelWorkbenchStyles.ts +100 -0
- package/src/panelWorkbenchView.ts +201 -52
- package/src/query.ts +11 -11
- package/src/styles.ts +148 -195
- package/src/theme.ts +24 -0
- package/src/themeDefinitions.ts +103 -0
- package/src/themePalette.ts +44 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugCaptureModel.d.ts","sourceRoot":"","sources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AAE,MAAM,CAAC;KAC3C,GACC;QACE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;QAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QACrC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,4BAA4B,EAAE;YAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;SAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC5F,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;KACjC,CAAC;IACT,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;IAClE,QAAQ,CAAC,YAAY,EAAE;QACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;QACjC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;KAChC,CAAC;CACF,CAAC;AAEF,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,GAAE,6BAA+E,GACrF,wBAAwB,CAwP1B;AAmFD,sFAAsF;AACtF,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,QAAQ,EAAE,SAAS,yBAAyB,EAAE,EAC9C,KAAK,EAAE,SAAS,mBAAmB,EAAE,GACnC,SAAS,yBAAyB,EAAE,CAUtC"}
|
|
@@ -18,6 +18,7 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
18
18
|
? { ...source, migratedFromLegacy: true }
|
|
19
19
|
: source;
|
|
20
20
|
const gpuTiming = snapshot.timings.gpu;
|
|
21
|
+
const cpuTimings = new Map(snapshot.timings.cpu.status === 'available' ? snapshot.timings.cpu.nodes.map(node => [node.nodeId, node.durationMicros]) : []);
|
|
21
22
|
const resourcePool = snapshot.memory.poolReport;
|
|
22
23
|
const normalizedGroups = normalizeDebugGroups(compilation);
|
|
23
24
|
const knownGroupIds = new Set(normalizedGroups.map((group) => group.id));
|
|
@@ -78,6 +79,7 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
78
79
|
sideEffect: node.sideEffect,
|
|
79
80
|
debugGroupId: node.groupId,
|
|
80
81
|
gpuDurationMicros: timings.get(node.id),
|
|
82
|
+
cpuDurationMicros: cpuTimings.get(node.id),
|
|
81
83
|
reads: nodeAccesses(node.id, 'read'),
|
|
82
84
|
writes: nodeAccesses(node.id, 'write'),
|
|
83
85
|
}));
|
|
@@ -146,6 +148,19 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
146
148
|
executionSegments,
|
|
147
149
|
});
|
|
148
150
|
const nodeById = new Map(nodes.map((node) => [node.id, node]));
|
|
151
|
+
const canonicalNodeById = new Map(compilation.nodes.map((node) => [node.id, node]));
|
|
152
|
+
const culledById = new Map(culledNodes.map((entry) => [entry.node.id, entry]));
|
|
153
|
+
const diagnosticsByNodeId = new Map();
|
|
154
|
+
const diagnosticsByResourceId = new Map();
|
|
155
|
+
for (const diagnostic of snapshot.diagnostics) {
|
|
156
|
+
for (const [id, index] of [[diagnostic.nodeId, diagnosticsByNodeId], [diagnostic.resourceId, diagnosticsByResourceId]]) {
|
|
157
|
+
if (id === undefined)
|
|
158
|
+
continue;
|
|
159
|
+
const entries = index.get(id) ?? [];
|
|
160
|
+
entries.push(diagnostic);
|
|
161
|
+
index.set(id, entries);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
149
164
|
const resourceById = new Map(resources.map((resource) => [resource.id, resource]));
|
|
150
165
|
const groupById = new Map(debugGroups.map((group) => [group.id, group]));
|
|
151
166
|
const groupByPathKey = new Map(debugGroups.map((group) => [group.pathKey, group]));
|
|
@@ -162,14 +177,18 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
162
177
|
const slowestNode = timedNodes.reduce((slowest, node) => (!slowest || node.gpuDurationMicros > slowest.gpuDurationMicros ? node : slowest), undefined);
|
|
163
178
|
const transientResources = resources.filter((resource) => resource.origin === 'transient');
|
|
164
179
|
const transientEstimatedByteSize = sumKnown(transientResources.map((resource) => resource.estimatedByteSize));
|
|
165
|
-
const
|
|
180
|
+
const allocationAvailable = snapshot.memory.allocationReport.status === 'available';
|
|
181
|
+
const physicalSizes = physicalAllocations.map((allocation) => allocation.estimatedByteSize);
|
|
182
|
+
const physicalEstimatedBytes = allocationAvailable ? sumKnown(physicalSizes) : undefined;
|
|
166
183
|
const logicalAllocationSizes = transientResources
|
|
167
184
|
.filter((resource) => resource.physicalResourceId !== undefined)
|
|
168
185
|
.map((resource) => allocationById.get(resource.physicalResourceId)?.estimatedByteSize);
|
|
169
|
-
const logicalCapacityBytes = sumKnown(logicalAllocationSizes);
|
|
186
|
+
const logicalCapacityBytes = allocationAvailable ? sumKnown(logicalAllocationSizes) : undefined;
|
|
170
187
|
const metrics = {
|
|
171
188
|
timingEligibleNodeCount: timingEligibleNodes.length,
|
|
172
189
|
timedNodeCount: timedNodes.length,
|
|
190
|
+
cpuTimedNodeCount: nodes.filter(node => node.cpuDurationMicros !== undefined).length,
|
|
191
|
+
cpuWorkDurationMicros: nodes.reduce((sum, node) => sum + (node.cpuDurationMicros ?? 0), 0),
|
|
173
192
|
slowestNode,
|
|
174
193
|
transientEstimatedByteSize,
|
|
175
194
|
logicalCapacityBytes,
|
|
@@ -178,6 +197,11 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
178
197
|
? undefined
|
|
179
198
|
: Math.max(0, logicalCapacityBytes - physicalEstimatedBytes),
|
|
180
199
|
aliasedAllocationCount: physicalAllocations.filter((allocation) => allocation.resourceIds.length > 1).length,
|
|
200
|
+
estimatedCoverage: {
|
|
201
|
+
transient: estimateCoverage(transientResources.map((resource) => resource.estimatedByteSize)),
|
|
202
|
+
logical: estimateCoverage(logicalAllocationSizes),
|
|
203
|
+
physical: estimateCoverage(physicalSizes),
|
|
204
|
+
},
|
|
181
205
|
};
|
|
182
206
|
return {
|
|
183
207
|
protocol: snapshot,
|
|
@@ -194,6 +218,10 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
194
218
|
executionSegments,
|
|
195
219
|
textureViewById,
|
|
196
220
|
nodeById,
|
|
221
|
+
canonicalNodeById,
|
|
222
|
+
culledById,
|
|
223
|
+
diagnosticsByNodeId,
|
|
224
|
+
diagnosticsByResourceId,
|
|
197
225
|
resourceById,
|
|
198
226
|
groupById,
|
|
199
227
|
groupByPathKey,
|
|
@@ -203,6 +231,7 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
203
231
|
segmentByNodeId,
|
|
204
232
|
segmentByIndex,
|
|
205
233
|
metrics,
|
|
234
|
+
cpuProfiling: snapshot.timings.cpu,
|
|
206
235
|
profiling: gpuTiming.status === 'available'
|
|
207
236
|
? {
|
|
208
237
|
status: 'available',
|
|
@@ -223,6 +252,9 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
223
252
|
availability,
|
|
224
253
|
};
|
|
225
254
|
}
|
|
255
|
+
function estimateCoverage(values) {
|
|
256
|
+
return { known: values.filter((value) => value !== undefined).length, total: values.length };
|
|
257
|
+
}
|
|
226
258
|
function sumKnown(values) {
|
|
227
259
|
let total = 0;
|
|
228
260
|
for (const value of values) {
|
|
@@ -378,6 +410,8 @@ function buildDebugGroupSummaries(input) {
|
|
|
378
410
|
externalSubmissionCount: retained.filter((node) => node.kind === 'external-submission').length,
|
|
379
411
|
gpuWorkDurationMicros: timed.reduce((sum, node) => sum + node.gpuDurationMicros, 0),
|
|
380
412
|
timedNodeCount: timed.length,
|
|
413
|
+
cpuTimedNodeCount: retained.filter(node => node.cpuDurationMicros !== undefined).length,
|
|
414
|
+
cpuWorkDurationMicros: retained.reduce((sum, node) => sum + (node.cpuDurationMicros ?? 0), 0),
|
|
381
415
|
timingEligibleNodeCount: timingEligible.length,
|
|
382
416
|
},
|
|
383
417
|
};
|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C,OAAO,CAAC;gBACjF,eAAe,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBACnF,WAAW;gBACX,gCAAgC,EAAE,mBAAmB,CAAC,MAAM;gBAC5D,8BAA8B,EAAE,oBAAoB,CAAC,IAAI;gBACzD,uBAAuB,EAAE,aAAa,CAAC,IAAI;gBAC3C,qBAAqB,EAAE,UAAU,CAAC,IAAI;gBACtC,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,qBAAqB,CAAC,CAAC,MAAM;gBAC9F,qBAAqB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,iBAAkB,EAAE,CAAC,CAAC;gBACpF,cAAc,EAAE,KAAK,CAAC,MAAM;gBAC5B,uBAAuB,EAAE,cAAc,CAAC,MAAM;aAC9C;SACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {\n\tFrameGraphSnapshot,\n\tFrameGraphSnapshotAccessKind,\n\tFrameGraphSnapshotBufferRange,\n\tFrameGraphSnapshotGpuTimings,\n\tFrameGraphSnapshotNodeKind,\n\tFrameGraphSnapshotResourceKind,\n\tFrameGraphSnapshotResourceOrigin,\n\tFrameGraphSnapshotRoot,\n\tFrameGraphSnapshotSegment,\n\tFrameGraphSnapshotTextureRegion,\n\tFrameGraphSnapshotWriteContents,\n} from '@zenfg/snapshot';\n\ntype ResourceAccessMode = 'read' | 'write';\n\nexport type FrameGraphDebugExecutionSegment = FrameGraphSnapshotSegment & {\n\treadonly index: number;\n};\n\nexport type FrameGraphDebugResourceRef = {\n readonly id: string;\n readonly kind: FrameGraphSnapshotResourceKind;\n readonly label?: string;\n};\n\ntype FrameGraphDebugAccessEdgeBase = {\n\treadonly accessId: string;\n\treadonly nodeId: string;\n readonly resource: FrameGraphDebugResourceRef;\n\treadonly access: FrameGraphSnapshotAccessKind;\n\treadonly textureViewId?: string;\n\treadonly textureRegion?: FrameGraphSnapshotTextureRegion;\n\treadonly bufferRange?: FrameGraphSnapshotBufferRange;\n};\n\nexport type FrameGraphDebugAccessEdge = FrameGraphDebugAccessEdgeBase & (\n | {\n readonly mode: 'read';\n readonly producesValue: false;\n readonly contents?: never;\n }\n | {\n readonly mode: 'write';\n\t\treadonly contents: FrameGraphSnapshotWriteContents;\n readonly producesValue: boolean;\n }\n);\n\nexport type FrameGraphDebugAccess = FrameGraphDebugAccessEdge extends infer TAccess\n\t? TAccess extends FrameGraphDebugAccessEdge ? Omit<TAccess, 'nodeId'> : never\n : never;\n\nexport type FrameGraphDebugNode = {\n\treadonly id: string;\n readonly order: number;\n\treadonly kind: FrameGraphSnapshotNodeKind;\n readonly label?: string;\n\treadonly sideEffect: boolean;\n\treadonly debugGroupId?: string;\n readonly gpuDurationMicros?: number;\n readonly reads: readonly FrameGraphDebugAccess[];\n readonly writes: readonly FrameGraphDebugAccess[];\n};\n\nexport type FrameGraphDebugResource = FrameGraphDebugResourceRef & {\n\treadonly origin: FrameGraphSnapshotResourceOrigin;\n\treadonly initialContents?: 'defined' | 'undefined';\n\treadonly debugGroupId?: string;\n\treadonly usageFlags: readonly string[];\n readonly lifetime?: { readonly firstUse: number; readonly lastUse: number };\n\treadonly physicalResourceId?: string;\n\treadonly descriptor?: FrameGraphSnapshot['graph']['resources'][number]['descriptor'];\n\treadonly estimatedByteSize?: number;\n};\n\nexport type FrameGraphDebugEdge = {\n\treadonly fromNodeId: string;\n\treadonly toNodeId: string;\n readonly resource: FrameGraphDebugResourceRef;\n readonly kind: 'value' | 'ordering';\n};\n\nexport type FrameGraphDebugRoot = FrameGraphSnapshotRoot & {\n\treadonly key: string;\n readonly resource?: FrameGraphDebugResourceRef;\n};\n\n/** Semantic identity within one recording, independent of root array order. */\nexport function rootKey(root: FrameGraphSnapshotRoot): string {\n\treturn root.reason === 'side-effect' ? JSON.stringify([root.reason, root.nodeId])\n\t\t: JSON.stringify([root.reason, root.resourceId, root.range?.kind === 'buffer'\n\t\t\t? ['buffer', root.range.offset, root.range.size]\n\t\t\t: root.range?.regions.map((r) => [r.baseMipLevel, r.mipLevelCount, r.aspect, r.baseArrayLayer, r.arrayLayerCount, r.baseDepthSlice, r.depthSliceCount]) ?? null]);\n}\n\nexport type FrameGraphDebugCulledNode = {\n readonly node: Omit<FrameGraphDebugNode, 'order'>;\n readonly reason: string;\n};\n\nexport type FrameGraphDebugPhysicalAllocation = {\n\treadonly id: string;\n\treadonly kind: FrameGraphSnapshotResourceKind;\n\treadonly compatibilityClassId: string;\n\treadonly estimatedByteSize?: number;\n\treadonly resourceIds: readonly string[];\n};\n\nexport type FrameGraphDebugGroupSummary = {\n\treadonly retainedNodeCount: number;\n\treadonly culledNodeCount: number;\n\treadonly nodeKindCounts: Readonly<Partial<Record<FrameGraphSnapshotNodeKind, number>>>;\n\treadonly inputResources: readonly FrameGraphDebugResourceRef[];\n\treadonly outputResources: readonly FrameGraphDebugResourceRef[];\n\treadonly outputRoots: readonly FrameGraphDebugRoot[];\n\treadonly registeredTransientResourceCount: number;\n\treadonly accessedTransientResourceCount: number;\n\treadonly physicalAllocationCount: number;\n\treadonly executionSegmentCount: number;\n\treadonly externalSubmissionCount: number;\n\treadonly gpuWorkDurationMicros: number;\n\treadonly timedNodeCount: number;\n\treadonly timingEligibleNodeCount: number;\n};\n\nexport type FrameGraphDebugGroup = {\n\treadonly id: string;\n\treadonly parentId?: string;\n\treadonly label: string;\n\treadonly path: readonly string[];\n\t/** Stable while same-named siblings retain their recording-order occurrence. */\n\treadonly pathKey: string;\n\treadonly depth: number;\n\t/** Ordered ancestor ids from root through this group. */\n\treadonly ancestorIds: readonly string[];\n\treadonly summary: FrameGraphDebugGroupSummary;\n};\n\nexport type FrameGraphDebugMetrics = {\n\treadonly timingEligibleNodeCount: number;\n\treadonly timedNodeCount: number;\n\treadonly slowestNode?: FrameGraphDebugNode;\n\treadonly transientEstimatedByteSize?: number;\n\treadonly logicalCapacityBytes?: number;\n\treadonly physicalEstimatedBytes?: number;\n\treadonly aliasReuseBytes?: number;\n\treadonly aliasedAllocationCount: number;\n};\n\nexport type FrameGraphDebugSnapshotSource = {\n\treadonly kind: 'live' | 'file' | 'programmatic';\n\treadonly label: string;\n\treadonly migratedFromLegacy?: boolean;\n};\n\nexport type FrameGraphDebugViewModel = {\n\treadonly protocol: FrameGraphSnapshot;\n\treadonly source: FrameGraphDebugSnapshotSource;\n readonly frameIndex: number;\n readonly nodes: readonly FrameGraphDebugNode[];\n readonly resources: readonly FrameGraphDebugResource[];\n readonly edges: readonly FrameGraphDebugEdge[];\n readonly accessEdges: readonly FrameGraphDebugAccessEdge[];\n readonly roots: readonly FrameGraphDebugRoot[];\n readonly culledNodes: readonly FrameGraphDebugCulledNode[];\n\treadonly physicalAllocations: readonly FrameGraphDebugPhysicalAllocation[];\n\treadonly debugGroups: readonly FrameGraphDebugGroup[];\n\treadonly executionSegments: readonly FrameGraphDebugExecutionSegment[];\n\treadonly textureViewById: ReadonlyMap<string, FrameGraphSnapshot['graph']['textureViews'][number]>;\n\treadonly nodeById: ReadonlyMap<string, FrameGraphDebugNode>;\n\treadonly resourceById: ReadonlyMap<string, FrameGraphDebugResource>;\n\treadonly groupById: ReadonlyMap<string, FrameGraphDebugGroup>;\n\treadonly groupByPathKey: ReadonlyMap<string, FrameGraphDebugGroup>;\n\treadonly allocationById: ReadonlyMap<string, FrameGraphDebugPhysicalAllocation>;\n\treadonly accessesByNodeId: ReadonlyMap<string, readonly FrameGraphDebugAccessEdge[]>;\n\treadonly accessesByResourceId: ReadonlyMap<string, readonly FrameGraphDebugAccessEdge[]>;\n\treadonly segmentByNodeId: ReadonlyMap<string, FrameGraphDebugExecutionSegment>;\n\treadonly segmentByIndex: ReadonlyMap<number, FrameGraphDebugExecutionSegment>;\n\treadonly metrics: FrameGraphDebugMetrics;\n readonly profiling:\n | {\n readonly status: 'available';\n readonly frameIndex: number;\n\t\t\treadonly timings: readonly { readonly nodeId: string; readonly gpuDurationMicros: number }[];\n readonly gpuFrameDurationMicros: number;\n }\n | {\n readonly status: 'unavailable';\n readonly frameIndex: number;\n\t\t\treadonly reason: Extract<FrameGraphSnapshotGpuTimings, { readonly status: 'unavailable' }>['reason'];\n readonly timings: readonly [];\n };\n\treadonly resourcePool: FrameGraphSnapshot['memory']['poolReport'];\n\treadonly availability: {\n\t\treadonly groups: boolean;\n\t\treadonly textureViews: boolean;\n\t\treadonly recordingOrder: boolean;\n\t\treadonly accessRegions: boolean;\n\t};\n};\n\nexport function createDebugViewModel(\n\tsnapshot: FrameGraphSnapshot,\n\tsource: FrameGraphDebugSnapshotSource = { kind: 'programmatic', label: 'Programmatic' },\n): FrameGraphDebugViewModel {\n\tconst compilation = snapshot.graph;\n\tconst unavailable = new Set(snapshot.capture.migration?.unavailableFacts ?? []);\n\tconst availability = {\n\t\tgroups: !unavailable.has('graph.groups'),\n\t\ttextureViews: !unavailable.has('graph.textureViews'),\n\t\trecordingOrder: !unavailable.has('graph.nodes.recordingOrder'),\n\t\taccessRegions: !unavailable.has('graph.accesses.regions'),\n\t};\n\tconst resolvedSource: FrameGraphDebugSnapshotSource = snapshot.capture.migration?.sourceFormat === 'legacy-v0'\n\t\t? { ...source, migratedFromLegacy: true }\n\t\t: source;\n\tconst gpuTiming = snapshot.timings.gpu;\n\tconst resourcePool = snapshot.memory.poolReport;\n\tconst normalizedGroups = normalizeDebugGroups(compilation);\n\tconst knownGroupIds = new Set(normalizedGroups.map((group) => group.id));\n\tvalidateDebugGroupReferences(compilation, knownGroupIds);\n\tconst resourcesById = new Map(compilation.resources.map((resource) => [resource.id, resource]));\n\tconst resourceRef = (resourceId: string): FrameGraphDebugResourceRef => {\n const resource = resourcesById.get(resourceId);\n if (!resource) {\n throw new Error(`Compilation report references unknown resource ${resourceId}.`);\n }\n return { id: resource.id, kind: resource.kind, label: resource.label };\n };\n const accessEdges = compilation.accesses.map((access): FrameGraphDebugAccessEdge => {\n const common = {\n accessId: access.id,\n nodeId: access.nodeId,\n resource: resourceRef(access.resourceId),\n access: access.access,\n textureViewId: access.textureViewId,\n textureRegion: access.textureRegion,\n bufferRange: access.bufferRange,\n };\n return access.mode === 'read'\n ? { ...common, mode: 'read', producesValue: false }\n : {\n ...common,\n mode: 'write',\n contents: access.contents,\n producesValue: access.producesValue,\n };\n });\n\tconst accessesByNode = new Map<string, FrameGraphDebugAccessEdge[]>();\n\tconst accessesByResource = new Map<string, FrameGraphDebugAccessEdge[]>();\n for (const access of accessEdges) {\n const nodeAccesses = accessesByNode.get(access.nodeId) ?? [];\n nodeAccesses.push(access);\n accessesByNode.set(access.nodeId, nodeAccesses);\n\t\tconst resourceAccesses = accessesByResource.get(access.resource.id) ?? [];\n\t\tresourceAccesses.push(access);\n\t\taccessesByResource.set(access.resource.id, resourceAccesses);\n }\n\tconst timings = gpuTiming.status === 'available'\n ? new Map(gpuTiming.nodes.map((timing) => [timing.nodeId, timing.durationMicros]))\n : new Map<string, number>();\n\tconst nodeAccesses = (nodeId: string, mode: ResourceAccessMode): FrameGraphDebugAccess[] => (\n (accessesByNode.get(nodeId) ?? [])\n .filter((access) => access.mode === mode)\n\t\t\t.map(({ nodeId: _nodeId, ...access }) => access)\n\t);\n\tconst nodes: FrameGraphDebugNode[] = compilation.nodes\n\t\t.filter((node) => node.compileState.status === 'retained')\n\t\t.sort((a, b) => a.compileState.status === 'retained' && b.compileState.status === 'retained'\n\t\t\t? a.compileState.executionOrder - b.compileState.executionOrder\n\t\t\t: 0)\n\t\t.map((node) => ({\n\t\tid: node.id,\n\t\torder: node.compileState.status === 'retained' ? node.compileState.executionOrder : 0,\n\t\tkind: node.kind,\n\t\tlabel: node.label,\n\t\tsideEffect: node.sideEffect,\n\t\tdebugGroupId: node.groupId,\n\t\tgpuDurationMicros: timings.get(node.id),\n\t\treads: nodeAccesses(node.id, 'read'),\n\t\twrites: nodeAccesses(node.id, 'write'),\n\t}));\n\tconst resources: FrameGraphDebugResource[] = compilation.resources.map((resource) => ({\n\t\tid: resource.id,\n\t\tkind: resource.kind,\n\t\tlabel: resource.label,\n\t\torigin: resource.origin,\n\t\tinitialContents: resource.initialContents,\n\t\tdebugGroupId: resource.groupId,\n\t\tusageFlags: resource.usageFlags,\n\t\tlifetime: resource.lifetime,\n\t\tphysicalResourceId: resource.allocationId,\n\t\tdescriptor: resource.descriptor,\n\t\testimatedByteSize: resource.estimatedByteSize,\n\t}));\n\tconst edges: FrameGraphDebugEdge[] = compilation.dependencies.map((dependency) => ({\n\t\t...dependency,\n\t\tresource: resourceRef(dependency.resourceId),\n\t}));\n\tconst roots: FrameGraphDebugRoot[] = compilation.roots.map((root) => ({\n\t\t...root,\n\t\tkey: rootKey(root),\n\t\tresource: root.resourceId === undefined ? undefined : resourceRef(root.resourceId),\n\t}));\n\tconst culledNodes: FrameGraphDebugCulledNode[] = compilation.nodes\n\t\t.filter((node) => node.compileState.status === 'culled')\n\t\t.map((node) => ({\n\t\tnode: {\n\t\t\tid: node.id,\n\t\t\tkind: node.kind,\n\t\t\tlabel: node.label,\n\t\t\tsideEffect: node.sideEffect,\n\t\t\tdebugGroupId: node.groupId,\n\t\t\treads: nodeAccesses(node.id, 'read'),\n\t\t\twrites: nodeAccesses(node.id, 'write'),\n\t\t},\n\t\treason: node.compileState.status === 'culled' ? node.compileState.reason : 'unknown',\n\t}));\n\tconst resourceIdsByAllocation = new Map<string, string[]>();\n\tfor (const resource of compilation.resources) {\n\t\tif (resource.allocationId === undefined) continue;\n\t\tconst resourceIds = resourceIdsByAllocation.get(resource.allocationId) ?? [];\n\t\tresourceIds.push(resource.id);\n\t\tresourceIdsByAllocation.set(resource.allocationId, resourceIds);\n\t}\n\tconst physicalAllocations: FrameGraphDebugPhysicalAllocation[] = snapshot.memory.allocationReport.status === 'available'\n\t\t? snapshot.memory.allocationReport.allocations.map((allocation) => ({\n\t\t\t...allocation,\n\t\t\tresourceIds: resourceIdsByAllocation.get(allocation.id) ?? [],\n\t\t}))\n\t\t: [];\n\tconst executionSegments: FrameGraphDebugExecutionSegment[] = compilation.segments.map((segment) => ({\n\t\t...segment,\n\t\tindex: segment.order,\n\t}));\n\tconst debugGroups = buildDebugGroupSummaries({\n\t\tgroups: normalizedGroups,\n\t\tnodes,\n\t\tculledNodes,\n\t\tresources,\n\t\taccessEdges,\n\t\tedges,\n\t\troots,\n\t\texecutionSegments,\n\t});\n\tconst nodeById = new Map(nodes.map((node) => [node.id, node]));\n\tconst resourceById = new Map(resources.map((resource) => [resource.id, resource]));\n\tconst groupById = new Map(debugGroups.map((group) => [group.id, group]));\n\tconst groupByPathKey = new Map(debugGroups.map((group) => [group.pathKey, group]));\n\tconst allocationById = new Map(physicalAllocations.map((allocation) => [allocation.id, allocation]));\n\tconst textureViewById = new Map(compilation.textureViews.map((view) => [view.id, view]));\n\tconst segmentByNodeId = new Map<string, FrameGraphDebugExecutionSegment>();\n\tconst segmentByIndex = new Map(executionSegments.map((segment) => [segment.index, segment]));\n\tfor (const segment of executionSegments) {\n\t\tfor (const nodeId of segment.nodeIds) segmentByNodeId.set(nodeId, segment);\n\t}\n\tconst timingEligibleNodes = nodes.filter((node) => node.kind === 'render' || node.kind === 'compute');\n\tconst timedNodes = timingEligibleNodes.filter((node) => node.gpuDurationMicros !== undefined);\n\tconst slowestNode = timedNodes.reduce<FrameGraphDebugNode | undefined>((slowest, node) => (\n\t\t!slowest || node.gpuDurationMicros! > slowest.gpuDurationMicros! ? node : slowest\n\t), undefined);\n\tconst transientResources = resources.filter((resource) => resource.origin === 'transient');\n\tconst transientEstimatedByteSize = sumKnown(transientResources.map((resource) => resource.estimatedByteSize));\n\tconst physicalEstimatedBytes = sumKnown(physicalAllocations.map((allocation) => allocation.estimatedByteSize));\n\tconst logicalAllocationSizes = transientResources\n\t\t.filter((resource) => resource.physicalResourceId !== undefined)\n\t\t.map((resource) => allocationById.get(resource.physicalResourceId!)?.estimatedByteSize);\n\tconst logicalCapacityBytes = sumKnown(logicalAllocationSizes);\n\tconst metrics: FrameGraphDebugMetrics = {\n\t\ttimingEligibleNodeCount: timingEligibleNodes.length,\n\t\ttimedNodeCount: timedNodes.length,\n\t\tslowestNode,\n\t\ttransientEstimatedByteSize,\n\t\tlogicalCapacityBytes,\n\t\tphysicalEstimatedBytes,\n\t\taliasReuseBytes: logicalCapacityBytes === undefined || physicalEstimatedBytes === undefined\n\t\t\t? undefined\n\t\t\t: Math.max(0, logicalCapacityBytes - physicalEstimatedBytes),\n\t\taliasedAllocationCount: physicalAllocations.filter((allocation) => allocation.resourceIds.length > 1).length,\n\t};\n\n\treturn {\n\t\tprotocol: snapshot,\n\t\tsource: resolvedSource,\n\t\tframeIndex: snapshot.capture.frameIndex,\n\t\tnodes,\n\t\tresources,\n\t\tedges,\n\t\taccessEdges,\n\t\troots,\n\t\tculledNodes,\n\t\tphysicalAllocations,\n\t\tdebugGroups,\n\t\texecutionSegments,\n\t\ttextureViewById,\n\t\tnodeById,\n\t\tresourceById,\n\t\tgroupById,\n\t\tgroupByPathKey,\n\t\tallocationById,\n\t\taccessesByNodeId: accessesByNode,\n\t\taccessesByResourceId: accessesByResource,\n\t\tsegmentByNodeId,\n\t\tsegmentByIndex,\n\t\tmetrics,\n profiling: gpuTiming.status === 'available'\n ? {\n status: 'available',\n frameIndex: snapshot.capture.frameIndex,\n timings: gpuTiming.nodes.map((timing) => ({\n nodeId: timing.nodeId,\n gpuDurationMicros: timing.durationMicros,\n })),\n gpuFrameDurationMicros: gpuTiming.frameSpanMicros,\n }\n : {\n status: 'unavailable',\n frameIndex: snapshot.capture.frameIndex,\n timings: [],\n reason: gpuTiming.reason,\n },\n\t\tresourcePool,\n\t\tavailability,\n\t};\n}\n\nfunction sumKnown(values: readonly (number | undefined)[]): number | undefined {\n\tlet total = 0;\n\tfor (const value of values) {\n\t\tif (value === undefined) return undefined;\n\t\ttotal += value;\n\t}\n\treturn total;\n}\n\ntype NormalizedDebugGroup = Omit<FrameGraphDebugGroup, 'summary'>;\n\nfunction normalizeDebugGroups(compilation: FrameGraphSnapshot['graph']): NormalizedDebugGroup[] {\n\tconst rawGroups = compilation.groups;\n\tconst rawById = new Map<string, FrameGraphSnapshot['graph']['groups'][number]>();\n\tconst siblingOccurrences = new Map<string, number>();\n\tconst nextOccurrenceByParent = new Map<string | undefined, Map<string, number>>();\n\tfor (const group of rawGroups) {\n\t\tif (rawById.has(group.id)) {\n\t\t\tthrow new Error(`Compilation report contains duplicate debug group id ${group.id}.`);\n\t\t}\n\t\tconst label = group.label.trim();\n\t\tif (label.length === 0) {\n\t\t\tthrow new Error(`Compilation report debug group ${group.id} has an empty label.`);\n\t\t}\n\t\trawById.set(group.id, { ...group, label });\n\t\tconst nextOccurrenceByLabel = nextOccurrenceByParent.get(group.parentId) ?? new Map<string, number>();\n\t\tconst occurrence = nextOccurrenceByLabel.get(label) ?? 0;\n\t\tsiblingOccurrences.set(group.id, occurrence);\n\t\tnextOccurrenceByLabel.set(label, occurrence + 1);\n\t\tnextOccurrenceByParent.set(group.parentId, nextOccurrenceByLabel);\n\t}\n\n\tconst normalizedById = new Map<string, NormalizedDebugGroup>();\n\tconst identityPathById = new Map<string, readonly (readonly [label: string, siblingOccurrence: number])[]>();\n\tconst visiting = new Set<string>();\n\tconst resolve = (id: string): NormalizedDebugGroup => {\n\t\tconst existing = normalizedById.get(id);\n\t\tif (existing) return existing;\n\t\tconst raw = rawById.get(id);\n\t\tif (!raw) throw new Error(`Compilation report references unknown debug group ${id}.`);\n\t\tif (visiting.has(id)) throw new Error(`Compilation report debug group ${id} has a parent cycle.`);\n\t\tvisiting.add(id);\n\t\tconst parent = raw.parentId === undefined ? undefined : resolve(raw.parentId);\n\t\tconst path = [...(parent?.path ?? []), raw.label];\n\t\tconst identityPath = [\n\t\t\t...(raw.parentId === undefined ? [] : identityPathById.get(raw.parentId)!),\n\t\t\t[raw.label, siblingOccurrences.get(raw.id)!] as const,\n\t\t];\n\t\tconst ancestorIds = [...(parent?.ancestorIds ?? []), raw.id];\n\t\tconst normalized: NormalizedDebugGroup = {\n\t\t\tid: raw.id,\n\t\t\tparentId: raw.parentId,\n\t\t\tlabel: raw.label,\n\t\t\tpath,\n\t\t\tpathKey: JSON.stringify(identityPath),\n\t\t\tdepth: path.length - 1,\n\t\t\tancestorIds,\n\t\t};\n\t\tvisiting.delete(id);\n\t\tidentityPathById.set(id, identityPath);\n\t\tnormalizedById.set(id, normalized);\n\t\treturn normalized;\n\t};\n\treturn rawGroups.map((group) => resolve(group.id));\n}\n\nfunction validateDebugGroupReferences(\n\tcompilation: FrameGraphSnapshot['graph'],\n\tknownGroupIds: ReadonlySet<string>,\n): void {\n\tfor (const entry of [...compilation.nodes, ...compilation.resources]) {\n\t\tif (entry.groupId !== undefined && !knownGroupIds.has(entry.groupId)) {\n\t\t\tthrow new Error(`Compilation report references unknown debug group ${entry.groupId}.`);\n\t\t}\n\t}\n}\n\n/** Declaration boundaries are topological, not per-range initial-value provenance. */\nexport function declarationEntrances(\n\tnodes: readonly FrameGraphDebugNode[],\n\taccesses: readonly FrameGraphDebugAccessEdge[],\n\tedges: readonly FrameGraphDebugEdge[],\n): readonly FrameGraphDebugAccessEdge[] {\n\tconst retained = new Set(nodes.map((node) => node.id));\n\tconst incoming = new Set(edges.map((edge) => JSON.stringify([edge.resource.id, edge.toNodeId])));\n\tconst seen = new Set<string>();\n\treturn accesses.filter((access) => {\n\t\tconst key = JSON.stringify([access.resource.id, access.nodeId]);\n\t\tif (!retained.has(access.nodeId) || incoming.has(key) || seen.has(key)) return false;\n\t\tseen.add(key);\n\t\treturn true;\n\t});\n}\n\nfunction buildDebugGroupSummaries(input: {\n\treadonly groups: readonly NormalizedDebugGroup[];\n\treadonly nodes: readonly FrameGraphDebugNode[];\n\treadonly culledNodes: readonly FrameGraphDebugCulledNode[];\n\treadonly resources: readonly FrameGraphDebugResource[];\n\treadonly accessEdges: readonly FrameGraphDebugAccessEdge[];\n\treadonly edges: readonly FrameGraphDebugEdge[];\n\treadonly roots: readonly FrameGraphDebugRoot[];\n\treadonly executionSegments: readonly FrameGraphDebugExecutionSegment[];\n}): FrameGraphDebugGroup[] {\n\tconst groupsById = new Map(input.groups.map((group) => [group.id, group]));\n\tconst resourcesById = new Map(input.resources.map((resource) => [resource.id, resource]));\n\tconst entrances = declarationEntrances(input.nodes, input.accessEdges, input.edges);\n\tconst isInGroup = (candidateId: string | undefined, groupId: string) => (\n\t\tcandidateId !== undefined && groupsById.get(candidateId)?.ancestorIds.includes(groupId) === true\n\t);\n\n\treturn input.groups.map((group): FrameGraphDebugGroup => {\n\t\tconst retained = input.nodes.filter((node) => isInGroup(node.debugGroupId, group.id));\n\t\tconst culled = input.culledNodes.filter((entry) => isInGroup(entry.node.debugGroupId, group.id));\n\t\tconst retainedIds = new Set(retained.map((node) => node.id));\n\t\tconst allIds = new Set([...retainedIds, ...culled.map((entry) => entry.node.id)]);\n\t\tconst nodeKindCounts: Partial<Record<FrameGraphSnapshotNodeKind, number>> = {};\n\t\tfor (const node of [...retained, ...culled.map((entry) => entry.node)]) {\n\t\t\tnodeKindCounts[node.kind] = (nodeKindCounts[node.kind] ?? 0) + 1;\n\t\t}\n\n\t\tconst inputIds = new Set<string>();\n\t\tconst outputIds = new Set<string>();\n\t\tfor (const edge of input.edges) {\n\t\t\tconst fromInside = retainedIds.has(edge.fromNodeId);\n\t\t\tconst toInside = retainedIds.has(edge.toNodeId);\n\t\t\tif (!fromInside && toInside) inputIds.add(edge.resource.id);\n\t\t\tif (fromInside && !toInside) outputIds.add(edge.resource.id);\n\t\t}\n\t\tfor (const access of entrances) {\n\t\t\tconst fromInside = isInGroup(resourcesById.get(access.resource.id)?.debugGroupId, group.id);\n\t\t\tconst toInside = retainedIds.has(access.nodeId);\n\t\t\tif (!fromInside && toInside) inputIds.add(access.resource.id);\n\t\t\tif (fromInside && !toInside) outputIds.add(access.resource.id);\n\t\t}\n\t\tconst outputRoots: FrameGraphDebugRoot[] = [];\n\t\tfor (const root of input.roots) {\n\t\t\tif (!root.resource) continue;\n\t\t\tif (root.resolution?.producerNodeIds.some((id) => retainedIds.has(id))\n\t\t\t\t|| root.resolution?.usesInitialContents && isInGroup(resourcesById.get(root.resource.id)?.debugGroupId, group.id)) {\n\t\t\t\toutputIds.add(root.resource.id);\n\t\t\t\toutputRoots.push(root);\n\t\t\t}\n\t\t}\n\n\t\tconst registeredTransient = input.resources.filter((resource) => resource.origin === 'transient'\n\t\t\t&& isInGroup(resource.debugGroupId, group.id));\n\t\tconst registeredTransientIds = new Set(registeredTransient.map((resource) => resource.id));\n\t\tconst accessedTransientIds = new Set(input.accessEdges\n\t\t\t.filter((access) => allIds.has(access.nodeId) && registeredTransientIds.has(access.resource.id))\n\t\t\t.map((access) => access.resource.id));\n\t\tconst allocationIds = new Set(registeredTransient.flatMap((resource) => (\n\t\t\tresource.physicalResourceId === undefined ? [] : [resource.physicalResourceId]\n\t\t)));\n\t\tconst segmentIds = new Set(input.executionSegments\n\t\t\t.filter((segment) => segment.nodeIds.some((id) => retainedIds.has(id)))\n\t\t\t.map((segment) => segment.index));\n\t\tconst timingEligible = retained.filter((node) => node.kind === 'render' || node.kind === 'compute');\n\t\tconst timed = timingEligible.filter((node) => node.gpuDurationMicros !== undefined);\n\n\t\treturn {\n\t\t\t...group,\n\t\t\tsummary: {\n\t\t\t\tretainedNodeCount: retained.length,\n\t\t\t\tculledNodeCount: culled.length,\n\t\t\t\tnodeKindCounts,\n\t\t\t\tinputResources: [...inputIds].map((id) => resourcesById.get(id)!).filter(Boolean),\n\t\t\t\toutputResources: [...outputIds].map((id) => resourcesById.get(id)!).filter(Boolean),\n\t\t\t\toutputRoots,\n\t\t\t\tregisteredTransientResourceCount: registeredTransient.length,\n\t\t\t\taccessedTransientResourceCount: accessedTransientIds.size,\n\t\t\t\tphysicalAllocationCount: allocationIds.size,\n\t\t\t\texecutionSegmentCount: segmentIds.size,\n\t\t\t\texternalSubmissionCount: retained.filter((node) => node.kind === 'external-submission').length,\n\t\t\t\tgpuWorkDurationMicros: timed.reduce((sum, node) => sum + node.gpuDurationMicros!, 0),\n\t\t\t\ttimedNodeCount: timed.length,\n\t\t\t\ttimingEligibleNodeCount: timingEligible.length,\n\t\t\t},\n\t\t};\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"debugCaptureModel.js","sourceRoot":"","sources":["../src/debugCaptureModel.ts"],"names":[],"mappings":"AAyFA,+EAA+E;AAC/E,MAAM,UAAU,OAAO,CAAC,IAA4B;IACnD,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAChF,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,QAAQ;gBAC5E,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;gBAChD,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;AACrK,CAAC;AA4HD,MAAM,UAAU,oBAAoB,CACnC,QAA4B,EAC5B,SAAwC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAEvF,MAAM,WAAW,GAAG,QAAQ,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SnapshotBufferRange,\n\tFrameGraphSnapshotGpuTimings,\n\tFrameGraphSnapshotNodeKind,\n\tFrameGraphSnapshotResourceKind,\n\tFrameGraphSnapshotResourceOrigin,\n\tFrameGraphSnapshotRoot,\n\tFrameGraphSnapshotSegment,\n\tFrameGraphSnapshotTextureRegion,\n\tFrameGraphSnapshotWriteContents,\n} from '@zenfg/snapshot';\n\ntype ResourceAccessMode = 'read' | 'write';\n\nexport type FrameGraphDebugExecutionSegment = FrameGraphSnapshotSegment & {\n\treadonly index: number;\n};\n\nexport type FrameGraphDebugResourceRef = {\n readonly id: string;\n readonly kind: FrameGraphSnapshotResourceKind;\n readonly label?: string;\n};\n\ntype FrameGraphDebugAccessEdgeBase = {\n\treadonly accessId: string;\n\treadonly nodeId: string;\n readonly resource: FrameGraphDebugResourceRef;\n\treadonly access: FrameGraphSnapshotAccessKind;\n\treadonly textureViewId?: string;\n\treadonly textureRegion?: FrameGraphSnapshotTextureRegion;\n\treadonly bufferRange?: FrameGraphSnapshotBufferRange;\n};\n\nexport type FrameGraphDebugAccessEdge = FrameGraphDebugAccessEdgeBase & (\n | {\n readonly mode: 'read';\n readonly producesValue: false;\n readonly contents?: never;\n }\n | {\n readonly mode: 'write';\n\t\treadonly contents: FrameGraphSnapshotWriteContents;\n readonly producesValue: boolean;\n }\n);\n\nexport type FrameGraphDebugAccess = FrameGraphDebugAccessEdge extends infer TAccess\n\t? TAccess extends FrameGraphDebugAccessEdge ? Omit<TAccess, 'nodeId'> : never\n : never;\n\nexport type FrameGraphDebugNode = {\n\treadonly id: string;\n readonly order: number;\n\treadonly kind: FrameGraphSnapshotNodeKind;\n readonly label?: string;\n\treadonly sideEffect: boolean;\n\treadonly debugGroupId?: string;\n readonly gpuDurationMicros?: number;\n readonly cpuDurationMicros?: number;\n readonly reads: readonly FrameGraphDebugAccess[];\n readonly writes: readonly FrameGraphDebugAccess[];\n};\n\nexport type FrameGraphDebugResource = FrameGraphDebugResourceRef & {\n\treadonly origin: FrameGraphSnapshotResourceOrigin;\n\treadonly initialContents?: 'defined' | 'undefined';\n\treadonly debugGroupId?: string;\n\treadonly usageFlags: readonly string[];\n readonly lifetime?: { readonly firstUse: number; readonly lastUse: number };\n\treadonly physicalResourceId?: string;\n\treadonly descriptor?: FrameGraphSnapshot['graph']['resources'][number]['descriptor'];\n\treadonly estimatedByteSize?: number;\n};\n\nexport type FrameGraphDebugEdge = {\n\treadonly fromNodeId: string;\n\treadonly toNodeId: string;\n readonly resource: FrameGraphDebugResourceRef;\n readonly kind: 'value' | 'ordering';\n};\n\nexport type FrameGraphDebugRoot = FrameGraphSnapshotRoot & {\n\treadonly key: string;\n readonly resource?: FrameGraphDebugResourceRef;\n};\n\n/** Semantic identity within one recording, independent of root array order. */\nexport function rootKey(root: FrameGraphSnapshotRoot): string {\n\treturn root.reason === 'side-effect' ? JSON.stringify([root.reason, root.nodeId])\n\t\t: JSON.stringify([root.reason, root.resourceId, root.range?.kind === 'buffer'\n\t\t\t? ['buffer', root.range.offset, root.range.size]\n\t\t\t: root.range?.regions.map((r) => [r.baseMipLevel, r.mipLevelCount, r.aspect, r.baseArrayLayer, r.arrayLayerCount, r.baseDepthSlice, r.depthSliceCount]) ?? null]);\n}\n\nexport type FrameGraphDebugCulledNode = {\n readonly node: Omit<FrameGraphDebugNode, 'order'>;\n readonly reason: string;\n};\n\nexport type FrameGraphDebugPhysicalAllocation = {\n\treadonly id: string;\n\treadonly kind: FrameGraphSnapshotResourceKind;\n\treadonly compatibilityClassId: string;\n\treadonly estimatedByteSize?: number;\n\treadonly resourceIds: readonly string[];\n};\n\nexport type FrameGraphDebugGroupSummary = {\n\treadonly retainedNodeCount: number;\n\treadonly culledNodeCount: number;\n\treadonly nodeKindCounts: Readonly<Partial<Record<FrameGraphSnapshotNodeKind, number>>>;\n\treadonly inputResources: readonly FrameGraphDebugResourceRef[];\n\treadonly outputResources: readonly FrameGraphDebugResourceRef[];\n\treadonly outputRoots: readonly FrameGraphDebugRoot[];\n\treadonly registeredTransientResourceCount: number;\n\treadonly accessedTransientResourceCount: number;\n\treadonly physicalAllocationCount: number;\n\treadonly executionSegmentCount: number;\n\treadonly externalSubmissionCount: number;\n\treadonly gpuWorkDurationMicros: number;\n\treadonly timedNodeCount: number;\n\treadonly cpuTimedNodeCount: number;\n\treadonly cpuWorkDurationMicros: number;\n\treadonly timingEligibleNodeCount: number;\n};\n\nexport type FrameGraphDebugGroup = {\n\treadonly id: string;\n\treadonly parentId?: string;\n\treadonly label: string;\n\treadonly path: readonly string[];\n\t/** Stable while same-named siblings retain their recording-order occurrence. */\n\treadonly pathKey: string;\n\treadonly depth: number;\n\t/** Ordered ancestor ids from root through this group. */\n\treadonly ancestorIds: readonly string[];\n\treadonly summary: FrameGraphDebugGroupSummary;\n};\n\nexport type FrameGraphDebugMetrics = {\n\treadonly timingEligibleNodeCount: number;\n\treadonly timedNodeCount: number;\n\treadonly cpuTimedNodeCount: number;\n\treadonly cpuWorkDurationMicros: number;\n\treadonly slowestNode?: FrameGraphDebugNode;\n\treadonly transientEstimatedByteSize?: number;\n\treadonly logicalCapacityBytes?: number;\n\treadonly physicalEstimatedBytes?: number;\n\treadonly aliasReuseBytes?: number;\n\treadonly aliasedAllocationCount: number;\n\treadonly estimatedCoverage: {\n\t\treadonly transient: EstimateCoverage;\n\t\treadonly logical: EstimateCoverage;\n\t\treadonly physical: EstimateCoverage;\n\t};\n};\n\nexport type EstimateCoverage = { readonly known: number; readonly total: number };\n\nexport type FrameGraphDebugSnapshotSource = {\n\treadonly kind: 'live' | 'file' | 'programmatic';\n\treadonly label: string;\n\treadonly migratedFromLegacy?: boolean;\n};\n\nexport type FrameGraphDebugViewModel = {\n\treadonly protocol: FrameGraphSnapshot;\n\treadonly source: FrameGraphDebugSnapshotSource;\n readonly frameIndex: number;\n readonly nodes: readonly FrameGraphDebugNode[];\n readonly resources: readonly FrameGraphDebugResource[];\n readonly edges: readonly FrameGraphDebugEdge[];\n readonly accessEdges: readonly FrameGraphDebugAccessEdge[];\n readonly roots: readonly FrameGraphDebugRoot[];\n readonly culledNodes: readonly FrameGraphDebugCulledNode[];\n\treadonly physicalAllocations: readonly FrameGraphDebugPhysicalAllocation[];\n\treadonly debugGroups: readonly FrameGraphDebugGroup[];\n\treadonly executionSegments: readonly FrameGraphDebugExecutionSegment[];\n\treadonly textureViewById: ReadonlyMap<string, FrameGraphSnapshot['graph']['textureViews'][number]>;\n\treadonly nodeById: ReadonlyMap<string, FrameGraphDebugNode>;\n\treadonly canonicalNodeById: ReadonlyMap<string, FrameGraphSnapshot['graph']['nodes'][number]>;\n\treadonly culledById: ReadonlyMap<string, FrameGraphDebugCulledNode>;\n\treadonly diagnosticsByNodeId: ReadonlyMap<string, readonly FrameGraphSnapshot['diagnostics'][number][]>;\n\treadonly diagnosticsByResourceId: ReadonlyMap<string, readonly FrameGraphSnapshot['diagnostics'][number][]>;\n\treadonly resourceById: ReadonlyMap<string, FrameGraphDebugResource>;\n\treadonly groupById: ReadonlyMap<string, FrameGraphDebugGroup>;\n\treadonly groupByPathKey: ReadonlyMap<string, FrameGraphDebugGroup>;\n\treadonly allocationById: ReadonlyMap<string, FrameGraphDebugPhysicalAllocation>;\n\treadonly accessesByNodeId: ReadonlyMap<string, readonly FrameGraphDebugAccessEdge[]>;\n\treadonly accessesByResourceId: ReadonlyMap<string, readonly FrameGraphDebugAccessEdge[]>;\n\treadonly segmentByNodeId: ReadonlyMap<string, FrameGraphDebugExecutionSegment>;\n\treadonly segmentByIndex: ReadonlyMap<number, FrameGraphDebugExecutionSegment>;\n\treadonly metrics: FrameGraphDebugMetrics;\n readonly cpuProfiling: FrameGraphSnapshot['timings']['cpu'];\n readonly profiling:\n | {\n readonly status: 'available';\n readonly frameIndex: number;\n\t\t\treadonly timings: readonly { readonly nodeId: string; readonly gpuDurationMicros: number }[];\n readonly gpuFrameDurationMicros: number;\n }\n | {\n readonly status: 'unavailable';\n readonly frameIndex: number;\n\t\t\treadonly reason: Extract<FrameGraphSnapshotGpuTimings, { readonly status: 'unavailable' }>['reason'];\n readonly timings: readonly [];\n };\n\treadonly resourcePool: FrameGraphSnapshot['memory']['poolReport'];\n\treadonly availability: {\n\t\treadonly groups: boolean;\n\t\treadonly textureViews: boolean;\n\t\treadonly recordingOrder: boolean;\n\t\treadonly accessRegions: boolean;\n\t};\n};\n\nexport function createDebugViewModel(\n\tsnapshot: FrameGraphSnapshot,\n\tsource: FrameGraphDebugSnapshotSource = { kind: 'programmatic', label: 'Programmatic' },\n): FrameGraphDebugViewModel {\n\tconst compilation = snapshot.graph;\n\tconst unavailable = new Set(snapshot.capture.migration?.unavailableFacts ?? []);\n\tconst availability = {\n\t\tgroups: !unavailable.has('graph.groups'),\n\t\ttextureViews: !unavailable.has('graph.textureViews'),\n\t\trecordingOrder: !unavailable.has('graph.nodes.recordingOrder'),\n\t\taccessRegions: !unavailable.has('graph.accesses.regions'),\n\t};\n\tconst resolvedSource: FrameGraphDebugSnapshotSource = snapshot.capture.migration?.sourceFormat === 'legacy-v0'\n\t\t? { ...source, migratedFromLegacy: true }\n\t\t: source;\n\tconst gpuTiming = snapshot.timings.gpu;\n\tconst cpuTimings = new Map(snapshot.timings.cpu.status === 'available' ? snapshot.timings.cpu.nodes.map(node => [node.nodeId, node.durationMicros]) : []);\n\tconst resourcePool = snapshot.memory.poolReport;\n\tconst normalizedGroups = normalizeDebugGroups(compilation);\n\tconst knownGroupIds = new Set(normalizedGroups.map((group) => group.id));\n\tvalidateDebugGroupReferences(compilation, knownGroupIds);\n\tconst resourcesById = new Map(compilation.resources.map((resource) => [resource.id, resource]));\n\tconst resourceRef = (resourceId: string): FrameGraphDebugResourceRef => {\n const resource = resourcesById.get(resourceId);\n if (!resource) {\n throw new Error(`Compilation report references unknown resource ${resourceId}.`);\n }\n return { id: resource.id, kind: resource.kind, label: resource.label };\n };\n const accessEdges = compilation.accesses.map((access): FrameGraphDebugAccessEdge => {\n const common = {\n accessId: access.id,\n nodeId: access.nodeId,\n resource: resourceRef(access.resourceId),\n access: access.access,\n textureViewId: access.textureViewId,\n textureRegion: access.textureRegion,\n bufferRange: access.bufferRange,\n };\n return access.mode === 'read'\n ? { ...common, mode: 'read', producesValue: false }\n : {\n ...common,\n mode: 'write',\n contents: access.contents,\n producesValue: access.producesValue,\n };\n });\n\tconst accessesByNode = new Map<string, FrameGraphDebugAccessEdge[]>();\n\tconst accessesByResource = new Map<string, FrameGraphDebugAccessEdge[]>();\n for (const access of accessEdges) {\n const nodeAccesses = accessesByNode.get(access.nodeId) ?? [];\n nodeAccesses.push(access);\n accessesByNode.set(access.nodeId, nodeAccesses);\n\t\tconst resourceAccesses = accessesByResource.get(access.resource.id) ?? [];\n\t\tresourceAccesses.push(access);\n\t\taccessesByResource.set(access.resource.id, resourceAccesses);\n }\n\tconst timings = gpuTiming.status === 'available'\n ? new Map(gpuTiming.nodes.map((timing) => [timing.nodeId, timing.durationMicros]))\n : new Map<string, number>();\n\tconst nodeAccesses = (nodeId: string, mode: ResourceAccessMode): FrameGraphDebugAccess[] => (\n (accessesByNode.get(nodeId) ?? [])\n .filter((access) => access.mode === mode)\n\t\t\t.map(({ nodeId: _nodeId, ...access }) => access)\n\t);\n\tconst nodes: FrameGraphDebugNode[] = compilation.nodes\n\t\t.filter((node) => node.compileState.status === 'retained')\n\t\t.sort((a, b) => a.compileState.status === 'retained' && b.compileState.status === 'retained'\n\t\t\t? a.compileState.executionOrder - b.compileState.executionOrder\n\t\t\t: 0)\n\t\t.map((node) => ({\n\t\tid: node.id,\n\t\torder: node.compileState.status === 'retained' ? node.compileState.executionOrder : 0,\n\t\tkind: node.kind,\n\t\tlabel: node.label,\n\t\tsideEffect: node.sideEffect,\n\t\tdebugGroupId: node.groupId,\n\t\tgpuDurationMicros: timings.get(node.id),\n\t\tcpuDurationMicros: cpuTimings.get(node.id),\n\t\treads: nodeAccesses(node.id, 'read'),\n\t\twrites: nodeAccesses(node.id, 'write'),\n\t}));\n\tconst resources: FrameGraphDebugResource[] = compilation.resources.map((resource) => ({\n\t\tid: resource.id,\n\t\tkind: resource.kind,\n\t\tlabel: resource.label,\n\t\torigin: resource.origin,\n\t\tinitialContents: resource.initialContents,\n\t\tdebugGroupId: resource.groupId,\n\t\tusageFlags: resource.usageFlags,\n\t\tlifetime: resource.lifetime,\n\t\tphysicalResourceId: resource.allocationId,\n\t\tdescriptor: resource.descriptor,\n\t\testimatedByteSize: resource.estimatedByteSize,\n\t}));\n\tconst edges: FrameGraphDebugEdge[] = compilation.dependencies.map((dependency) => ({\n\t\t...dependency,\n\t\tresource: resourceRef(dependency.resourceId),\n\t}));\n\tconst roots: FrameGraphDebugRoot[] = compilation.roots.map((root) => ({\n\t\t...root,\n\t\tkey: rootKey(root),\n\t\tresource: root.resourceId === undefined ? undefined : resourceRef(root.resourceId),\n\t}));\n\tconst culledNodes: FrameGraphDebugCulledNode[] = compilation.nodes\n\t\t.filter((node) => node.compileState.status === 'culled')\n\t\t.map((node) => ({\n\t\tnode: {\n\t\t\tid: node.id,\n\t\t\tkind: node.kind,\n\t\t\tlabel: node.label,\n\t\t\tsideEffect: node.sideEffect,\n\t\t\tdebugGroupId: node.groupId,\n\t\t\treads: nodeAccesses(node.id, 'read'),\n\t\t\twrites: nodeAccesses(node.id, 'write'),\n\t\t},\n\t\treason: node.compileState.status === 'culled' ? node.compileState.reason : 'unknown',\n\t}));\n\tconst resourceIdsByAllocation = new Map<string, string[]>();\n\tfor (const resource of compilation.resources) {\n\t\tif (resource.allocationId === undefined) continue;\n\t\tconst resourceIds = resourceIdsByAllocation.get(resource.allocationId) ?? [];\n\t\tresourceIds.push(resource.id);\n\t\tresourceIdsByAllocation.set(resource.allocationId, resourceIds);\n\t}\n\tconst physicalAllocations: FrameGraphDebugPhysicalAllocation[] = snapshot.memory.allocationReport.status === 'available'\n\t\t? snapshot.memory.allocationReport.allocations.map((allocation) => ({\n\t\t\t...allocation,\n\t\t\tresourceIds: resourceIdsByAllocation.get(allocation.id) ?? [],\n\t\t}))\n\t\t: [];\n\tconst executionSegments: FrameGraphDebugExecutionSegment[] = compilation.segments.map((segment) => ({\n\t\t...segment,\n\t\tindex: segment.order,\n\t}));\n\tconst debugGroups = buildDebugGroupSummaries({\n\t\tgroups: normalizedGroups,\n\t\tnodes,\n\t\tculledNodes,\n\t\tresources,\n\t\taccessEdges,\n\t\tedges,\n\t\troots,\n\t\texecutionSegments,\n\t});\n\tconst nodeById = new Map(nodes.map((node) => [node.id, node]));\n\tconst canonicalNodeById = new Map(compilation.nodes.map((node) => [node.id, node]));\n\tconst culledById = new Map(culledNodes.map((entry) => [entry.node.id, entry]));\n\tconst diagnosticsByNodeId = new Map<string, FrameGraphSnapshot['diagnostics'][number][]>();\n\tconst diagnosticsByResourceId = new Map<string, FrameGraphSnapshot['diagnostics'][number][]>();\n\tfor (const diagnostic of snapshot.diagnostics) {\n\t\tfor (const [id, index] of [[diagnostic.nodeId, diagnosticsByNodeId], [diagnostic.resourceId, diagnosticsByResourceId]] as const) {\n\t\t\tif (id === undefined) continue;\n\t\t\tconst entries = index.get(id) ?? [];\n\t\t\tentries.push(diagnostic);\n\t\t\tindex.set(id, entries);\n\t\t}\n\t}\n\tconst resourceById = new Map(resources.map((resource) => [resource.id, resource]));\n\tconst groupById = new Map(debugGroups.map((group) => [group.id, group]));\n\tconst groupByPathKey = new Map(debugGroups.map((group) => [group.pathKey, group]));\n\tconst allocationById = new Map(physicalAllocations.map((allocation) => [allocation.id, allocation]));\n\tconst textureViewById = new Map(compilation.textureViews.map((view) => [view.id, view]));\n\tconst segmentByNodeId = new Map<string, FrameGraphDebugExecutionSegment>();\n\tconst segmentByIndex = new Map(executionSegments.map((segment) => [segment.index, segment]));\n\tfor (const segment of executionSegments) {\n\t\tfor (const nodeId of segment.nodeIds) segmentByNodeId.set(nodeId, segment);\n\t}\n\tconst timingEligibleNodes = nodes.filter((node) => node.kind === 'render' || node.kind === 'compute');\n\tconst timedNodes = timingEligibleNodes.filter((node) => node.gpuDurationMicros !== undefined);\n\tconst slowestNode = timedNodes.reduce<FrameGraphDebugNode | undefined>((slowest, node) => (\n\t\t!slowest || node.gpuDurationMicros! > slowest.gpuDurationMicros! ? node : slowest\n\t), undefined);\n\tconst transientResources = resources.filter((resource) => resource.origin === 'transient');\n\tconst transientEstimatedByteSize = sumKnown(transientResources.map((resource) => resource.estimatedByteSize));\n\tconst allocationAvailable = snapshot.memory.allocationReport.status === 'available';\n\tconst physicalSizes = physicalAllocations.map((allocation) => allocation.estimatedByteSize);\n\tconst physicalEstimatedBytes = allocationAvailable ? sumKnown(physicalSizes) : undefined;\n\tconst logicalAllocationSizes = transientResources\n\t\t.filter((resource) => resource.physicalResourceId !== undefined)\n\t\t.map((resource) => allocationById.get(resource.physicalResourceId!)?.estimatedByteSize);\n\tconst logicalCapacityBytes = allocationAvailable ? sumKnown(logicalAllocationSizes) : undefined;\n\tconst metrics: FrameGraphDebugMetrics = {\n\t\ttimingEligibleNodeCount: timingEligibleNodes.length,\n\t\ttimedNodeCount: timedNodes.length,\n\t\tcpuTimedNodeCount: nodes.filter(node => node.cpuDurationMicros !== undefined).length,\n\t\tcpuWorkDurationMicros: nodes.reduce((sum, node) => sum + (node.cpuDurationMicros ?? 0), 0),\n\t\tslowestNode,\n\t\ttransientEstimatedByteSize,\n\t\tlogicalCapacityBytes,\n\t\tphysicalEstimatedBytes,\n\t\taliasReuseBytes: logicalCapacityBytes === undefined || physicalEstimatedBytes === undefined\n\t\t\t? undefined\n\t\t\t: Math.max(0, logicalCapacityBytes - physicalEstimatedBytes),\n\t\taliasedAllocationCount: physicalAllocations.filter((allocation) => allocation.resourceIds.length > 1).length,\n\t\testimatedCoverage: {\n\t\t\ttransient: estimateCoverage(transientResources.map((resource) => resource.estimatedByteSize)),\n\t\t\tlogical: estimateCoverage(logicalAllocationSizes),\n\t\t\tphysical: estimateCoverage(physicalSizes),\n\t\t},\n\t};\n\n\treturn {\n\t\tprotocol: snapshot,\n\t\tsource: resolvedSource,\n\t\tframeIndex: snapshot.capture.frameIndex,\n\t\tnodes,\n\t\tresources,\n\t\tedges,\n\t\taccessEdges,\n\t\troots,\n\t\tculledNodes,\n\t\tphysicalAllocations,\n\t\tdebugGroups,\n\t\texecutionSegments,\n\t\ttextureViewById,\n\t\tnodeById,\n\t\tcanonicalNodeById,\n\t\tculledById,\n\t\tdiagnosticsByNodeId,\n\t\tdiagnosticsByResourceId,\n\t\tresourceById,\n\t\tgroupById,\n\t\tgroupByPathKey,\n\t\tallocationById,\n\t\taccessesByNodeId: accessesByNode,\n\t\taccessesByResourceId: accessesByResource,\n\t\tsegmentByNodeId,\n\t\tsegmentByIndex,\n\t\tmetrics,\n cpuProfiling: snapshot.timings.cpu,\n profiling: gpuTiming.status === 'available'\n ? {\n status: 'available',\n frameIndex: snapshot.capture.frameIndex,\n timings: gpuTiming.nodes.map((timing) => ({\n nodeId: timing.nodeId,\n gpuDurationMicros: timing.durationMicros,\n })),\n gpuFrameDurationMicros: gpuTiming.frameSpanMicros,\n }\n : {\n status: 'unavailable',\n frameIndex: snapshot.capture.frameIndex,\n timings: [],\n reason: gpuTiming.reason,\n },\n\t\tresourcePool,\n\t\tavailability,\n\t};\n}\n\nfunction estimateCoverage(values: readonly (number | undefined)[]): EstimateCoverage {\n\treturn { known: values.filter((value) => value !== undefined).length, total: values.length };\n}\n\nfunction sumKnown(values: readonly (number | undefined)[]): number | undefined {\n\tlet total = 0;\n\tfor (const value of values) {\n\t\tif (value === undefined) return undefined;\n\t\ttotal += value;\n\t}\n\treturn total;\n}\n\ntype NormalizedDebugGroup = Omit<FrameGraphDebugGroup, 'summary'>;\n\nfunction normalizeDebugGroups(compilation: FrameGraphSnapshot['graph']): NormalizedDebugGroup[] {\n\tconst rawGroups = compilation.groups;\n\tconst rawById = new Map<string, FrameGraphSnapshot['graph']['groups'][number]>();\n\tconst siblingOccurrences = new Map<string, number>();\n\tconst nextOccurrenceByParent = new Map<string | undefined, Map<string, number>>();\n\tfor (const group of rawGroups) {\n\t\tif (rawById.has(group.id)) {\n\t\t\tthrow new Error(`Compilation report contains duplicate debug group id ${group.id}.`);\n\t\t}\n\t\tconst label = group.label.trim();\n\t\tif (label.length === 0) {\n\t\t\tthrow new Error(`Compilation report debug group ${group.id} has an empty label.`);\n\t\t}\n\t\trawById.set(group.id, { ...group, label });\n\t\tconst nextOccurrenceByLabel = nextOccurrenceByParent.get(group.parentId) ?? new Map<string, number>();\n\t\tconst occurrence = nextOccurrenceByLabel.get(label) ?? 0;\n\t\tsiblingOccurrences.set(group.id, occurrence);\n\t\tnextOccurrenceByLabel.set(label, occurrence + 1);\n\t\tnextOccurrenceByParent.set(group.parentId, nextOccurrenceByLabel);\n\t}\n\n\tconst normalizedById = new Map<string, NormalizedDebugGroup>();\n\tconst identityPathById = new Map<string, readonly (readonly [label: string, siblingOccurrence: number])[]>();\n\tconst visiting = new Set<string>();\n\tconst resolve = (id: string): NormalizedDebugGroup => {\n\t\tconst existing = normalizedById.get(id);\n\t\tif (existing) return existing;\n\t\tconst raw = rawById.get(id);\n\t\tif (!raw) throw new Error(`Compilation report references unknown debug group ${id}.`);\n\t\tif (visiting.has(id)) throw new Error(`Compilation report debug group ${id} has a parent cycle.`);\n\t\tvisiting.add(id);\n\t\tconst parent = raw.parentId === undefined ? undefined : resolve(raw.parentId);\n\t\tconst path = [...(parent?.path ?? []), raw.label];\n\t\tconst identityPath = [\n\t\t\t...(raw.parentId === undefined ? [] : identityPathById.get(raw.parentId)!),\n\t\t\t[raw.label, siblingOccurrences.get(raw.id)!] as const,\n\t\t];\n\t\tconst ancestorIds = [...(parent?.ancestorIds ?? []), raw.id];\n\t\tconst normalized: NormalizedDebugGroup = {\n\t\t\tid: raw.id,\n\t\t\tparentId: raw.parentId,\n\t\t\tlabel: raw.label,\n\t\t\tpath,\n\t\t\tpathKey: JSON.stringify(identityPath),\n\t\t\tdepth: path.length - 1,\n\t\t\tancestorIds,\n\t\t};\n\t\tvisiting.delete(id);\n\t\tidentityPathById.set(id, identityPath);\n\t\tnormalizedById.set(id, normalized);\n\t\treturn normalized;\n\t};\n\treturn rawGroups.map((group) => resolve(group.id));\n}\n\nfunction validateDebugGroupReferences(\n\tcompilation: FrameGraphSnapshot['graph'],\n\tknownGroupIds: ReadonlySet<string>,\n): void {\n\tfor (const entry of [...compilation.nodes, ...compilation.resources]) {\n\t\tif (entry.groupId !== undefined && !knownGroupIds.has(entry.groupId)) {\n\t\t\tthrow new Error(`Compilation report references unknown debug group ${entry.groupId}.`);\n\t\t}\n\t}\n}\n\n/** Declaration boundaries are topological, not per-range initial-value provenance. */\nexport function declarationEntrances(\n\tnodes: readonly FrameGraphDebugNode[],\n\taccesses: readonly FrameGraphDebugAccessEdge[],\n\tedges: readonly FrameGraphDebugEdge[],\n): readonly FrameGraphDebugAccessEdge[] {\n\tconst retained = new Set(nodes.map((node) => node.id));\n\tconst incoming = new Set(edges.map((edge) => JSON.stringify([edge.resource.id, edge.toNodeId])));\n\tconst seen = new Set<string>();\n\treturn accesses.filter((access) => {\n\t\tconst key = JSON.stringify([access.resource.id, access.nodeId]);\n\t\tif (!retained.has(access.nodeId) || incoming.has(key) || seen.has(key)) return false;\n\t\tseen.add(key);\n\t\treturn true;\n\t});\n}\n\nfunction buildDebugGroupSummaries(input: {\n\treadonly groups: readonly NormalizedDebugGroup[];\n\treadonly nodes: readonly FrameGraphDebugNode[];\n\treadonly culledNodes: readonly FrameGraphDebugCulledNode[];\n\treadonly resources: readonly FrameGraphDebugResource[];\n\treadonly accessEdges: readonly FrameGraphDebugAccessEdge[];\n\treadonly edges: readonly FrameGraphDebugEdge[];\n\treadonly roots: readonly FrameGraphDebugRoot[];\n\treadonly executionSegments: readonly FrameGraphDebugExecutionSegment[];\n}): FrameGraphDebugGroup[] {\n\tconst groupsById = new Map(input.groups.map((group) => [group.id, group]));\n\tconst resourcesById = new Map(input.resources.map((resource) => [resource.id, resource]));\n\tconst entrances = declarationEntrances(input.nodes, input.accessEdges, input.edges);\n\tconst isInGroup = (candidateId: string | undefined, groupId: string) => (\n\t\tcandidateId !== undefined && groupsById.get(candidateId)?.ancestorIds.includes(groupId) === true\n\t);\n\n\treturn input.groups.map((group): FrameGraphDebugGroup => {\n\t\tconst retained = input.nodes.filter((node) => isInGroup(node.debugGroupId, group.id));\n\t\tconst culled = input.culledNodes.filter((entry) => isInGroup(entry.node.debugGroupId, group.id));\n\t\tconst retainedIds = new Set(retained.map((node) => node.id));\n\t\tconst allIds = new Set([...retainedIds, ...culled.map((entry) => entry.node.id)]);\n\t\tconst nodeKindCounts: Partial<Record<FrameGraphSnapshotNodeKind, number>> = {};\n\t\tfor (const node of [...retained, ...culled.map((entry) => entry.node)]) {\n\t\t\tnodeKindCounts[node.kind] = (nodeKindCounts[node.kind] ?? 0) + 1;\n\t\t}\n\n\t\tconst inputIds = new Set<string>();\n\t\tconst outputIds = new Set<string>();\n\t\tfor (const edge of input.edges) {\n\t\t\tconst fromInside = retainedIds.has(edge.fromNodeId);\n\t\t\tconst toInside = retainedIds.has(edge.toNodeId);\n\t\t\tif (!fromInside && toInside) inputIds.add(edge.resource.id);\n\t\t\tif (fromInside && !toInside) outputIds.add(edge.resource.id);\n\t\t}\n\t\tfor (const access of entrances) {\n\t\t\tconst fromInside = isInGroup(resourcesById.get(access.resource.id)?.debugGroupId, group.id);\n\t\t\tconst toInside = retainedIds.has(access.nodeId);\n\t\t\tif (!fromInside && toInside) inputIds.add(access.resource.id);\n\t\t\tif (fromInside && !toInside) outputIds.add(access.resource.id);\n\t\t}\n\t\tconst outputRoots: FrameGraphDebugRoot[] = [];\n\t\tfor (const root of input.roots) {\n\t\t\tif (!root.resource) continue;\n\t\t\tif (root.resolution?.producerNodeIds.some((id) => retainedIds.has(id))\n\t\t\t\t|| root.resolution?.usesInitialContents && isInGroup(resourcesById.get(root.resource.id)?.debugGroupId, group.id)) {\n\t\t\t\toutputIds.add(root.resource.id);\n\t\t\t\toutputRoots.push(root);\n\t\t\t}\n\t\t}\n\n\t\tconst registeredTransient = input.resources.filter((resource) => resource.origin === 'transient'\n\t\t\t&& isInGroup(resource.debugGroupId, group.id));\n\t\tconst registeredTransientIds = new Set(registeredTransient.map((resource) => resource.id));\n\t\tconst accessedTransientIds = new Set(input.accessEdges\n\t\t\t.filter((access) => allIds.has(access.nodeId) && registeredTransientIds.has(access.resource.id))\n\t\t\t.map((access) => access.resource.id));\n\t\tconst allocationIds = new Set(registeredTransient.flatMap((resource) => (\n\t\t\tresource.physicalResourceId === undefined ? [] : [resource.physicalResourceId]\n\t\t)));\n\t\tconst segmentIds = new Set(input.executionSegments\n\t\t\t.filter((segment) => segment.nodeIds.some((id) => retainedIds.has(id)))\n\t\t\t.map((segment) => segment.index));\n\t\tconst timingEligible = retained.filter((node) => node.kind === 'render' || node.kind === 'compute');\n\t\tconst timed = timingEligible.filter((node) => node.gpuDurationMicros !== undefined);\n\n\t\treturn {\n\t\t\t...group,\n\t\t\tsummary: {\n\t\t\t\tretainedNodeCount: retained.length,\n\t\t\t\tculledNodeCount: culled.length,\n\t\t\t\tnodeKindCounts,\n\t\t\t\tinputResources: [...inputIds].map((id) => resourcesById.get(id)!).filter(Boolean),\n\t\t\t\toutputResources: [...outputIds].map((id) => resourcesById.get(id)!).filter(Boolean),\n\t\t\t\toutputRoots,\n\t\t\t\tregisteredTransientResourceCount: registeredTransient.length,\n\t\t\t\taccessedTransientResourceCount: accessedTransientIds.size,\n\t\t\t\tphysicalAllocationCount: allocationIds.size,\n\t\t\t\texecutionSegmentCount: segmentIds.size,\n\t\t\t\texternalSubmissionCount: retained.filter((node) => node.kind === 'external-submission').length,\n\t\t\t\tgpuWorkDurationMicros: timed.reduce((sum, node) => sum + node.gpuDurationMicros!, 0),\n\t\t\t\ttimedNodeCount: timed.length,\n\t\t\t\tcpuTimedNodeCount: retained.filter(node => node.cpuDurationMicros !== undefined).length,\n\t\t\t\tcpuWorkDurationMicros: retained.reduce((sum, node) => sum + (node.cpuDurationMicros ?? 0), 0),\n\t\t\t\ttimingEligibleNodeCount: timingEligible.length,\n\t\t\t},\n\t\t};\n\t});\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,4 +14,6 @@ export { FrameGraphInspector, mountFrameGraphInspector } from './FrameGraphInspe
|
|
|
14
14
|
export type { FrameGraphInspectorOptions } from './FrameGraphInspector.ts';
|
|
15
15
|
export { ZENFG_INSPECTOR_QUERY_PARAM, isZenFGInspectorRequested } from './query.ts';
|
|
16
16
|
export { ensureFrameGraphInspectorStyles } from './styles.ts';
|
|
17
|
+
export type { InspectorTheme, InspectorThemeVariables } from './theme.ts';
|
|
18
|
+
export type { FrameGraphCaptureRequest } from './capture.ts';
|
|
17
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACX,kBAAkB,EAClB,8BAA8B,EAC9B,uBAAuB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzF,YAAY,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACX,kBAAkB,EAClB,8BAA8B,EAC9B,uBAAuB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzF,YAAY,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1E,YAAY,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/**\n * Renders a host-sized interactive workbench for live or imported ZenFG\n * FrameGraph Snapshot documents. The same component supports full-page and\n * embedded layouts.\n *\n * {@link mountFrameGraphInspector} appends the inspector to a host element and\n * returns its lifecycle controller. Call {@link FrameGraphInspector.destroy}\n * before discarding the host or replacing the inspector.\n *\n * @packageDocumentation\n */\n\nexport type {\n\tFrameGraphSnapshot,\n\tFrameGraphSnapshotDecodeResult,\n\tFrameGraphSnapshotIssue,\n} from '@zenfg/snapshot';\nexport { FrameGraphInspector, mountFrameGraphInspector } from './FrameGraphInspector.ts';\nexport type { FrameGraphInspectorOptions } from './FrameGraphInspector.ts';\nexport { ZENFG_INSPECTOR_QUERY_PARAM, isZenFGInspectorRequested } from './query.ts';\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/**\n * Renders a host-sized interactive workbench for live or imported ZenFG\n * FrameGraph Snapshot documents. The same component supports full-page and\n * embedded layouts.\n *\n * {@link mountFrameGraphInspector} appends the inspector to a host element and\n * returns its lifecycle controller. Call {@link FrameGraphInspector.destroy}\n * before discarding the host or replacing the inspector.\n *\n * @packageDocumentation\n */\n\nexport type {\n\tFrameGraphSnapshot,\n\tFrameGraphSnapshotDecodeResult,\n\tFrameGraphSnapshotIssue,\n} from '@zenfg/snapshot';\nexport { FrameGraphInspector, mountFrameGraphInspector } from './FrameGraphInspector.ts';\nexport type { FrameGraphInspectorOptions } from './FrameGraphInspector.ts';\nexport { ZENFG_INSPECTOR_QUERY_PARAM, isZenFGInspectorRequested } from './query.ts';\nexport { ensureFrameGraphInspectorStyles } from './styles.ts';\n\nexport type { InspectorTheme, InspectorThemeVariables } from './theme.ts';\n\nexport type { FrameGraphCaptureRequest } from './capture.ts';\n"]}
|
|
@@ -15,6 +15,7 @@ export type AliasAnalysis = {
|
|
|
15
15
|
readonly resources: ReadonlyMap<string, AliasAnalysisResource>;
|
|
16
16
|
readonly minUse: number;
|
|
17
17
|
readonly maxUse: number;
|
|
18
|
+
readonly hasLifetimes: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare function analyzeSnapshotAliases(snapshot: FrameGraphDebugViewModel): AliasAnalysis;
|
|
20
21
|
//# sourceMappingURL=panelAliasAnalysis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelAliasAnalysis.d.ts","sourceRoot":"","sources":["../src/panelAliasAnalysis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,iCAAiC,EACjC,uBAAuB,EACvB,wBAAwB,EAC3B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,qBAAqB,GAAG;IAChC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,iCAAiC,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,eAA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AM,aAAa,GAAG;IACxB,QAAQ,CAAC,WAAW,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACzD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAClC,CAAC;AAMF,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,aAAa,CAyDxF"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
// View models are immutable for the lifetime of a capture. Search and selection
|
|
2
|
+
// changes should not rebuild allocation membership or the execution domain.
|
|
3
|
+
const analysisBySnapshot = new WeakMap();
|
|
1
4
|
export function analyzeSnapshotAliases(snapshot) {
|
|
5
|
+
const cached = analysisBySnapshot.get(snapshot);
|
|
6
|
+
if (cached)
|
|
7
|
+
return cached;
|
|
2
8
|
const allocationById = snapshot.allocationById;
|
|
3
9
|
const resourcesById = snapshot.resourceById;
|
|
4
10
|
const allocationGroups = snapshot.physicalAllocations.map((allocation) => {
|
|
@@ -15,13 +21,14 @@ export function analyzeSnapshotAliases(snapshot) {
|
|
|
15
21
|
let minUse = Number.POSITIVE_INFINITY;
|
|
16
22
|
let maxUse = Number.NEGATIVE_INFINITY;
|
|
17
23
|
for (const resource of snapshot.resources) {
|
|
18
|
-
if (!resource.lifetime) {
|
|
24
|
+
if (resource.origin !== 'transient' || !resource.lifetime) {
|
|
19
25
|
continue;
|
|
20
26
|
}
|
|
21
27
|
minUse = Math.min(minUse, resource.lifetime.firstUse);
|
|
22
28
|
maxUse = Math.max(maxUse, resource.lifetime.lastUse);
|
|
23
29
|
}
|
|
24
|
-
|
|
30
|
+
const hasLifetimes = Number.isFinite(minUse) && Number.isFinite(maxUse);
|
|
31
|
+
if (!hasLifetimes) {
|
|
25
32
|
minUse = 0;
|
|
26
33
|
maxUse = 0;
|
|
27
34
|
}
|
|
@@ -36,15 +43,18 @@ export function analyzeSnapshotAliases(snapshot) {
|
|
|
36
43
|
resource,
|
|
37
44
|
allocation,
|
|
38
45
|
aliasStatus,
|
|
39
|
-
nonAliasReasons:
|
|
46
|
+
nonAliasReasons: describeAliasStatus(aliasStatus),
|
|
40
47
|
});
|
|
41
48
|
}
|
|
42
|
-
|
|
49
|
+
const analysis = {
|
|
43
50
|
allocations: allocationGroups,
|
|
44
51
|
resources: resourceAnalysis,
|
|
45
52
|
minUse,
|
|
46
53
|
maxUse,
|
|
54
|
+
hasLifetimes,
|
|
47
55
|
};
|
|
56
|
+
analysisBySnapshot.set(snapshot, analysis);
|
|
57
|
+
return analysis;
|
|
48
58
|
}
|
|
49
59
|
function resolveAliasStatus(resource, allocation, allocationResources) {
|
|
50
60
|
if (resource.origin !== 'transient') {
|
|
@@ -58,56 +68,15 @@ function resolveAliasStatus(resource, allocation, allocationResources) {
|
|
|
58
68
|
}
|
|
59
69
|
return allocationResources.length > 1 ? 'aliased' : 'single';
|
|
60
70
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
return ['Imported
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return ['
|
|
71
|
+
function describeAliasStatus(status) {
|
|
72
|
+
switch (status) {
|
|
73
|
+
case 'not-transient': return ['Imported and surface resources do not participate in transient aliasing.'];
|
|
74
|
+
case 'no-lifetime': return ['No lifetime is available for this resource in the retained graph.'];
|
|
75
|
+
case 'not-allocated': return ['No physical allocation is associated with this transient resource.'];
|
|
76
|
+
case 'aliased': return ['Shares a physical allocation with other logical resources.'];
|
|
77
|
+
// The snapshot states allocation membership; it cannot explain allocator
|
|
78
|
+
// decisions by comparing every pair of logical resources.
|
|
79
|
+
case 'single': return ['This physical allocation contains one logical resource.'];
|
|
67
80
|
}
|
|
68
|
-
if (!allocation) {
|
|
69
|
-
return ['No physical allocation is associated with this transient resource.'];
|
|
70
|
-
}
|
|
71
|
-
const reasons = new Set();
|
|
72
|
-
for (const group of allocations) {
|
|
73
|
-
if (group.allocation.id === allocation.id) {
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
for (const other of group.resources) {
|
|
77
|
-
if (other.id === resource.id || other.origin !== 'transient') {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
if (other.kind !== resource.kind) {
|
|
81
|
-
reasons.add(`Different kind from ${labelDebugResource(other)}.`);
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
if (group.allocation.compatibilityClassId !== allocation.compatibilityClassId) {
|
|
85
|
-
reasons.add(`Different compatibility class from ${labelDebugResource(other)}.`);
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
if (!other.lifetime) {
|
|
89
|
-
reasons.add(`Missing lifetime for ${labelDebugResource(other)}.`);
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
if (lifetimesOverlap(resource.lifetime, other.lifetime)) {
|
|
93
|
-
reasons.add(`Lifetime overlaps ${labelDebugResource(other)} (${other.lifetime.firstUse}-${other.lifetime.lastUse}).`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (reasons.size === 0) {
|
|
98
|
-
return allocationResourcesFor(allocations, allocation.id).length > 1
|
|
99
|
-
? ['Aliases with resources in the same physical allocation.']
|
|
100
|
-
: ['No compatible non-overlapping transient resource was found in this snapshot.'];
|
|
101
|
-
}
|
|
102
|
-
return Array.from(reasons).slice(0, 6);
|
|
103
|
-
}
|
|
104
|
-
function allocationResourcesFor(allocations, allocationId) {
|
|
105
|
-
return allocations.find((group) => group.allocation.id === allocationId)?.resources ?? [];
|
|
106
|
-
}
|
|
107
|
-
function lifetimesOverlap(a, b) {
|
|
108
|
-
return a.firstUse <= b.lastUse && b.firstUse <= a.lastUse;
|
|
109
|
-
}
|
|
110
|
-
function labelDebugResource(resource) {
|
|
111
|
-
return resource.label ?? `${resource.kind}-${resource.id}`;
|
|
112
81
|
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,QAAQ,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC;AAC9D,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAiC;IACzD,OAAO,QAAQ,CAAC,KAAK,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;AAC/D,CAAC","sourcesContent":["import type {\n FrameGraphDebugPhysicalAllocation,\n FrameGraphDebugResource,\n FrameGraphDebugViewModel,\n} from './debugCaptureModel.ts';\n\nexport type AliasAnalysisResource = {\n readonly resource: FrameGraphDebugResource;\n readonly allocation?: FrameGraphDebugPhysicalAllocation;\n readonly aliasStatus: 'aliased' | 'single' | 'not-transient' | 'not-allocated' | 'no-lifetime';\n readonly nonAliasReasons: readonly string[];\n};\n\nexport type AliasAnalysisAllocation = {\n readonly allocation: FrameGraphDebugPhysicalAllocation;\n readonly resources: readonly FrameGraphDebugResource[];\n readonly aliases: boolean;\n};\n\nexport type AliasAnalysis = {\n readonly allocations: readonly AliasAnalysisAllocation[];\n readonly resources: ReadonlyMap<string, AliasAnalysisResource>;\n readonly minUse: number;\n readonly maxUse: number;\n};\n\nexport function analyzeSnapshotAliases(snapshot: FrameGraphDebugViewModel): AliasAnalysis {\n const allocationById = snapshot.allocationById;\n const resourcesById = snapshot.resourceById;\n const allocationGroups = snapshot.physicalAllocations.map((allocation): AliasAnalysisAllocation => {\n const resources = allocation.resourceIds\n .map((resourceId) => resourcesById.get(resourceId))\n .filter((resource): resource is FrameGraphDebugResource => resource !== undefined);\n return {\n allocation,\n resources,\n aliases: resources.length > 1,\n };\n });\n\n const allocationGroupById = new Map(allocationGroups.map((group) => [group.allocation.id, group]));\n\n let minUse = Number.POSITIVE_INFINITY;\n let maxUse = Number.NEGATIVE_INFINITY;\n for (const resource of snapshot.resources) {\n if (!resource.lifetime) {\n continue;\n }\n minUse = Math.min(minUse, resource.lifetime.firstUse);\n maxUse = Math.max(maxUse, resource.lifetime.lastUse);\n }\n if (!Number.isFinite(minUse) || !Number.isFinite(maxUse)) {\n minUse = 0;\n maxUse = 0;\n }\n\n const resourceAnalysis = new Map<string, AliasAnalysisResource>();\n for (const resource of snapshot.resources) {\n const allocation = resource.physicalResourceId === undefined ? undefined : allocationById.get(resource.physicalResourceId);\n const allocationResources = allocation\n ? allocationGroupById.get(allocation.id)?.resources ?? []\n : [];\n const aliasStatus = resolveAliasStatus(resource, allocation, allocationResources);\n resourceAnalysis.set(resource.id, {\n resource,\n allocation,\n aliasStatus,\n nonAliasReasons: resolveNonAliasReasons(resource, allocation, allocationGroups),\n });\n }\n\n return {\n allocations: allocationGroups,\n resources: resourceAnalysis,\n minUse,\n maxUse,\n };\n}\n\nfunction resolveAliasStatus(\n resource: FrameGraphDebugResource,\n allocation: FrameGraphDebugPhysicalAllocation | undefined,\n allocationResources: readonly FrameGraphDebugResource[],\n): AliasAnalysisResource['aliasStatus'] {\n if (resource.origin !== 'transient') {\n return 'not-transient';\n }\n if (!resource.lifetime) {\n return 'no-lifetime';\n }\n if (!allocation) {\n return 'not-allocated';\n }\n return allocationResources.length > 1 ? 'aliased' : 'single';\n}\n\nfunction resolveNonAliasReasons(\n resource: FrameGraphDebugResource,\n allocation: FrameGraphDebugPhysicalAllocation | undefined,\n allocations: readonly AliasAnalysisAllocation[],\n): readonly string[] {\n if (resource.origin !== 'transient') {\n return ['Imported or swapchain resources do not participate in transient aliasing.'];\n }\n if (!resource.lifetime) {\n return ['No lifetime is available for this resource in the retained graph.'];\n }\n if (!allocation) {\n return ['No physical allocation is associated with this transient resource.'];\n }\n\n const reasons = new Set<string>();\n for (const group of allocations) {\n if (group.allocation.id === allocation.id) {\n continue;\n }\n for (const other of group.resources) {\n if (other.id === resource.id || other.origin !== 'transient') {\n continue;\n }\n if (other.kind !== resource.kind) {\n reasons.add(`Different kind from ${labelDebugResource(other)}.`);\n continue;\n }\n if (group.allocation.compatibilityClassId !== allocation.compatibilityClassId) {\n reasons.add(`Different compatibility class from ${labelDebugResource(other)}.`);\n continue;\n }\n if (!other.lifetime) {\n reasons.add(`Missing lifetime for ${labelDebugResource(other)}.`);\n continue;\n }\n if (lifetimesOverlap(resource.lifetime, other.lifetime)) {\n reasons.add(`Lifetime overlaps ${labelDebugResource(other)} (${other.lifetime.firstUse}-${other.lifetime.lastUse}).`);\n }\n }\n }\n\n if (reasons.size === 0) {\n return allocationResourcesFor(allocations, allocation.id).length > 1\n ? ['Aliases with resources in the same physical allocation.']\n : ['No compatible non-overlapping transient resource was found in this snapshot.'];\n }\n\n return Array.from(reasons).slice(0, 6);\n}\n\nfunction allocationResourcesFor(\n allocations: readonly AliasAnalysisAllocation[],\n allocationId: string,\n): readonly FrameGraphDebugResource[] {\n return allocations.find((group) => group.allocation.id === allocationId)?.resources ?? [];\n}\n\nfunction lifetimesOverlap(\n a: NonNullable<FrameGraphDebugResource['lifetime']>,\n b: NonNullable<FrameGraphDebugResource['lifetime']>,\n): boolean {\n return a.firstUse <= b.lastUse && b.firstUse <= a.lastUse;\n}\n\nfunction labelDebugResource(resource: FrameGraphDebugResource): string {\n return resource.label ?? `${resource.kind}-${resource.id}`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"panelAliasAnalysis.js","sourceRoot":"","sources":["../src/panelAliasAnalysis.ts"],"names":[],"mappings":"AA2BA,gFAAgF;AAChF,4EAA4E;AAC5E,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAA2C,CAAC;AAElF,MAAM,UAAU,sBAAsB,CAAC,QAAkC;IACrE,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAC/C,MAAM,aAAa,GAAG,QAAQ,CAAC,YAAY,CAAC;IAC5C,MAAM,gBAAgB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,UAAU,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G,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;AACjE,CAAC;AAED,SAAS,mBAAmB,CAAC,MAA4C;IACrE,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,eAAe,CAAC,CAAC,OAAO,CAAC,0EAA0E,CAAC,CAAC;QAC1G,KAAK,aAAa,CAAC,CAAC,OAAO,CAAC,mEAAmE,CAAC,CAAC;QACjG,KAAK,eAAe,CAAC,CAAC,OAAO,CAAC,oEAAoE,CAAC,CAAC;QACpG,KAAK,SAAS,CAAC,CAAC,OAAO,CAAC,4DAA4D,CAAC,CAAC;QACtF,yEAAyE;QACzE,0DAA0D;QAC1D,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,yDAAyD,CAAC,CAAC;IACtF,CAAC;AACL,CAAC","sourcesContent":["import type {\n FrameGraphDebugPhysicalAllocation,\n FrameGraphDebugResource,\n FrameGraphDebugViewModel,\n} from './debugCaptureModel.ts';\n\nexport type AliasAnalysisResource = {\n readonly resource: FrameGraphDebugResource;\n readonly allocation?: FrameGraphDebugPhysicalAllocation;\n readonly aliasStatus: 'aliased' | 'single' | 'not-transient' | 'not-allocated' | 'no-lifetime';\n readonly nonAliasReasons: readonly string[];\n};\n\nexport type AliasAnalysisAllocation = {\n readonly allocation: FrameGraphDebugPhysicalAllocation;\n readonly resources: readonly FrameGraphDebugResource[];\n readonly aliases: boolean;\n};\n\nexport type AliasAnalysis = {\n readonly allocations: readonly AliasAnalysisAllocation[];\n readonly resources: ReadonlyMap<string, AliasAnalysisResource>;\n readonly minUse: number;\n readonly maxUse: number;\n readonly hasLifetimes: boolean;\n};\n\n// View models are immutable for the lifetime of a capture. Search and selection\n// changes should not rebuild allocation membership or the execution domain.\nconst analysisBySnapshot = new WeakMap<FrameGraphDebugViewModel, AliasAnalysis>();\n\nexport function analyzeSnapshotAliases(snapshot: FrameGraphDebugViewModel): AliasAnalysis {\n const cached = analysisBySnapshot.get(snapshot);\n if (cached) return cached;\n const allocationById = snapshot.allocationById;\n const resourcesById = snapshot.resourceById;\n const allocationGroups = snapshot.physicalAllocations.map((allocation): AliasAnalysisAllocation => {\n const resources = allocation.resourceIds\n .map((resourceId) => resourcesById.get(resourceId))\n .filter((resource): resource is FrameGraphDebugResource => resource !== undefined);\n return {\n allocation,\n resources,\n aliases: resources.length > 1,\n };\n });\n\n const allocationGroupById = new Map(allocationGroups.map((group) => [group.allocation.id, group]));\n\n let minUse = Number.POSITIVE_INFINITY;\n let maxUse = Number.NEGATIVE_INFINITY;\n for (const resource of snapshot.resources) {\n if (resource.origin !== 'transient' || !resource.lifetime) {\n continue;\n }\n minUse = Math.min(minUse, resource.lifetime.firstUse);\n maxUse = Math.max(maxUse, resource.lifetime.lastUse);\n }\n const hasLifetimes = Number.isFinite(minUse) && Number.isFinite(maxUse);\n if (!hasLifetimes) {\n minUse = 0;\n maxUse = 0;\n }\n\n const resourceAnalysis = new Map<string, AliasAnalysisResource>();\n for (const resource of snapshot.resources) {\n const allocation = resource.physicalResourceId === undefined ? undefined : allocationById.get(resource.physicalResourceId);\n const allocationResources = allocation\n ? allocationGroupById.get(allocation.id)?.resources ?? []\n : [];\n const aliasStatus = resolveAliasStatus(resource, allocation, allocationResources);\n resourceAnalysis.set(resource.id, {\n resource,\n allocation,\n aliasStatus,\n nonAliasReasons: describeAliasStatus(aliasStatus),\n });\n }\n\n const analysis = {\n allocations: allocationGroups,\n resources: resourceAnalysis,\n minUse,\n maxUse,\n hasLifetimes,\n };\n analysisBySnapshot.set(snapshot, analysis);\n return analysis;\n}\n\nfunction resolveAliasStatus(\n resource: FrameGraphDebugResource,\n allocation: FrameGraphDebugPhysicalAllocation | undefined,\n allocationResources: readonly FrameGraphDebugResource[],\n): AliasAnalysisResource['aliasStatus'] {\n if (resource.origin !== 'transient') {\n return 'not-transient';\n }\n if (!resource.lifetime) {\n return 'no-lifetime';\n }\n if (!allocation) {\n return 'not-allocated';\n }\n return allocationResources.length > 1 ? 'aliased' : 'single';\n}\n\nfunction describeAliasStatus(status: AliasAnalysisResource['aliasStatus']): readonly string[] {\n switch (status) {\n case 'not-transient': return ['Imported and surface resources do not participate in transient aliasing.'];\n case 'no-lifetime': return ['No lifetime is available for this resource in the retained graph.'];\n case 'not-allocated': return ['No physical allocation is associated with this transient resource.'];\n case 'aliased': return ['Shares a physical allocation with other logical resources.'];\n // The snapshot states allocation membership; it cannot explain allocator\n // decisions by comparing every pair of logical resources.\n case 'single': return ['This physical allocation contains one logical resource.'];\n }\n}\n"]}
|