@zenfg/inspector 0.1.0-beta.1
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/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/FrameGraphInspector.d.ts +153 -0
- package/dist/FrameGraphInspector.d.ts.map +1 -0
- package/dist/FrameGraphInspector.js +580 -0
- package/dist/FrameGraphInspector.js.map +1 -0
- package/dist/debugCaptureModel.d.ts +166 -0
- package/dist/debugCaptureModel.d.ts.map +1 -0
- package/dist/debugCaptureModel.js +364 -0
- package/dist/debugCaptureModel.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/panelAliasAnalysis.d.ts +20 -0
- package/dist/panelAliasAnalysis.d.ts.map +1 -0
- package/dist/panelAliasAnalysis.js +113 -0
- package/dist/panelAliasAnalysis.js.map +1 -0
- package/dist/panelCytoscapeGraphRenderer.d.ts +71 -0
- package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -0
- package/dist/panelCytoscapeGraphRenderer.js +559 -0
- package/dist/panelCytoscapeGraphRenderer.js.map +1 -0
- package/dist/panelDiagnosticsView.d.ts +22 -0
- package/dist/panelDiagnosticsView.d.ts.map +1 -0
- package/dist/panelDiagnosticsView.js +123 -0
- package/dist/panelDiagnosticsView.js.map +1 -0
- package/dist/panelDomHelpers.d.ts +26 -0
- package/dist/panelDomHelpers.d.ts.map +1 -0
- package/dist/panelDomHelpers.js +129 -0
- package/dist/panelDomHelpers.js.map +1 -0
- package/dist/panelGraphLayout.d.ts +28 -0
- package/dist/panelGraphLayout.d.ts.map +1 -0
- package/dist/panelGraphLayout.js +223 -0
- package/dist/panelGraphLayout.js.map +1 -0
- package/dist/panelGraphRenderer.d.ts +20 -0
- package/dist/panelGraphRenderer.d.ts.map +1 -0
- package/dist/panelGraphRenderer.js +2 -0
- package/dist/panelGraphRenderer.js.map +1 -0
- package/dist/panelGraphScene.d.ts +98 -0
- package/dist/panelGraphScene.d.ts.map +1 -0
- package/dist/panelGraphScene.js +559 -0
- package/dist/panelGraphScene.js.map +1 -0
- package/dist/panelGraphView.d.ts +9 -0
- package/dist/panelGraphView.d.ts.map +1 -0
- package/dist/panelGraphView.js +88 -0
- package/dist/panelGraphView.js.map +1 -0
- package/dist/panelGraphVisuals.d.ts +38 -0
- package/dist/panelGraphVisuals.d.ts.map +1 -0
- package/dist/panelGraphVisuals.js +330 -0
- package/dist/panelGraphVisuals.js.map +1 -0
- package/dist/panelIcons.d.ts +4 -0
- package/dist/panelIcons.d.ts.map +1 -0
- package/dist/panelIcons.js +43 -0
- package/dist/panelIcons.js.map +1 -0
- package/dist/panelInspectorView.d.ts +33 -0
- package/dist/panelInspectorView.d.ts.map +1 -0
- package/dist/panelInspectorView.js +357 -0
- package/dist/panelInspectorView.js.map +1 -0
- package/dist/panelMemoryView.d.ts +21 -0
- package/dist/panelMemoryView.d.ts.map +1 -0
- package/dist/panelMemoryView.js +134 -0
- package/dist/panelMemoryView.js.map +1 -0
- package/dist/panelPassesView.d.ts +31 -0
- package/dist/panelPassesView.d.ts.map +1 -0
- package/dist/panelPassesView.js +183 -0
- package/dist/panelPassesView.js.map +1 -0
- package/dist/panelResourcesView.d.ts +19 -0
- package/dist/panelResourcesView.d.ts.map +1 -0
- package/dist/panelResourcesView.js +89 -0
- package/dist/panelResourcesView.js.map +1 -0
- package/dist/panelSelection.d.ts +5 -0
- package/dist/panelSelection.d.ts.map +1 -0
- package/dist/panelSelection.js +88 -0
- package/dist/panelSelection.js.map +1 -0
- package/dist/panelTypes.d.ts +40 -0
- package/dist/panelTypes.d.ts.map +1 -0
- package/dist/panelTypes.js +2 -0
- package/dist/panelTypes.js.map +1 -0
- package/dist/panelVisualTheme.d.ts +76 -0
- package/dist/panelVisualTheme.d.ts.map +1 -0
- package/dist/panelVisualTheme.js +39 -0
- package/dist/panelVisualTheme.js.map +1 -0
- package/dist/panelWorkbenchHelpers.d.ts +34 -0
- package/dist/panelWorkbenchHelpers.d.ts.map +1 -0
- package/dist/panelWorkbenchHelpers.js +162 -0
- package/dist/panelWorkbenchHelpers.js.map +1 -0
- package/dist/panelWorkbenchView.d.ts +77 -0
- package/dist/panelWorkbenchView.d.ts.map +1 -0
- package/dist/panelWorkbenchView.js +409 -0
- package/dist/panelWorkbenchView.js.map +1 -0
- package/dist/query.d.ts +11 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +21 -0
- package/dist/query.js.map +1 -0
- package/dist/styles.d.ts +8 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +1073 -0
- package/dist/styles.js.map +1 -0
- package/package.json +29 -0
- package/src/FrameGraphInspector.ts +632 -0
- package/src/debugCaptureModel.ts +583 -0
- package/src/index.ts +21 -0
- package/src/panelAliasAnalysis.ts +164 -0
- package/src/panelCytoscapeGraphRenderer.ts +617 -0
- package/src/panelDiagnosticsView.ts +160 -0
- package/src/panelDomHelpers.ts +151 -0
- package/src/panelGraphLayout.ts +281 -0
- package/src/panelGraphRenderer.ts +21 -0
- package/src/panelGraphScene.ts +787 -0
- package/src/panelGraphView.ts +108 -0
- package/src/panelGraphVisuals.ts +364 -0
- package/src/panelIcons.ts +56 -0
- package/src/panelInspectorView.ts +377 -0
- package/src/panelMemoryView.ts +154 -0
- package/src/panelPassesView.ts +222 -0
- package/src/panelResourcesView.ts +115 -0
- package/src/panelSelection.ts +99 -0
- package/src/panelTypes.ts +28 -0
- package/src/panelVisualTheme.ts +39 -0
- package/src/panelWorkbenchHelpers.ts +216 -0
- package/src/panelWorkbenchView.ts +465 -0
- package/src/query.ts +22 -0
- package/src/styles.ts +1076 -0
|
@@ -0,0 +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,cA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AC","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"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a host-sized interactive workbench for live or imported ZenFG
|
|
3
|
+
* FrameGraph Snapshot documents. The same component supports full-page and
|
|
4
|
+
* embedded layouts.
|
|
5
|
+
*
|
|
6
|
+
* {@link mountFrameGraphInspector} appends the inspector to a host element and
|
|
7
|
+
* returns its lifecycle controller. Call {@link FrameGraphInspector.destroy}
|
|
8
|
+
* before discarding the host or replacing the inspector.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
export type { FrameGraphSnapshot, FrameGraphSnapshotDecodeResult, FrameGraphSnapshotIssue, } from '@zenfg/snapshot';
|
|
13
|
+
export { FrameGraphInspector, mountFrameGraphInspector } from './FrameGraphInspector.ts';
|
|
14
|
+
export type { FrameGraphInspectorOptions } from './FrameGraphInspector.ts';
|
|
15
|
+
export { ZENFG_INSPECTOR_QUERY_PARAM, isZenFGInspectorRequested } from './query.ts';
|
|
16
|
+
export { ensureFrameGraphInspectorStyles } from './styles.ts';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a host-sized interactive workbench for live or imported ZenFG
|
|
3
|
+
* FrameGraph Snapshot documents. The same component supports full-page and
|
|
4
|
+
* embedded layouts.
|
|
5
|
+
*
|
|
6
|
+
* {@link mountFrameGraphInspector} appends the inspector to a host element and
|
|
7
|
+
* returns its lifecycle controller. Call {@link FrameGraphInspector.destroy}
|
|
8
|
+
* before discarding the host or replacing the inspector.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
export { FrameGraphInspector, mountFrameGraphInspector } from "./FrameGraphInspector.js";
|
|
13
|
+
export { ZENFG_INSPECTOR_QUERY_PARAM, isZenFGInspectorRequested } from "./query.js";
|
|
14
|
+
export { ensureFrameGraphInspectorStyles } from "./styles.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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';\r\nexport { ensureFrameGraphInspectorStyles } from './styles.ts';\r\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FrameGraphDebugPhysicalAllocation, FrameGraphDebugResource, FrameGraphDebugViewModel } from './debugCaptureModel.ts';
|
|
2
|
+
export type AliasAnalysisResource = {
|
|
3
|
+
readonly resource: FrameGraphDebugResource;
|
|
4
|
+
readonly allocation?: FrameGraphDebugPhysicalAllocation;
|
|
5
|
+
readonly aliasStatus: 'aliased' | 'single' | 'not-transient' | 'not-allocated' | 'no-lifetime';
|
|
6
|
+
readonly nonAliasReasons: readonly string[];
|
|
7
|
+
};
|
|
8
|
+
export type AliasAnalysisAllocation = {
|
|
9
|
+
readonly allocation: FrameGraphDebugPhysicalAllocation;
|
|
10
|
+
readonly resources: readonly FrameGraphDebugResource[];
|
|
11
|
+
readonly aliases: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type AliasAnalysis = {
|
|
14
|
+
readonly allocations: readonly AliasAnalysisAllocation[];
|
|
15
|
+
readonly resources: ReadonlyMap<string, AliasAnalysisResource>;
|
|
16
|
+
readonly minUse: number;
|
|
17
|
+
readonly maxUse: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function analyzeSnapshotAliases(snapshot: FrameGraphDebugViewModel): AliasAnalysis;
|
|
20
|
+
//# sourceMappingURL=panelAliasAnalysis.d.ts.map
|
|
@@ -0,0 +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;CAC3B,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,aAAa,CAmDxF"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export function analyzeSnapshotAliases(snapshot) {
|
|
2
|
+
const allocationById = snapshot.allocationById;
|
|
3
|
+
const resourcesById = snapshot.resourceById;
|
|
4
|
+
const allocationGroups = snapshot.physicalAllocations.map((allocation) => {
|
|
5
|
+
const resources = allocation.resourceIds
|
|
6
|
+
.map((resourceId) => resourcesById.get(resourceId))
|
|
7
|
+
.filter((resource) => resource !== undefined);
|
|
8
|
+
return {
|
|
9
|
+
allocation,
|
|
10
|
+
resources,
|
|
11
|
+
aliases: resources.length > 1,
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
const allocationGroupById = new Map(allocationGroups.map((group) => [group.allocation.id, group]));
|
|
15
|
+
let minUse = Number.POSITIVE_INFINITY;
|
|
16
|
+
let maxUse = Number.NEGATIVE_INFINITY;
|
|
17
|
+
for (const resource of snapshot.resources) {
|
|
18
|
+
if (!resource.lifetime) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
minUse = Math.min(minUse, resource.lifetime.firstUse);
|
|
22
|
+
maxUse = Math.max(maxUse, resource.lifetime.lastUse);
|
|
23
|
+
}
|
|
24
|
+
if (!Number.isFinite(minUse) || !Number.isFinite(maxUse)) {
|
|
25
|
+
minUse = 0;
|
|
26
|
+
maxUse = 0;
|
|
27
|
+
}
|
|
28
|
+
const resourceAnalysis = new Map();
|
|
29
|
+
for (const resource of snapshot.resources) {
|
|
30
|
+
const allocation = resource.physicalResourceId === undefined ? undefined : allocationById.get(resource.physicalResourceId);
|
|
31
|
+
const allocationResources = allocation
|
|
32
|
+
? allocationGroupById.get(allocation.id)?.resources ?? []
|
|
33
|
+
: [];
|
|
34
|
+
const aliasStatus = resolveAliasStatus(resource, allocation, allocationResources);
|
|
35
|
+
resourceAnalysis.set(resource.id, {
|
|
36
|
+
resource,
|
|
37
|
+
allocation,
|
|
38
|
+
aliasStatus,
|
|
39
|
+
nonAliasReasons: resolveNonAliasReasons(resource, allocation, allocationGroups),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
allocations: allocationGroups,
|
|
44
|
+
resources: resourceAnalysis,
|
|
45
|
+
minUse,
|
|
46
|
+
maxUse,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function resolveAliasStatus(resource, allocation, allocationResources) {
|
|
50
|
+
if (resource.origin !== 'transient') {
|
|
51
|
+
return 'not-transient';
|
|
52
|
+
}
|
|
53
|
+
if (!resource.lifetime) {
|
|
54
|
+
return 'no-lifetime';
|
|
55
|
+
}
|
|
56
|
+
if (!allocation) {
|
|
57
|
+
return 'not-allocated';
|
|
58
|
+
}
|
|
59
|
+
return allocationResources.length > 1 ? 'aliased' : 'single';
|
|
60
|
+
}
|
|
61
|
+
function resolveNonAliasReasons(resource, allocation, allocations) {
|
|
62
|
+
if (resource.origin !== 'transient') {
|
|
63
|
+
return ['Imported or swapchain resources do not participate in transient aliasing.'];
|
|
64
|
+
}
|
|
65
|
+
if (!resource.lifetime) {
|
|
66
|
+
return ['No lifetime is available for this resource in the retained graph.'];
|
|
67
|
+
}
|
|
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
|
+
}
|
|
113
|
+
//# sourceMappingURL=panelAliasAnalysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelAliasAnalysis.js","sourceRoot":"","sources":["../src/panelAliasAnalysis.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,sBAAsB,CAAC,QAAkC;IACrE,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,EAA2B,EAAE;QAC9F,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW;aACnC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;aAClD,MAAM,CAAC,CAAC,QAAQ,EAAuC,EAAE,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;QACvF,OAAO;YACH,UAAU;YACV,SAAS;YACT,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC;SAChC,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnG,IAAI,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACtC,IAAI,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACtC,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACrB,SAAS;QACb,CAAC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AAI,EAAE,CAAC;AAC9F,CAAC;AAED,SAAS,gBAAgB,CACrB,CAAmD,EACnD,CAAmD;IAEnD,OAAO,CAAC,CAAC,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"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type cytoscape from 'cytoscape';
|
|
2
|
+
import type { ELK } from 'elkjs/lib/elk-api';
|
|
3
|
+
import type { GraphRenderer, GraphRenderRequest } from './panelGraphRenderer.ts';
|
|
4
|
+
import { type GraphLayoutResult } from './panelGraphLayout.ts';
|
|
5
|
+
import { type GraphScene } from './panelGraphScene.ts';
|
|
6
|
+
type GraphRendererRuntime = {
|
|
7
|
+
readonly createCore: (options: cytoscape.CytoscapeOptions) => cytoscape.Core;
|
|
8
|
+
readonly elk: ELK;
|
|
9
|
+
};
|
|
10
|
+
export type GraphResizeSubscription = {
|
|
11
|
+
disconnect(): void;
|
|
12
|
+
};
|
|
13
|
+
export type GraphRendererEnvironment = {
|
|
14
|
+
readonly createElement: (tagName: string) => HTMLElement;
|
|
15
|
+
readonly loadRuntime: () => Promise<GraphRendererRuntime>;
|
|
16
|
+
readonly layoutScene: (elk: ELK, scene: GraphScene) => Promise<GraphLayoutResult>;
|
|
17
|
+
readonly observeResize?: (element: HTMLElement, onResize: () => void) => GraphResizeSubscription;
|
|
18
|
+
};
|
|
19
|
+
export declare class CytoscapeGraphRenderer implements GraphRenderer {
|
|
20
|
+
private readonly host;
|
|
21
|
+
private readonly environment;
|
|
22
|
+
private readonly canvasHost;
|
|
23
|
+
private readonly tooltip;
|
|
24
|
+
private readonly status;
|
|
25
|
+
private readonly statusMessage;
|
|
26
|
+
private readonly retryButton;
|
|
27
|
+
private readonly resizeSubscription;
|
|
28
|
+
private core;
|
|
29
|
+
private elk;
|
|
30
|
+
private loading;
|
|
31
|
+
private processing;
|
|
32
|
+
private latestRequest;
|
|
33
|
+
private appliedScene;
|
|
34
|
+
private requestVersion;
|
|
35
|
+
private processedVersion;
|
|
36
|
+
private destroyed;
|
|
37
|
+
private fitTargetContentKey;
|
|
38
|
+
private forceRelayout;
|
|
39
|
+
private anchorElementId;
|
|
40
|
+
private anchorTargetContentKey;
|
|
41
|
+
private failedSceneContentKey;
|
|
42
|
+
private overview;
|
|
43
|
+
private lastTap;
|
|
44
|
+
constructor(host: HTMLElement, environment?: GraphRendererEnvironment);
|
|
45
|
+
render(request: GraphRenderRequest): void;
|
|
46
|
+
resize(): void;
|
|
47
|
+
fit(): void;
|
|
48
|
+
relayout(): void;
|
|
49
|
+
destroy(): void;
|
|
50
|
+
private scheduleProcessing;
|
|
51
|
+
private processRequests;
|
|
52
|
+
private ensureRuntime;
|
|
53
|
+
private loadRuntime;
|
|
54
|
+
private bindEvents;
|
|
55
|
+
private interactiveRequest;
|
|
56
|
+
private syncInteraction;
|
|
57
|
+
private consumeFitIfCurrentTarget;
|
|
58
|
+
private consumeAnchorIfCurrentTarget;
|
|
59
|
+
private targetNeedsApply;
|
|
60
|
+
private updateSemanticZoom;
|
|
61
|
+
private positionTooltip;
|
|
62
|
+
private hideTooltip;
|
|
63
|
+
private showStatus;
|
|
64
|
+
private hideStatus;
|
|
65
|
+
private resolveCurrentRequest;
|
|
66
|
+
}
|
|
67
|
+
export declare function updateElementData(core: cytoscape.Core, scene: GraphScene): void;
|
|
68
|
+
export { createCytoscapeEdgeRouteData, createElkLayoutGraph, layoutGraphScene, } from './panelGraphLayout.ts';
|
|
69
|
+
export type { CytoscapeEdgeRouteData, GraphEdgeRoute, GraphLayoutResult, GraphPosition, } from './panelGraphLayout.ts';
|
|
70
|
+
export { createGraphStyles, expandedGroupLabelMaxWidth, graphEdgeDisplayLabel, graphLayoutGeometryKey, isOverviewGraphScale, } from './panelGraphVisuals.ts';
|
|
71
|
+
//# sourceMappingURL=panelCytoscapeGraphRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelCytoscapeGraphRenderer.d.ts","sourceRoot":"","sources":["../src/panelCytoscapeGraphRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAIH,KAAK,iBAAiB,EAEzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEH,KAAK,UAAU,EAIlB,MAAM,sBAAsB,CAAC;AAa9B,KAAK,oBAAoB,GAAG;IACxB,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,gBAAgB,KAAK,SAAS,CAAC,IAAI,CAAC;IAC7E,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAAE,UAAU,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