@zenfg/inspector 0.1.0-beta.2 → 0.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GUIDE.md +182 -0
- package/README.md +60 -26
- package/THEMING.md +124 -0
- package/dist/FrameGraphInspector.d.ts +24 -8
- package/dist/FrameGraphInspector.d.ts.map +1 -1
- package/dist/FrameGraphInspector.js +151 -65
- 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 +28 -4
- package/dist/debugCaptureModel.d.ts.map +1 -1
- package/dist/debugCaptureModel.js +72 -16
- 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 +18 -3
- package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -1
- package/dist/panelCytoscapeGraphRenderer.js +183 -41
- 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 +167 -58
- 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 +20 -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 +15 -26
- package/dist/panelGraphScene.d.ts.map +1 -1
- package/dist/panelGraphScene.js +191 -208
- 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 +42 -9
- package/dist/panelGraphView.js.map +1 -1
- package/dist/panelGraphVisuals.d.ts +18 -6
- package/dist/panelGraphVisuals.d.ts.map +1 -1
- package/dist/panelGraphVisuals.js +156 -116
- package/dist/panelGraphVisuals.js.map +1 -1
- package/dist/panelInspectorView.d.ts +13 -0
- package/dist/panelInspectorView.d.ts.map +1 -1
- package/dist/panelInspectorView.js +326 -46
- 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 +36 -6
- 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 +18 -4
- package/dist/panelTypes.d.ts.map +1 -1
- package/dist/panelTypes.js.map +1 -1
- package/dist/panelVisualTheme.d.ts +176 -71
- package/dist/panelVisualTheme.d.ts.map +1 -1
- package/dist/panelVisualTheme.js +34 -36
- 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 +63 -2
- 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 +161 -205
- 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 +145 -68
- package/src/capture.ts +4 -0
- package/src/debugCaptureModel.ts +97 -21
- package/src/index.ts +6 -2
- package/src/panelAliasAnalysis.ts +24 -70
- package/src/panelCytoscapeGraphRenderer.ts +177 -40
- package/src/panelDetailLayout.ts +155 -0
- package/src/panelDetailStyles.ts +56 -0
- package/src/panelDiagnosticsView.ts +167 -86
- package/src/panelDomHelpers.ts +4 -5
- package/src/panelGraphLayout.ts +20 -5
- package/src/panelGraphRenderer.ts +7 -0
- package/src/panelGraphScene.ts +204 -292
- package/src/panelGraphSearch.ts +96 -0
- package/src/panelGraphView.ts +41 -9
- package/src/panelGraphVisuals.ts +152 -118
- package/src/panelInspectorView.ts +315 -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 +39 -7
- package/src/panelTheme.ts +85 -0
- package/src/panelTypes.ts +16 -4
- package/src/panelVisualTheme.ts +38 -38
- package/src/panelWorkbenchHelpers.ts +62 -4
- package/src/panelWorkbenchStyles.ts +100 -0
- package/src/panelWorkbenchView.ts +201 -52
- package/src/query.ts +11 -11
- package/src/styles.ts +162 -205
- package/src/theme.ts +24 -0
- package/src/themeDefinitions.ts +103 -0
- package/src/themePalette.ts +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,MAAM,wBAAwB,GAAG;IACtC,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;CACxC,CAAC"}
|
package/dist/capture.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"","sourcesContent":["/** Requested timing families for the next live capture; never changes imported data. */\nexport type FrameGraphCaptureRequest = {\n\treadonly timing: 'cpu' | 'gpu' | 'both';\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FrameGraphSnapshot, FrameGraphSnapshotAccessKind, FrameGraphSnapshotBufferRange, FrameGraphSnapshotGpuTimings, FrameGraphSnapshotNodeKind, FrameGraphSnapshotResourceKind, FrameGraphSnapshotResourceOrigin,
|
|
1
|
+
import type { FrameGraphSnapshot, FrameGraphSnapshotAccessKind, FrameGraphSnapshotBufferRange, FrameGraphSnapshotGpuTimings, FrameGraphSnapshotNodeKind, FrameGraphSnapshotResourceKind, FrameGraphSnapshotResourceOrigin, FrameGraphSnapshotRoot, FrameGraphSnapshotSegment, FrameGraphSnapshotTextureRegion, FrameGraphSnapshotWriteContents } from '@zenfg/snapshot';
|
|
2
2
|
export type FrameGraphDebugExecutionSegment = FrameGraphSnapshotSegment & {
|
|
3
3
|
readonly index: number;
|
|
4
4
|
};
|
|
@@ -34,11 +34,13 @@ export type FrameGraphDebugNode = {
|
|
|
34
34
|
readonly sideEffect: boolean;
|
|
35
35
|
readonly debugGroupId?: string;
|
|
36
36
|
readonly gpuDurationMicros?: number;
|
|
37
|
+
readonly cpuDurationMicros?: number;
|
|
37
38
|
readonly reads: readonly FrameGraphDebugAccess[];
|
|
38
39
|
readonly writes: readonly FrameGraphDebugAccess[];
|
|
39
40
|
};
|
|
40
41
|
export type FrameGraphDebugResource = FrameGraphDebugResourceRef & {
|
|
41
42
|
readonly origin: FrameGraphSnapshotResourceOrigin;
|
|
43
|
+
readonly initialContents?: 'defined' | 'undefined';
|
|
42
44
|
readonly debugGroupId?: string;
|
|
43
45
|
readonly usageFlags: readonly string[];
|
|
44
46
|
readonly lifetime?: {
|
|
@@ -55,11 +57,12 @@ export type FrameGraphDebugEdge = {
|
|
|
55
57
|
readonly resource: FrameGraphDebugResourceRef;
|
|
56
58
|
readonly kind: 'value' | 'ordering';
|
|
57
59
|
};
|
|
58
|
-
export type FrameGraphDebugRoot = {
|
|
59
|
-
readonly
|
|
60
|
-
readonly nodeId?: string;
|
|
60
|
+
export type FrameGraphDebugRoot = FrameGraphSnapshotRoot & {
|
|
61
|
+
readonly key: string;
|
|
61
62
|
readonly resource?: FrameGraphDebugResourceRef;
|
|
62
63
|
};
|
|
64
|
+
/** Semantic identity within one recording, independent of root array order. */
|
|
65
|
+
export declare function rootKey(root: FrameGraphSnapshotRoot): string;
|
|
63
66
|
export type FrameGraphDebugCulledNode = {
|
|
64
67
|
readonly node: Omit<FrameGraphDebugNode, 'order'>;
|
|
65
68
|
readonly reason: string;
|
|
@@ -77,6 +80,7 @@ export type FrameGraphDebugGroupSummary = {
|
|
|
77
80
|
readonly nodeKindCounts: Readonly<Partial<Record<FrameGraphSnapshotNodeKind, number>>>;
|
|
78
81
|
readonly inputResources: readonly FrameGraphDebugResourceRef[];
|
|
79
82
|
readonly outputResources: readonly FrameGraphDebugResourceRef[];
|
|
83
|
+
readonly outputRoots: readonly FrameGraphDebugRoot[];
|
|
80
84
|
readonly registeredTransientResourceCount: number;
|
|
81
85
|
readonly accessedTransientResourceCount: number;
|
|
82
86
|
readonly physicalAllocationCount: number;
|
|
@@ -84,6 +88,8 @@ export type FrameGraphDebugGroupSummary = {
|
|
|
84
88
|
readonly externalSubmissionCount: number;
|
|
85
89
|
readonly gpuWorkDurationMicros: number;
|
|
86
90
|
readonly timedNodeCount: number;
|
|
91
|
+
readonly cpuTimedNodeCount: number;
|
|
92
|
+
readonly cpuWorkDurationMicros: number;
|
|
87
93
|
readonly timingEligibleNodeCount: number;
|
|
88
94
|
};
|
|
89
95
|
export type FrameGraphDebugGroup = {
|
|
@@ -101,12 +107,23 @@ export type FrameGraphDebugGroup = {
|
|
|
101
107
|
export type FrameGraphDebugMetrics = {
|
|
102
108
|
readonly timingEligibleNodeCount: number;
|
|
103
109
|
readonly timedNodeCount: number;
|
|
110
|
+
readonly cpuTimedNodeCount: number;
|
|
111
|
+
readonly cpuWorkDurationMicros: number;
|
|
104
112
|
readonly slowestNode?: FrameGraphDebugNode;
|
|
105
113
|
readonly transientEstimatedByteSize?: number;
|
|
106
114
|
readonly logicalCapacityBytes?: number;
|
|
107
115
|
readonly physicalEstimatedBytes?: number;
|
|
108
116
|
readonly aliasReuseBytes?: number;
|
|
109
117
|
readonly aliasedAllocationCount: number;
|
|
118
|
+
readonly estimatedCoverage: {
|
|
119
|
+
readonly transient: EstimateCoverage;
|
|
120
|
+
readonly logical: EstimateCoverage;
|
|
121
|
+
readonly physical: EstimateCoverage;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
export type EstimateCoverage = {
|
|
125
|
+
readonly known: number;
|
|
126
|
+
readonly total: number;
|
|
110
127
|
};
|
|
111
128
|
export type FrameGraphDebugSnapshotSource = {
|
|
112
129
|
readonly kind: 'live' | 'file' | 'programmatic';
|
|
@@ -128,6 +145,10 @@ export type FrameGraphDebugViewModel = {
|
|
|
128
145
|
readonly executionSegments: readonly FrameGraphDebugExecutionSegment[];
|
|
129
146
|
readonly textureViewById: ReadonlyMap<string, FrameGraphSnapshot['graph']['textureViews'][number]>;
|
|
130
147
|
readonly nodeById: ReadonlyMap<string, FrameGraphDebugNode>;
|
|
148
|
+
readonly canonicalNodeById: ReadonlyMap<string, FrameGraphSnapshot['graph']['nodes'][number]>;
|
|
149
|
+
readonly culledById: ReadonlyMap<string, FrameGraphDebugCulledNode>;
|
|
150
|
+
readonly diagnosticsByNodeId: ReadonlyMap<string, readonly FrameGraphSnapshot['diagnostics'][number][]>;
|
|
151
|
+
readonly diagnosticsByResourceId: ReadonlyMap<string, readonly FrameGraphSnapshot['diagnostics'][number][]>;
|
|
131
152
|
readonly resourceById: ReadonlyMap<string, FrameGraphDebugResource>;
|
|
132
153
|
readonly groupById: ReadonlyMap<string, FrameGraphDebugGroup>;
|
|
133
154
|
readonly groupByPathKey: ReadonlyMap<string, FrameGraphDebugGroup>;
|
|
@@ -137,6 +158,7 @@ export type FrameGraphDebugViewModel = {
|
|
|
137
158
|
readonly segmentByNodeId: ReadonlyMap<string, FrameGraphDebugExecutionSegment>;
|
|
138
159
|
readonly segmentByIndex: ReadonlyMap<number, FrameGraphDebugExecutionSegment>;
|
|
139
160
|
readonly metrics: FrameGraphDebugMetrics;
|
|
161
|
+
readonly cpuProfiling: FrameGraphSnapshot['timings']['cpu'];
|
|
140
162
|
readonly profiling: {
|
|
141
163
|
readonly status: 'available';
|
|
142
164
|
readonly frameIndex: number;
|
|
@@ -162,5 +184,7 @@ export type FrameGraphDebugViewModel = {
|
|
|
162
184
|
};
|
|
163
185
|
};
|
|
164
186
|
export declare function createDebugViewModel(snapshot: FrameGraphSnapshot, source?: FrameGraphDebugSnapshotSource): FrameGraphDebugViewModel;
|
|
187
|
+
/** Declaration boundaries are topological, not per-range initial-value provenance. */
|
|
188
|
+
export declare function declarationEntrances(nodes: readonly FrameGraphDebugNode[], accesses: readonly FrameGraphDebugAccessEdge[], edges: readonly FrameGraphDebugEdge[]): readonly FrameGraphDebugAccessEdge[];
|
|
165
189
|
export {};
|
|
166
190
|
//# sourceMappingURL=debugCaptureModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugCaptureModel.d.ts","sourceRoot":"","sources":["../src/debugCaptureModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,8BAA8B,EAC9B,gCAAgC,EA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;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"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** Semantic identity within one recording, independent of root array order. */
|
|
2
|
+
export function rootKey(root) {
|
|
3
|
+
return root.reason === 'side-effect' ? JSON.stringify([root.reason, root.nodeId])
|
|
4
|
+
: JSON.stringify([root.reason, root.resourceId, root.range?.kind === 'buffer'
|
|
5
|
+
? ['buffer', root.range.offset, root.range.size]
|
|
6
|
+
: root.range?.regions.map((r) => [r.baseMipLevel, r.mipLevelCount, r.aspect, r.baseArrayLayer, r.arrayLayerCount, r.baseDepthSlice, r.depthSliceCount]) ?? null]);
|
|
7
|
+
}
|
|
1
8
|
export function createDebugViewModel(snapshot, source = { kind: 'programmatic', label: 'Programmatic' }) {
|
|
2
9
|
const compilation = snapshot.graph;
|
|
3
10
|
const unavailable = new Set(snapshot.capture.migration?.unavailableFacts ?? []);
|
|
@@ -11,6 +18,7 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
11
18
|
? { ...source, migratedFromLegacy: true }
|
|
12
19
|
: source;
|
|
13
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]) : []);
|
|
14
22
|
const resourcePool = snapshot.memory.poolReport;
|
|
15
23
|
const normalizedGroups = normalizeDebugGroups(compilation);
|
|
16
24
|
const knownGroupIds = new Set(normalizedGroups.map((group) => group.id));
|
|
@@ -71,6 +79,7 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
71
79
|
sideEffect: node.sideEffect,
|
|
72
80
|
debugGroupId: node.groupId,
|
|
73
81
|
gpuDurationMicros: timings.get(node.id),
|
|
82
|
+
cpuDurationMicros: cpuTimings.get(node.id),
|
|
74
83
|
reads: nodeAccesses(node.id, 'read'),
|
|
75
84
|
writes: nodeAccesses(node.id, 'write'),
|
|
76
85
|
}));
|
|
@@ -79,6 +88,7 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
79
88
|
kind: resource.kind,
|
|
80
89
|
label: resource.label,
|
|
81
90
|
origin: resource.origin,
|
|
91
|
+
initialContents: resource.initialContents,
|
|
82
92
|
debugGroupId: resource.groupId,
|
|
83
93
|
usageFlags: resource.usageFlags,
|
|
84
94
|
lifetime: resource.lifetime,
|
|
@@ -91,8 +101,8 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
91
101
|
resource: resourceRef(dependency.resourceId),
|
|
92
102
|
}));
|
|
93
103
|
const roots = compilation.roots.map((root) => ({
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
...root,
|
|
105
|
+
key: rootKey(root),
|
|
96
106
|
resource: root.resourceId === undefined ? undefined : resourceRef(root.resourceId),
|
|
97
107
|
}));
|
|
98
108
|
const culledNodes = compilation.nodes
|
|
@@ -138,6 +148,19 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
138
148
|
executionSegments,
|
|
139
149
|
});
|
|
140
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
|
+
}
|
|
141
164
|
const resourceById = new Map(resources.map((resource) => [resource.id, resource]));
|
|
142
165
|
const groupById = new Map(debugGroups.map((group) => [group.id, group]));
|
|
143
166
|
const groupByPathKey = new Map(debugGroups.map((group) => [group.pathKey, group]));
|
|
@@ -154,14 +177,18 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
154
177
|
const slowestNode = timedNodes.reduce((slowest, node) => (!slowest || node.gpuDurationMicros > slowest.gpuDurationMicros ? node : slowest), undefined);
|
|
155
178
|
const transientResources = resources.filter((resource) => resource.origin === 'transient');
|
|
156
179
|
const transientEstimatedByteSize = sumKnown(transientResources.map((resource) => resource.estimatedByteSize));
|
|
157
|
-
const
|
|
180
|
+
const allocationAvailable = snapshot.memory.allocationReport.status === 'available';
|
|
181
|
+
const physicalSizes = physicalAllocations.map((allocation) => allocation.estimatedByteSize);
|
|
182
|
+
const physicalEstimatedBytes = allocationAvailable ? sumKnown(physicalSizes) : undefined;
|
|
158
183
|
const logicalAllocationSizes = transientResources
|
|
159
184
|
.filter((resource) => resource.physicalResourceId !== undefined)
|
|
160
185
|
.map((resource) => allocationById.get(resource.physicalResourceId)?.estimatedByteSize);
|
|
161
|
-
const logicalCapacityBytes = sumKnown(logicalAllocationSizes);
|
|
186
|
+
const logicalCapacityBytes = allocationAvailable ? sumKnown(logicalAllocationSizes) : undefined;
|
|
162
187
|
const metrics = {
|
|
163
188
|
timingEligibleNodeCount: timingEligibleNodes.length,
|
|
164
189
|
timedNodeCount: timedNodes.length,
|
|
190
|
+
cpuTimedNodeCount: nodes.filter(node => node.cpuDurationMicros !== undefined).length,
|
|
191
|
+
cpuWorkDurationMicros: nodes.reduce((sum, node) => sum + (node.cpuDurationMicros ?? 0), 0),
|
|
165
192
|
slowestNode,
|
|
166
193
|
transientEstimatedByteSize,
|
|
167
194
|
logicalCapacityBytes,
|
|
@@ -170,6 +197,11 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
170
197
|
? undefined
|
|
171
198
|
: Math.max(0, logicalCapacityBytes - physicalEstimatedBytes),
|
|
172
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
|
+
},
|
|
173
205
|
};
|
|
174
206
|
return {
|
|
175
207
|
protocol: snapshot,
|
|
@@ -186,6 +218,10 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
186
218
|
executionSegments,
|
|
187
219
|
textureViewById,
|
|
188
220
|
nodeById,
|
|
221
|
+
canonicalNodeById,
|
|
222
|
+
culledById,
|
|
223
|
+
diagnosticsByNodeId,
|
|
224
|
+
diagnosticsByResourceId,
|
|
189
225
|
resourceById,
|
|
190
226
|
groupById,
|
|
191
227
|
groupByPathKey,
|
|
@@ -195,6 +231,7 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
195
231
|
segmentByNodeId,
|
|
196
232
|
segmentByIndex,
|
|
197
233
|
metrics,
|
|
234
|
+
cpuProfiling: snapshot.timings.cpu,
|
|
198
235
|
profiling: gpuTiming.status === 'available'
|
|
199
236
|
? {
|
|
200
237
|
status: 'available',
|
|
@@ -215,6 +252,9 @@ export function createDebugViewModel(snapshot, source = { kind: 'programmatic',
|
|
|
215
252
|
availability,
|
|
216
253
|
};
|
|
217
254
|
}
|
|
255
|
+
function estimateCoverage(values) {
|
|
256
|
+
return { known: values.filter((value) => value !== undefined).length, total: values.length };
|
|
257
|
+
}
|
|
218
258
|
function sumKnown(values) {
|
|
219
259
|
let total = 0;
|
|
220
260
|
for (const value of values) {
|
|
@@ -287,9 +327,23 @@ function validateDebugGroupReferences(compilation, knownGroupIds) {
|
|
|
287
327
|
}
|
|
288
328
|
}
|
|
289
329
|
}
|
|
330
|
+
/** Declaration boundaries are topological, not per-range initial-value provenance. */
|
|
331
|
+
export function declarationEntrances(nodes, accesses, edges) {
|
|
332
|
+
const retained = new Set(nodes.map((node) => node.id));
|
|
333
|
+
const incoming = new Set(edges.map((edge) => JSON.stringify([edge.resource.id, edge.toNodeId])));
|
|
334
|
+
const seen = new Set();
|
|
335
|
+
return accesses.filter((access) => {
|
|
336
|
+
const key = JSON.stringify([access.resource.id, access.nodeId]);
|
|
337
|
+
if (!retained.has(access.nodeId) || incoming.has(key) || seen.has(key))
|
|
338
|
+
return false;
|
|
339
|
+
seen.add(key);
|
|
340
|
+
return true;
|
|
341
|
+
});
|
|
342
|
+
}
|
|
290
343
|
function buildDebugGroupSummaries(input) {
|
|
291
344
|
const groupsById = new Map(input.groups.map((group) => [group.id, group]));
|
|
292
345
|
const resourcesById = new Map(input.resources.map((resource) => [resource.id, resource]));
|
|
346
|
+
const entrances = declarationEntrances(input.nodes, input.accessEdges, input.edges);
|
|
293
347
|
const isInGroup = (candidateId, groupId) => (candidateId !== undefined && groupsById.get(candidateId)?.ancestorIds.includes(groupId) === true);
|
|
294
348
|
return input.groups.map((group) => {
|
|
295
349
|
const retained = input.nodes.filter((node) => isInGroup(node.debugGroupId, group.id));
|
|
@@ -310,23 +364,22 @@ function buildDebugGroupSummaries(input) {
|
|
|
310
364
|
if (fromInside && !toInside)
|
|
311
365
|
outputIds.add(edge.resource.id);
|
|
312
366
|
}
|
|
313
|
-
for (const access of
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
if (access.mode === 'read' && resource && resource.origin !== 'transient' && !hasRetainedValueProducer) {
|
|
321
|
-
inputIds.add(resource.id);
|
|
322
|
-
}
|
|
367
|
+
for (const access of entrances) {
|
|
368
|
+
const fromInside = isInGroup(resourcesById.get(access.resource.id)?.debugGroupId, group.id);
|
|
369
|
+
const toInside = retainedIds.has(access.nodeId);
|
|
370
|
+
if (!fromInside && toInside)
|
|
371
|
+
inputIds.add(access.resource.id);
|
|
372
|
+
if (fromInside && !toInside)
|
|
373
|
+
outputIds.add(access.resource.id);
|
|
323
374
|
}
|
|
375
|
+
const outputRoots = [];
|
|
324
376
|
for (const root of input.roots) {
|
|
325
377
|
if (!root.resource)
|
|
326
378
|
continue;
|
|
327
|
-
if (
|
|
328
|
-
|
|
379
|
+
if (root.resolution?.producerNodeIds.some((id) => retainedIds.has(id))
|
|
380
|
+
|| root.resolution?.usesInitialContents && isInGroup(resourcesById.get(root.resource.id)?.debugGroupId, group.id)) {
|
|
329
381
|
outputIds.add(root.resource.id);
|
|
382
|
+
outputRoots.push(root);
|
|
330
383
|
}
|
|
331
384
|
}
|
|
332
385
|
const registeredTransient = input.resources.filter((resource) => resource.origin === 'transient'
|
|
@@ -349,6 +402,7 @@ function buildDebugGroupSummaries(input) {
|
|
|
349
402
|
nodeKindCounts,
|
|
350
403
|
inputResources: [...inputIds].map((id) => resourcesById.get(id)).filter(Boolean),
|
|
351
404
|
outputResources: [...outputIds].map((id) => resourcesById.get(id)).filter(Boolean),
|
|
405
|
+
outputRoots,
|
|
352
406
|
registeredTransientResourceCount: registeredTransient.length,
|
|
353
407
|
accessedTransientResourceCount: accessedTransientIds.size,
|
|
354
408
|
physicalAllocationCount: allocationIds.size,
|
|
@@ -356,6 +410,8 @@ function buildDebugGroupSummaries(input) {
|
|
|
356
410
|
externalSubmissionCount: retained.filter((node) => node.kind === 'external-submission').length,
|
|
357
411
|
gpuWorkDurationMicros: timed.reduce((sum, node) => sum + node.gpuDurationMicros, 0),
|
|
358
412
|
timedNodeCount: timed.length,
|
|
413
|
+
cpuTimedNodeCount: retained.filter(node => node.cpuDurationMicros !== undefined).length,
|
|
414
|
+
cpuWorkDurationMicros: retained.reduce((sum, node) => sum + (node.cpuDurationMicros ?? 0), 0),
|
|
359
415
|
timingEligibleNodeCount: timingEligible.length,
|
|
360
416
|
},
|
|
361
417
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugCaptureModel.js","sourceRoot":"","sources":["../src/debugCaptureModel.ts"],"names":[],"mappings":"AAiMA,MAAM,UAAU,oBAAoB,CACnC,QAA4B,EAC5B,SAAwC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAEvF,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC;IACnC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,gBAAgB,IAAI,EAAE,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG;QACpB,MAAM,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC;QACxC,YAAY,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,oBAAoB,CAAC;QACpD,cAAc,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,4BAA4B,CAAC;QAC9D,aAAa,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,wBAAwB,CAAC;KACzD,CAAC;IACF,MAAM,cAA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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,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\tFrameGraphSnapshotRootReason,\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 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 = {\n\treadonly reason: FrameGraphSnapshotRootReason;\n\treadonly nodeId?: string;\n readonly resource?: FrameGraphDebugResourceRef;\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 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\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\treason: root.reason,\n\t\tnodeId: root.nodeId,\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\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 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 input.accessEdges) {\n\t\t\tif (!retainedIds.has(access.nodeId)) continue;\n\t\t\tconst resource = resourcesById.get(access.resource.id);\n\t\t\tconst hasRetainedValueProducer = input.edges.some((edge) => (\n\t\t\t\tedge.toNodeId === access.nodeId\n\t\t\t\t&& edge.resource.id === access.resource.id\n\t\t\t\t&& edge.kind === 'value'\n\t\t\t));\n\t\t\tif (access.mode === 'read' && resource && resource.origin !== 'transient' && !hasRetainedValueProducer) {\n\t\t\t\tinputIds.add(resource.id);\n\t\t\t}\n\t\t}\n\t\tfor (const root of input.roots) {\n\t\t\tif (!root.resource) continue;\n\t\t\tif (input.accessEdges.some((access) => retainedIds.has(access.nodeId)\n\t\t\t\t&& access.resource.id === root.resource!.id && access.mode === 'write')) {\n\t\t\t\toutputIds.add(root.resource.id);\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\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,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AAC,IAAI,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,MAAM;gBACvF,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC7F,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 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,eAAe,GAAG,eAAe,GAAG,aAAa,CAAC;IAC/F,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,CAAC,UAAU,EAAE,iCAAiC,CAAC;IACvD,QAAQ,CAAC,SAAS,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,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;
|
|
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,i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