@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.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/dist/FrameGraphInspector.d.ts +153 -0
  4. package/dist/FrameGraphInspector.d.ts.map +1 -0
  5. package/dist/FrameGraphInspector.js +580 -0
  6. package/dist/FrameGraphInspector.js.map +1 -0
  7. package/dist/debugCaptureModel.d.ts +166 -0
  8. package/dist/debugCaptureModel.d.ts.map +1 -0
  9. package/dist/debugCaptureModel.js +364 -0
  10. package/dist/debugCaptureModel.js.map +1 -0
  11. package/dist/index.d.ts +17 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +15 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/panelAliasAnalysis.d.ts +20 -0
  16. package/dist/panelAliasAnalysis.d.ts.map +1 -0
  17. package/dist/panelAliasAnalysis.js +113 -0
  18. package/dist/panelAliasAnalysis.js.map +1 -0
  19. package/dist/panelCytoscapeGraphRenderer.d.ts +71 -0
  20. package/dist/panelCytoscapeGraphRenderer.d.ts.map +1 -0
  21. package/dist/panelCytoscapeGraphRenderer.js +559 -0
  22. package/dist/panelCytoscapeGraphRenderer.js.map +1 -0
  23. package/dist/panelDiagnosticsView.d.ts +22 -0
  24. package/dist/panelDiagnosticsView.d.ts.map +1 -0
  25. package/dist/panelDiagnosticsView.js +123 -0
  26. package/dist/panelDiagnosticsView.js.map +1 -0
  27. package/dist/panelDomHelpers.d.ts +26 -0
  28. package/dist/panelDomHelpers.d.ts.map +1 -0
  29. package/dist/panelDomHelpers.js +129 -0
  30. package/dist/panelDomHelpers.js.map +1 -0
  31. package/dist/panelGraphLayout.d.ts +28 -0
  32. package/dist/panelGraphLayout.d.ts.map +1 -0
  33. package/dist/panelGraphLayout.js +223 -0
  34. package/dist/panelGraphLayout.js.map +1 -0
  35. package/dist/panelGraphRenderer.d.ts +20 -0
  36. package/dist/panelGraphRenderer.d.ts.map +1 -0
  37. package/dist/panelGraphRenderer.js +2 -0
  38. package/dist/panelGraphRenderer.js.map +1 -0
  39. package/dist/panelGraphScene.d.ts +98 -0
  40. package/dist/panelGraphScene.d.ts.map +1 -0
  41. package/dist/panelGraphScene.js +559 -0
  42. package/dist/panelGraphScene.js.map +1 -0
  43. package/dist/panelGraphView.d.ts +9 -0
  44. package/dist/panelGraphView.d.ts.map +1 -0
  45. package/dist/panelGraphView.js +88 -0
  46. package/dist/panelGraphView.js.map +1 -0
  47. package/dist/panelGraphVisuals.d.ts +38 -0
  48. package/dist/panelGraphVisuals.d.ts.map +1 -0
  49. package/dist/panelGraphVisuals.js +330 -0
  50. package/dist/panelGraphVisuals.js.map +1 -0
  51. package/dist/panelIcons.d.ts +4 -0
  52. package/dist/panelIcons.d.ts.map +1 -0
  53. package/dist/panelIcons.js +43 -0
  54. package/dist/panelIcons.js.map +1 -0
  55. package/dist/panelInspectorView.d.ts +33 -0
  56. package/dist/panelInspectorView.d.ts.map +1 -0
  57. package/dist/panelInspectorView.js +357 -0
  58. package/dist/panelInspectorView.js.map +1 -0
  59. package/dist/panelMemoryView.d.ts +21 -0
  60. package/dist/panelMemoryView.d.ts.map +1 -0
  61. package/dist/panelMemoryView.js +134 -0
  62. package/dist/panelMemoryView.js.map +1 -0
  63. package/dist/panelPassesView.d.ts +31 -0
  64. package/dist/panelPassesView.d.ts.map +1 -0
  65. package/dist/panelPassesView.js +183 -0
  66. package/dist/panelPassesView.js.map +1 -0
  67. package/dist/panelResourcesView.d.ts +19 -0
  68. package/dist/panelResourcesView.d.ts.map +1 -0
  69. package/dist/panelResourcesView.js +89 -0
  70. package/dist/panelResourcesView.js.map +1 -0
  71. package/dist/panelSelection.d.ts +5 -0
  72. package/dist/panelSelection.d.ts.map +1 -0
  73. package/dist/panelSelection.js +88 -0
  74. package/dist/panelSelection.js.map +1 -0
  75. package/dist/panelTypes.d.ts +40 -0
  76. package/dist/panelTypes.d.ts.map +1 -0
  77. package/dist/panelTypes.js +2 -0
  78. package/dist/panelTypes.js.map +1 -0
  79. package/dist/panelVisualTheme.d.ts +76 -0
  80. package/dist/panelVisualTheme.d.ts.map +1 -0
  81. package/dist/panelVisualTheme.js +39 -0
  82. package/dist/panelVisualTheme.js.map +1 -0
  83. package/dist/panelWorkbenchHelpers.d.ts +34 -0
  84. package/dist/panelWorkbenchHelpers.d.ts.map +1 -0
  85. package/dist/panelWorkbenchHelpers.js +162 -0
  86. package/dist/panelWorkbenchHelpers.js.map +1 -0
  87. package/dist/panelWorkbenchView.d.ts +77 -0
  88. package/dist/panelWorkbenchView.d.ts.map +1 -0
  89. package/dist/panelWorkbenchView.js +409 -0
  90. package/dist/panelWorkbenchView.js.map +1 -0
  91. package/dist/query.d.ts +11 -0
  92. package/dist/query.d.ts.map +1 -0
  93. package/dist/query.js +21 -0
  94. package/dist/query.js.map +1 -0
  95. package/dist/styles.d.ts +8 -0
  96. package/dist/styles.d.ts.map +1 -0
  97. package/dist/styles.js +1073 -0
  98. package/dist/styles.js.map +1 -0
  99. package/package.json +29 -0
  100. package/src/FrameGraphInspector.ts +632 -0
  101. package/src/debugCaptureModel.ts +583 -0
  102. package/src/index.ts +21 -0
  103. package/src/panelAliasAnalysis.ts +164 -0
  104. package/src/panelCytoscapeGraphRenderer.ts +617 -0
  105. package/src/panelDiagnosticsView.ts +160 -0
  106. package/src/panelDomHelpers.ts +151 -0
  107. package/src/panelGraphLayout.ts +281 -0
  108. package/src/panelGraphRenderer.ts +21 -0
  109. package/src/panelGraphScene.ts +787 -0
  110. package/src/panelGraphView.ts +108 -0
  111. package/src/panelGraphVisuals.ts +364 -0
  112. package/src/panelIcons.ts +56 -0
  113. package/src/panelInspectorView.ts +377 -0
  114. package/src/panelMemoryView.ts +154 -0
  115. package/src/panelPassesView.ts +222 -0
  116. package/src/panelResourcesView.ts +115 -0
  117. package/src/panelSelection.ts +99 -0
  118. package/src/panelTypes.ts +28 -0
  119. package/src/panelVisualTheme.ts +39 -0
  120. package/src/panelWorkbenchHelpers.ts +216 -0
  121. package/src/panelWorkbenchView.ts +465 -0
  122. package/src/query.ts +22 -0
  123. package/src/styles.ts +1076 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrameGraphInspector.js","sourceRoot":"","sources":["../src/FrameGraphInspector.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iCAAiC,EACjC,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,GAE3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,oBAAoB,GAGpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,YAAY,EACZ,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AA8BnE,MAAM,wBAAwB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAClD,MAAM,0BAA0B,GAAG,KAAK,CAAC;AACzC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,mBAAmB;IAC/B,qDAAqD;IAC5C,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAEhC,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACxC,WAAW,GAAG,QAAQ,CA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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,UAAU,CAAC,KAAgB;IACnC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC;AAED,IAAI,eAAe,GAAG,CAAC,CAAC;AACxB,SAAS,iBAAiB;IACzB,eAAe,IAAI,CAAC,CAAC;IACrB,OAAO,mBAAmB,eAAe,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import {\n\tFrameGraphSnapshotValidationError,\n\tdecodeFrameGraphSnapshot,\n\tparseFrameGraphSnapshot,\n\tstringifyFrameGraphSnapshot,\n\ttype FrameGraphSnapshot,\n} from '@zenfg/snapshot';\nimport {\n\tcreateDebugViewModel,\n\ttype FrameGraphDebugSnapshotSource,\n\ttype FrameGraphDebugViewModel,\n} from './debugCaptureModel.ts';\nimport { createToolbarButton } from './panelDomHelpers.ts';\nimport { createPanelIcon } from './panelIcons.ts';\nimport {\n\tdestroyGraph,\n\tfitGraph,\n} from './panelGraphView.ts';\nimport { graphGroupElementId } from './panelGraphScene.ts';\nimport { selectionExists } from './panelSelection.ts';\nimport type { GraphViewState, Selection } from './panelTypes.ts';\nimport { ensureFrameGraphInspectorStyles } from './styles.ts';\nimport { sameSelection, type WorkbenchCallbacks } from './panelWorkbenchHelpers.ts';\nimport { FrameGraphDebugWorkbench } from './panelWorkbenchView.ts';\n\n/** Construction and safety limits for an embedded {@link FrameGraphInspector}. */\nexport type FrameGraphInspectorOptions = {\n\t/**\n\t * Product label shown in the workbench command bar. Pass `false` to hide\n\t * visible branding while retaining the inspector's accessible name.\n\t *\n\t * @defaultValue `\"ZenFG Inspector\"`\n\t */\n\tbranding?: string | false;\n\t/**\n\t * Produces a live snapshot when capture is requested. The inspector awaits\n\t * promises and displays thrown or rejected errors in its status area.\n\t */\n\tcaptureSnapshot?: () => FrameGraphSnapshot | undefined | Promise<FrameGraphSnapshot | undefined>;\n\t/**\n\t * Maximum accepted import size in bytes.\n\t *\n\t * @defaultValue `67108864` (64 MiB)\n\t */\n\tmaxImportBytes?: number;\n\t/**\n\t * Maximum graph nodes plus edges accepted by automatic layout.\n\t *\n\t * @defaultValue `5000`\n\t */\n\tmaxGraphElements?: number;\n};\n\nconst DEFAULT_MAX_IMPORT_BYTES = 64 * 1024 * 1024;\nconst DEFAULT_MAX_GRAPH_ELEMENTS = 5_000;\nconst DEFAULT_BRANDING = 'ZenFG Inspector';\n\n/**\n * Browser lifecycle controller for one embeddable FrameGraph inspector.\n *\n * @remarks The constructor creates, but does not append, {@link dom}. Use\n * {@link mountFrameGraphInspector} for the common append-and-return workflow.\n * Async capture, import, and clipboard failures are reported in the UI. Call\n * {@link destroy} when the controller is no longer needed.\n *\n * @example\n * ```ts\n * const inspector = new FrameGraphInspector({ captureSnapshot: capture });\n * document.body.append(inspector.dom);\n * // Later:\n * inspector.destroy();\n * ```\n */\nexport class FrameGraphInspector {\n\t/** Root element owned by this inspector instance. */\n\treadonly dom = document.createElement('section');\n\n\tprivate readonly body = document.createElement('div');\n\tprivate readonly content = document.createElement('div');\n\tprivate readonly dropOverlay = document.createElement('div');\n\tprivate readonly passesGraphModeButton: HTMLButtonElement;\n\tprivate readonly resourcesGraphModeButton: HTMLButtonElement;\n\tprivate readonly groupsButton: HTMLButtonElement;\n\tprivate readonly collapseGroupsButton: HTMLButtonElement;\n\tprivate readonly graphView: GraphViewState;\n\tprivate readonly workbench: FrameGraphDebugWorkbench;\n\tprivate captureSnapshotCallback: FrameGraphInspectorOptions['captureSnapshot'];\n\tprivate protocolSnapshot: FrameGraphSnapshot | undefined;\n\tprivate operationRevision = 0;\n\tprivate viewModel: FrameGraphDebugViewModel | undefined;\n\tprivate selected: Selection | undefined;\n\tprivate hovered: Selection | undefined;\n\tprivate capturing = false;\n\tprivate importing = false;\n\tprivate copying = false;\n\tprivate copied = false;\n\tprivate initialAutoCaptureAttempted = false;\n\tprivate statusMessage: string | undefined;\n\tprivate statusTone: 'neutral' | 'error' = 'neutral';\n\tprivate destroyed = false;\n\tprivate copyFeedbackTimeout: number | undefined;\n\tprivate readonly maxImportBytes: number;\n\tprivate dragDepth = 0;\n\tprivate readonly handleDragEnter = (event: DragEvent): void => {\n\t\tif (!isFileDrag(event)) return;\n\t\tevent.preventDefault();\n\t\tthis.dragDepth += 1;\n\t\tthis.setDropActive(true);\n\t};\n\tprivate readonly handleDragOver = (event: DragEvent): void => {\n\t\tif (!isFileDrag(event)) return;\n\t\tevent.preventDefault();\n\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';\n\t\tthis.setDropActive(true);\n\t};\n\tprivate readonly handleDragLeave = (event: DragEvent): void => {\n\t\tif (!isFileDrag(event) && this.dragDepth === 0) return;\n\t\tthis.dragDepth = Math.max(0, this.dragDepth - 1);\n\t\tif (this.dragDepth === 0) this.setDropActive(false);\n\t};\n\tprivate readonly handleDragEnd = (): void => this.clearDropState();\n\tprivate readonly handleDrop = (event: DragEvent): void => {\n\t\tconst file = event.dataTransfer?.files?.[0];\n\t\tif (!file) return;\n\t\tevent.preventDefault();\n\t\tthis.clearDropState();\n\t\tvoid this.importSnapshot(file);\n\t};\n\n\t/**\n\t * Creates a detached inspector UI.\n\t *\n\t * @throws If a configured numeric limit is not a non-negative safe integer,\n\t * or if browser DOM globals are unavailable.\n\t */\n\tconstructor(options: FrameGraphInspectorOptions = {}) {\n\t\tensureFrameGraphInspectorStyles();\n\t\tthis.captureSnapshotCallback = options.captureSnapshot;\n\t\tthis.maxImportBytes = normalizeMaxImportBytes(options.maxImportBytes);\n\t\tconst branding = options.branding ?? DEFAULT_BRANDING;\n\t\tthis.dom.className = 'zenfg-inspector';\n\t\tthis.dom.id = createInspectorId();\n\t\tthis.dom.setAttribute('role', 'region');\n\t\tthis.dom.setAttribute('aria-label', branding === false ? DEFAULT_BRANDING : branding);\n\t\tthis.body.className = 'zenfg-inspector-body';\n\t\tthis.content.className = 'zenfg-inspector-content';\n\t\tthis.dropOverlay.className = 'zenfg-inspector-drop-overlay';\n\t\tthis.dropOverlay.hidden = true;\n\t\tthis.dropOverlay.setAttribute('aria-hidden', 'true');\n\t\tconst dropTitle = document.createElement('strong');\n\t\tdropTitle.textContent = 'Drop snapshot to open';\n\t\tconst dropDetail = document.createElement('span');\n\t\tdropDetail.textContent = 'The first file will be imported locally.';\n\t\tthis.dropOverlay.append(dropTitle, dropDetail);\n\n\t\tconst graphLegend = document.createElement('div');\n\t\tgraphLegend.className = 'zenfg-inspector-graph-legend';\n\t\tgraphLegend.setAttribute('aria-label', 'Graph legend');\n\t\tthis.graphView = {\n\t\t\thost: document.createElement('div'),\n\t\t\ttoolbar: document.createElement('div'),\n\t\t\tlegend: graphLegend,\n\t\t\tlayoutElementBudget: normalizeLimit(options.maxGraphElements, DEFAULT_MAX_GRAPH_ELEMENTS, 'maxGraphElements'),\n\t\t\tgraphMode: 'passes',\n\t\t\tgroupsEnabled: true,\n\t\t\texpandedGroupPaths: new Set(),\n\t\t\tfitOnNextRender: true,\n\t\t};\n\t\tthis.graphView.host.className = 'zenfg-inspector-graph';\n\t\tthis.graphView.toolbar.className = 'zenfg-inspector-graph-toolbar';\n\t\tthis.graphView.toolbar.setAttribute('role', 'toolbar');\n\t\tthis.graphView.toolbar.setAttribute('aria-label', 'Frame graph view controls');\n\n\t\tthis.passesGraphModeButton = createToolbarButton('Pass dependency', 'Show pass dependency graph', () => this.setGraphMode('passes'));\n\t\tthis.resourcesGraphModeButton = createToolbarButton('Resource access', 'Show resource access graph', () => this.setGraphMode('resources'));\n\t\tthis.groupsButton = createToolbarButton('Groups', 'Toggle diagnostic group projection', () => this.toggleGroups());\n\t\tthis.collapseGroupsButton = createToolbarButton('Collapse All', 'Collapse every diagnostic group', () => this.collapseAllGroups());\n\t\tthis.passesGraphModeButton.classList.add('zenfg-inspector-mode-button');\n\t\tthis.resourcesGraphModeButton.classList.add('zenfg-inspector-mode-button');\n\n\t\tconst modeControls = document.createElement('div');\n\t\tmodeControls.className = 'zenfg-inspector-graph-mode-controls';\n\t\tmodeControls.setAttribute('role', 'group');\n\t\tmodeControls.setAttribute('aria-label', 'Graph mode');\n\t\tmodeControls.append(this.passesGraphModeButton, this.resourcesGraphModeButton);\n\t\tconst actionControls = document.createElement('div');\n\t\tactionControls.className = 'zenfg-inspector-graph-action-controls';\n\t\tactionControls.append(\n\t\t\tthis.groupsButton,\n\t\t\tthis.collapseGroupsButton,\n\t\t\tcreateGraphIconButton('fit', 'Fit graph to view', () => fitGraph(this.graphView)),\n\t\t);\n\t\tthis.graphView.toolbar.append(modeControls, graphLegend, actionControls);\n\n\t\tconst callbacks: WorkbenchCallbacks = {\n\t\t\tonSelect: (selection) => this.handleSelect(selection),\n\t\t\tonHover: (selection) => this.handleHover(selection),\n\t\t\tonGroupToggle: (pathKey) => this.toggleGroup(pathKey),\n\t\t\tisGroupExpanded: (pathKey) => this.graphView.expandedGroupPaths.has(pathKey),\n\t\t};\n\t\tthis.workbench = new FrameGraphDebugWorkbench(this.graphView, callbacks, {\n\t\t\tonCapture: () => { void this.captureSnapshot(); },\n\t\t\tonImport: (file) => { void this.importSnapshot(file); },\n\t\t\tonDownload: () => this.downloadSnapshot(),\n\t\t\tonCopyJson: () => { void this.copySnapshotJson(); },\n\t\t}, {\n\t\t\tbranding,\n\t\t\tidPrefix: this.dom.id,\n\t\t});\n\t\tthis.content.append(this.workbench.root);\n\t\tthis.body.appendChild(this.content);\n\t\tthis.dom.append(this.body, this.dropOverlay);\n\t\tthis.dom.addEventListener('dragenter', this.handleDragEnter);\n\t\tthis.dom.addEventListener('dragover', this.handleDragOver);\n\t\tthis.dom.addEventListener('dragleave', this.handleDragLeave);\n\t\tthis.dom.addEventListener('dragend', this.handleDragEnd);\n\t\tthis.dom.addEventListener('drop', this.handleDrop);\n\t\tthis.updateCaptureActions();\n\t\tthis.updateGraphModeButtonState();\n\t\tthis.showEmptyState();\n\t\tqueueMicrotask(() => this.maybeAutoCapture());\n\t}\n\n\t/**\n\t * Replaces or removes the live-capture provider.\n\t *\n\t * @remarks Installing a provider may immediately begin an asynchronous\n\t * capture when no snapshot is displayed.\n\t */\n\tsetCaptureSnapshotProvider(provider: FrameGraphInspectorOptions['captureSnapshot']): void {\n\t\tconst changed = this.captureSnapshotCallback !== provider;\n\t\tthis.captureSnapshotCallback = provider;\n\t\tif (changed && !this.viewModel) this.initialAutoCaptureAttempted = false;\n\t\tif (!provider && !this.viewModel) this.showEmptyState();\n\t\tthis.updateCaptureActions();\n\t\tthis.maybeAutoCapture();\n\t}\n\n\t/**\n\t * Requests and displays a live snapshot from the configured provider.\n\t *\n\t * @remarks Concurrent requests are coalesced. Provider errors, invalid\n\t * snapshots, and an unavailable provider are displayed in the inspector and\n\t * do not reject the returned promise.\n\t */\n\tasync captureSnapshot(): Promise<void> {\n\t\tif (this.destroyed || this.capturing) return;\n\t\tif (!this.captureSnapshotCallback) {\n\t\t\tthis.reportCaptureIssue('Waiting for a FrameGraph capture source.');\n\t\t\treturn;\n\t\t}\n\t\tconst revision = ++this.operationRevision;\n\t\tthis.importing = false;\n\t\tthis.capturing = true;\n\t\tthis.statusMessage = undefined;\n\t\tthis.statusTone = 'neutral';\n\t\tif (!this.viewModel) this.workbench.showEmptyState('capturing', 'Capturing the next rendered frame…');\n\t\tthis.updateCaptureActions();\n\t\ttry {\n\t\t\tconst snapshot = await this.captureSnapshotCallback();\n\t\t\tif (this.destroyed || revision !== this.operationRevision) return;\n\t\t\tif (!snapshot) {\n\t\t\t\tthis.reportCaptureIssue('No snapshot was produced. Capture again when rendering is active.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst decoded = decodeFrameGraphSnapshot(snapshot);\n\t\t\tif (!decoded.ok) {\n\t\t\t\tthis.reportCaptureIssue(`Failed to capture FrameGraph: ${formatIssues(decoded.issues)}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.applySnapshot(decoded.snapshot, { kind: 'live', label: 'Live Capture' });\n\t\t}\n\t\tcatch (error) {\n\t\t\tif (!this.destroyed && revision === this.operationRevision) {\n\t\t\t\tthis.reportCaptureIssue(`Failed to capture FrameGraph: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\tif (revision === this.operationRevision) this.capturing = false;\n\t\t\tif (!this.destroyed && revision === this.operationRevision) this.updateCaptureActions();\n\t\t}\n\t}\n\n\t/**\n\t * Validates and synchronously displays a programmatic Snapshot 1.0 value.\n\t *\n\t * @throws {@link FrameGraphSnapshotValidationError} if `snapshot` is invalid.\n\t */\n\tsetSnapshot(snapshot: FrameGraphSnapshot): void {\n\t\tif (this.destroyed) return;\n\t\tthis.operationRevision += 1;\n\t\tthis.capturing = false;\n\t\tthis.importing = false;\n\t\tconst decoded = decodeFrameGraphSnapshot(snapshot);\n\t\tif (!decoded.ok) throw new FrameGraphSnapshotValidationError(decoded.issues);\n\t\tthis.applySnapshot(decoded.snapshot, { kind: 'programmatic', label: 'Programmatic' });\n\t}\n\n\t/** Returns the currently displayed canonical snapshot, if any. */\n\tgetSnapshot(): FrameGraphSnapshot | undefined {\n\t\treturn this.protocolSnapshot;\n\t}\n\n\t/**\n\t * Reads, migrates, validates, and displays a snapshot JSON file.\n\t *\n\t * @remarks Files above `maxImportBytes`, read failures, invalid JSON, and\n\t * validation failures are displayed in the UI and do not reject the promise.\n\t */\n\tasync importSnapshot(file: File): Promise<void> {\n\t\tif (this.destroyed) return;\n\t\tconst revision = ++this.operationRevision;\n\t\tthis.capturing = false;\n\t\tthis.importing = false;\n\t\tif (file.size > this.maxImportBytes) {\n\t\t\tthis.reportCaptureIssue(`Import exceeds the ${formatImportLimit(this.maxImportBytes)} limit.`);\n\t\t\treturn;\n\t\t}\n\t\tthis.importing = true;\n\t\tthis.statusMessage = undefined;\n\t\tthis.statusTone = 'neutral';\n\t\tthis.updateCaptureActions();\n\t\ttry {\n\t\t\tconst text = await file.text();\n\t\t\tif (this.destroyed || revision !== this.operationRevision) return;\n\t\t\tconst decoded = parseFrameGraphSnapshot(text);\n\t\t\tif (!decoded.ok) {\n\t\t\t\tthis.reportCaptureIssue(`Failed to import snapshot: ${formatIssues(decoded.issues)}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.applySnapshot(decoded.snapshot, {\n\t\t\t\tkind: 'file',\n\t\t\t\tlabel: file.name || 'Imported JSON',\n\t\t\t});\n\t\t\tconst sourceFormat = decoded.snapshot.capture.migration?.sourceFormat;\n\t\t\tif (sourceFormat) {\n\t\t\t\tconst sourceLabel = sourceFormat === 'legacy-v0' ? 'Legacy V0' : 'Legacy Candidate V1';\n\t\t\t\tthis.statusMessage = decoded.migrated\n\t\t\t\t\t? `Imported ${sourceLabel} and migrated it to ZenFG Snapshot V1.`\n\t\t\t\t\t: `Imported Snapshot V1 with ${sourceLabel} migration provenance.`;\n\t\t\t\tthis.statusTone = 'neutral';\n\t\t\t}\n\t\t}\n\t\tcatch (error) {\n\t\t\tif (!this.destroyed && revision === this.operationRevision) {\n\t\t\t\tthis.reportCaptureIssue(`Failed to import snapshot: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\tif (revision === this.operationRevision) this.importing = false;\n\t\t\tif (!this.destroyed && revision === this.operationRevision) this.updateCaptureActions();\n\t\t}\n\t}\n\n\t/** Downloads the displayed snapshot as pretty-printed canonical JSON. */\n\tdownloadSnapshot(): void {\n\t\tif (this.destroyed || !this.protocolSnapshot) return;\n\t\tconst json = stringifyFrameGraphSnapshot(this.protocolSnapshot, { pretty: true });\n\t\tconst url = URL.createObjectURL(new Blob([json], { type: 'application/json;charset=utf-8' }));\n\t\tconst anchor = document.createElement('a');\n\t\tanchor.href = url;\n\t\tanchor.download = `frame-graph-${this.protocolSnapshot.capture.frameIndex}.fgsnapshot.json`;\n\t\tanchor.click();\n\t\tURL.revokeObjectURL(url);\n\t}\n\n\t/**\n\t * Copies the displayed snapshot as pretty-printed canonical JSON.\n\t *\n\t * @remarks Clipboard failures are shown in the UI and do not reject the\n\t * returned promise. A legacy `document.execCommand` fallback is used when the\n\t * async Clipboard API is unavailable.\n\t */\n\tasync copySnapshotJson(): Promise<void> {\n\t\tif (this.destroyed || this.copying || !this.protocolSnapshot) return;\n\t\tconst snapshot = this.protocolSnapshot;\n\t\tconst revision = this.operationRevision;\n\t\tthis.copying = true;\n\t\tthis.copied = false;\n\t\tthis.statusMessage = undefined;\n\t\tthis.statusTone = 'neutral';\n\t\tthis.updateCaptureActions();\n\t\ttry {\n\t\t\tawait writeTextToClipboard(stringifyFrameGraphSnapshot(snapshot, { pretty: true }));\n\t\t\tif (this.destroyed || revision !== this.operationRevision) return;\n\t\t\tthis.copied = true;\n\t\t\tif (this.copyFeedbackTimeout !== undefined) window.clearTimeout(this.copyFeedbackTimeout);\n\t\t\tthis.copyFeedbackTimeout = window.setTimeout(() => {\n\t\t\t\tthis.copied = false;\n\t\t\t\tthis.copyFeedbackTimeout = undefined;\n\t\t\t\tthis.updateCaptureActions();\n\t\t\t}, 1200);\n\t\t}\n\t\tcatch (error) {\n\t\t\tif (!this.destroyed && revision === this.operationRevision) {\n\t\t\t\tthis.statusMessage = `Failed to copy snapshot: ${error instanceof Error ? error.message : String(error)}`;\n\t\t\t}\n\t\t\tconsole.warn('Failed to copy FrameGraph Snapshot.', error);\n\t\t}\n\t\tfinally {\n\t\t\tthis.copying = false;\n\t\t\tif (!this.destroyed) this.updateCaptureActions();\n\t\t}\n\t}\n\n\tprivate applySnapshot(snapshot: FrameGraphSnapshot, source: FrameGraphDebugSnapshotSource): void {\n\t\tconst viewModel = createDebugViewModel(snapshot, source);\n\t\tthis.copied = false;\n\t\tif (this.copyFeedbackTimeout !== undefined) {\n\t\t\twindow.clearTimeout(this.copyFeedbackTimeout);\n\t\t\tthis.copyFeedbackTimeout = undefined;\n\t\t}\n\t\tthis.protocolSnapshot = snapshot;\n\t\tthis.viewModel = viewModel;\n\t\tthis.graphView.fitOnNextRender = true;\n\t\tthis.hovered = undefined;\n\t\tthis.initialAutoCaptureAttempted = true;\n\t\tthis.statusMessage = undefined;\n\t\tthis.statusTone = 'neutral';\n\t\tif (!this.selected || !selectionExists(viewModel, this.selected)) {\n\t\t\tthis.selected = viewModel.nodes[0]\n\t\t\t\t? { kind: 'node', id: viewModel.nodes[0].id }\n\t\t\t\t: undefined;\n\t\t}\n\t\tthis.workbench.setSnapshot(viewModel, this.selected);\n\t\tthis.updateCaptureActions();\n\t\tthis.updateGraphModeButtonState();\n\t}\n\n\t/**\n\t * Idempotently cancels pending UI results, releases graph resources, and\n\t * removes the inspector workbench. Do not reuse the controller afterward.\n\t */\n\tdestroy(): void {\n\t\tif (this.destroyed) return;\n\t\tthis.destroyed = true;\n\t\tthis.operationRevision += 1;\n\t\tif (this.copyFeedbackTimeout !== undefined) window.clearTimeout(this.copyFeedbackTimeout);\n\t\tthis.clearDropState();\n\t\tthis.dom.removeEventListener('dragenter', this.handleDragEnter);\n\t\tthis.dom.removeEventListener('dragover', this.handleDragOver);\n\t\tthis.dom.removeEventListener('dragleave', this.handleDragLeave);\n\t\tthis.dom.removeEventListener('dragend', this.handleDragEnd);\n\t\tthis.dom.removeEventListener('drop', this.handleDrop);\n\t\tdestroyGraph(this.graphView);\n\t\tthis.dom.remove();\n\t}\n\n\tprivate updateCaptureActions(): void {\n\t\tthis.workbench.setSnapshotActionState({\n\t\t\tproviderAvailable: Boolean(this.captureSnapshotCallback),\n\t\t\thasCapture: Boolean(this.viewModel),\n\t\t\tcapturing: this.capturing,\n\t\t\timporting: this.importing,\n\t\t\tcopying: this.copying,\n\t\t\tcopied: this.copied,\n\t\t\tmessage: this.viewModel ? this.statusMessage : undefined,\n\t\t\tmessageTone: this.statusTone,\n\t\t});\n\t}\n\n\tprivate maybeAutoCapture(): void {\n\t\tif (\n\t\t\tthis.destroyed\n\t\t\t|| this.viewModel\n\t\t\t|| this.initialAutoCaptureAttempted\n\t\t\t|| this.capturing\n\t\t\t|| this.importing\n\t\t\t|| !this.captureSnapshotCallback\n\t\t) return;\n\t\tthis.initialAutoCaptureAttempted = true;\n\t\tvoid this.captureSnapshot();\n\t}\n\tprivate handleSelect(selection: Selection): void {\n\t\tthis.selected = selection;\n\t\tthis.workbench.setSelection(selection);\n\t}\n\n\tprivate handleHover(selection: Selection | undefined): void {\n\t\tif (!this.viewModel || sameSelection(this.hovered, selection)) return;\n\t\tthis.hovered = selection;\n\t\tthis.workbench.setHovered(selection);\n\t}\n\n\tprivate setGraphMode(mode: GraphViewState['graphMode']): void {\n\t\tif (this.graphView.graphMode === mode) return;\n\t\tthis.graphView.graphMode = mode;\n\t\tthis.graphView.fitOnNextRender = true;\n\t\tthis.updateGraphModeButtonState();\n\t\tthis.workbench.refreshGraphStructure();\n\t}\n\n\tprivate updateGraphModeButtonState(): void {\n\t\tconst passesActive = this.graphView.graphMode === 'passes';\n\t\tconst hasGroups = (this.viewModel?.debugGroups.length ?? 0) > 0;\n\t\tthis.passesGraphModeButton.classList.toggle('active', passesActive);\n\t\tthis.resourcesGraphModeButton.classList.toggle('active', !passesActive);\n\t\tthis.passesGraphModeButton.setAttribute('aria-pressed', passesActive ? 'true' : 'false');\n\t\tthis.resourcesGraphModeButton.setAttribute('aria-pressed', passesActive ? 'false' : 'true');\n\t\tthis.groupsButton.disabled = !passesActive || !hasGroups;\n\t\tthis.groupsButton.classList.toggle('active', passesActive && hasGroups && this.graphView.groupsEnabled);\n\t\tthis.groupsButton.setAttribute('aria-pressed', passesActive && hasGroups && this.graphView.groupsEnabled ? 'true' : 'false');\n\t\tconst hasExpanded = this.viewModel?.debugGroups.some((group) => this.graphView.expandedGroupPaths.has(group.pathKey)) ?? false;\n\t\tthis.collapseGroupsButton.disabled = !passesActive || !hasGroups || !this.graphView.groupsEnabled || !hasExpanded;\n\t}\n\n\tprivate toggleGroups(): void {\n\t\tif (this.graphView.graphMode !== 'passes' || !this.viewModel?.debugGroups.length) return;\n\t\tthis.graphView.groupsEnabled = !this.graphView.groupsEnabled;\n\t\tthis.graphView.fitOnNextRender = true;\n\t\tthis.updateGraphModeButtonState();\n\t\tthis.workbench.refreshGraphStructure();\n\t}\n\n\tprivate toggleGroup(pathKey: string): void {\n\t\tif (this.graphView.expandedGroupPaths.has(pathKey)) this.graphView.expandedGroupPaths.delete(pathKey);\n\t\telse this.graphView.expandedGroupPaths.add(pathKey);\n\t\tthis.graphView.anchorElementIdOnNextRender = graphGroupElementId(pathKey);\n\t\tthis.updateGraphModeButtonState();\n\t\tthis.workbench.refreshGraphStructure();\n\t}\n\n\tprivate collapseAllGroups(): void {\n\t\tif (this.graphView.expandedGroupPaths.size === 0) return;\n\t\tthis.graphView.expandedGroupPaths.clear();\n\t\tthis.graphView.fitOnNextRender = true;\n\t\tthis.updateGraphModeButtonState();\n\t\tthis.workbench.refreshGraphStructure();\n\t}\n\n\tprivate showEmptyState(): void {\n\t\tconst providerAvailable = Boolean(this.captureSnapshotCallback);\n\t\tthis.workbench.showEmptyState(\n\t\t\t'empty',\n\t\t\tproviderAvailable\n\t\t\t\t? 'No capture yet. Use Capture to request the next rendered frame.'\n\t\t\t\t: 'Drop a ZenFG Snapshot here or choose Import.',\n\t\t\tproviderAvailable ? undefined : 'Files are processed locally in your browser.',\n\t\t);\n\t}\n\n\tprivate setDropActive(active: boolean): void {\n\t\tif (this.destroyed) return;\n\t\tthis.dropOverlay.hidden = !active;\n\t\tthis.dom.classList.toggle('drop-active', active);\n\t}\n\n\tprivate clearDropState(): void {\n\t\tthis.dragDepth = 0;\n\t\tthis.dropOverlay.hidden = true;\n\t\tthis.dom.classList.remove('drop-active');\n\t}\n\n\tprivate reportCaptureIssue(message: string): void {\n\t\tthis.statusMessage = message;\n\t\tthis.statusTone = 'error';\n\t\tif (!this.viewModel) this.workbench.showEmptyState('error', message);\n\t\tthis.updateCaptureActions();\n\t}\n}\n\n/**\n * Creates an inspector, appends its root element to `host`, and returns its\n * lifecycle controller.\n *\n * @throws If inspector construction fails; see {@link FrameGraphInspector}.\n */\nexport function mountFrameGraphInspector(host: HTMLElement, options?: FrameGraphInspectorOptions): FrameGraphInspector {\n\tconst inspector = new FrameGraphInspector(options);\n\thost.appendChild(inspector.dom);\n\treturn inspector;\n}\n\nfunction createGraphIconButton(icon: 'fit', title: string, onClick: () => void): HTMLButtonElement {\n\tconst button = createToolbarButton('', title, onClick);\n\tbutton.classList.add('zenfg-inspector-icon-button');\n\tbutton.appendChild(createPanelIcon(icon));\n\treturn button;\n}\n\nasync function writeTextToClipboard(text: string): Promise<void> {\n\tif (navigator.clipboard?.writeText) {\n\t\tawait navigator.clipboard.writeText(text);\n\t\treturn;\n\t}\n\tconst textArea = document.createElement('textarea');\n\ttextArea.value = text;\n\ttextArea.setAttribute('readonly', 'true');\n\ttextArea.style.position = 'fixed';\n\ttextArea.style.left = '-9999px';\n\ttextArea.style.top = '0';\n\tdocument.body.appendChild(textArea);\n\ttextArea.select();\n\ttry {\n\t\tif (!document.execCommand('copy')) throw new Error('document.execCommand(\"copy\") returned false.');\n\t}\n\tfinally {\n\t\ttextArea.remove();\n\t}\n}\n\nfunction normalizeMaxImportBytes(value: number | undefined): number {\n\treturn normalizeLimit(value, DEFAULT_MAX_IMPORT_BYTES, 'maxImportBytes');\n}\n\nfunction normalizeLimit(value: number | undefined, fallback: number, name: string): number {\n\tif (value === undefined) return fallback;\n\tif (!Number.isSafeInteger(value) || value < 0) {\n\t\tthrow new Error(`${name} must be a non-negative safe integer.`);\n\t}\n\treturn value;\n}\n\nfunction formatImportLimit(bytes: number): string {\n\treturn bytes >= 1024 * 1024 && bytes % (1024 * 1024) === 0\n\t\t? `${bytes / (1024 * 1024)} MiB`\n\t\t: `${bytes} bytes`;\n}\n\nfunction formatIssues(issues: readonly { readonly path: string; readonly message: string }[]): string {\n\treturn issues.slice(0, 3).map((issue) => `${issue.path || '/'}: ${issue.message}`).join('; ');\n}\n\nfunction isFileDrag(event: DragEvent): boolean {\n\treturn Array.from(event.dataTransfer?.types ?? []).includes('Files');\n}\n\nlet nextInspectorId = 0;\nfunction createInspectorId(): string {\n\tnextInspectorId += 1;\n\treturn `zenfg-inspector-${nextInspectorId}`;\n}\n"]}
@@ -0,0 +1,166 @@
1
+ import type { FrameGraphSnapshot, FrameGraphSnapshotAccessKind, FrameGraphSnapshotBufferRange, FrameGraphSnapshotGpuTimings, FrameGraphSnapshotNodeKind, FrameGraphSnapshotResourceKind, FrameGraphSnapshotResourceOrigin, FrameGraphSnapshotRootReason, FrameGraphSnapshotSegment, FrameGraphSnapshotTextureRegion, FrameGraphSnapshotWriteContents } from '@zenfg/snapshot';
2
+ export type FrameGraphDebugExecutionSegment = FrameGraphSnapshotSegment & {
3
+ readonly index: number;
4
+ };
5
+ export type FrameGraphDebugResourceRef = {
6
+ readonly id: string;
7
+ readonly kind: FrameGraphSnapshotResourceKind;
8
+ readonly label?: string;
9
+ };
10
+ type FrameGraphDebugAccessEdgeBase = {
11
+ readonly accessId: string;
12
+ readonly nodeId: string;
13
+ readonly resource: FrameGraphDebugResourceRef;
14
+ readonly access: FrameGraphSnapshotAccessKind;
15
+ readonly textureViewId?: string;
16
+ readonly textureRegion?: FrameGraphSnapshotTextureRegion;
17
+ readonly bufferRange?: FrameGraphSnapshotBufferRange;
18
+ };
19
+ export type FrameGraphDebugAccessEdge = FrameGraphDebugAccessEdgeBase & ({
20
+ readonly mode: 'read';
21
+ readonly producesValue: false;
22
+ readonly contents?: never;
23
+ } | {
24
+ readonly mode: 'write';
25
+ readonly contents: FrameGraphSnapshotWriteContents;
26
+ readonly producesValue: boolean;
27
+ });
28
+ export type FrameGraphDebugAccess = FrameGraphDebugAccessEdge extends infer TAccess ? TAccess extends FrameGraphDebugAccessEdge ? Omit<TAccess, 'nodeId'> : never : never;
29
+ export type FrameGraphDebugNode = {
30
+ readonly id: string;
31
+ readonly order: number;
32
+ readonly kind: FrameGraphSnapshotNodeKind;
33
+ readonly label?: string;
34
+ readonly sideEffect: boolean;
35
+ readonly debugGroupId?: string;
36
+ readonly gpuDurationMicros?: number;
37
+ readonly reads: readonly FrameGraphDebugAccess[];
38
+ readonly writes: readonly FrameGraphDebugAccess[];
39
+ };
40
+ export type FrameGraphDebugResource = FrameGraphDebugResourceRef & {
41
+ readonly origin: FrameGraphSnapshotResourceOrigin;
42
+ readonly debugGroupId?: string;
43
+ readonly usageFlags: readonly string[];
44
+ readonly lifetime?: {
45
+ readonly firstUse: number;
46
+ readonly lastUse: number;
47
+ };
48
+ readonly physicalResourceId?: string;
49
+ readonly descriptor?: FrameGraphSnapshot['graph']['resources'][number]['descriptor'];
50
+ readonly estimatedByteSize?: number;
51
+ };
52
+ export type FrameGraphDebugEdge = {
53
+ readonly fromNodeId: string;
54
+ readonly toNodeId: string;
55
+ readonly resource: FrameGraphDebugResourceRef;
56
+ readonly kind: 'value' | 'ordering';
57
+ };
58
+ export type FrameGraphDebugRoot = {
59
+ readonly reason: FrameGraphSnapshotRootReason;
60
+ readonly nodeId?: string;
61
+ readonly resource?: FrameGraphDebugResourceRef;
62
+ };
63
+ export type FrameGraphDebugCulledNode = {
64
+ readonly node: Omit<FrameGraphDebugNode, 'order'>;
65
+ readonly reason: string;
66
+ };
67
+ export type FrameGraphDebugPhysicalAllocation = {
68
+ readonly id: string;
69
+ readonly kind: FrameGraphSnapshotResourceKind;
70
+ readonly compatibilityClassId: string;
71
+ readonly estimatedByteSize?: number;
72
+ readonly resourceIds: readonly string[];
73
+ };
74
+ export type FrameGraphDebugGroupSummary = {
75
+ readonly retainedNodeCount: number;
76
+ readonly culledNodeCount: number;
77
+ readonly nodeKindCounts: Readonly<Partial<Record<FrameGraphSnapshotNodeKind, number>>>;
78
+ readonly inputResources: readonly FrameGraphDebugResourceRef[];
79
+ readonly outputResources: readonly FrameGraphDebugResourceRef[];
80
+ readonly registeredTransientResourceCount: number;
81
+ readonly accessedTransientResourceCount: number;
82
+ readonly physicalAllocationCount: number;
83
+ readonly executionSegmentCount: number;
84
+ readonly externalSubmissionCount: number;
85
+ readonly gpuWorkDurationMicros: number;
86
+ readonly timedNodeCount: number;
87
+ readonly timingEligibleNodeCount: number;
88
+ };
89
+ export type FrameGraphDebugGroup = {
90
+ readonly id: string;
91
+ readonly parentId?: string;
92
+ readonly label: string;
93
+ readonly path: readonly string[];
94
+ /** Stable while same-named siblings retain their recording-order occurrence. */
95
+ readonly pathKey: string;
96
+ readonly depth: number;
97
+ /** Ordered ancestor ids from root through this group. */
98
+ readonly ancestorIds: readonly string[];
99
+ readonly summary: FrameGraphDebugGroupSummary;
100
+ };
101
+ export type FrameGraphDebugMetrics = {
102
+ readonly timingEligibleNodeCount: number;
103
+ readonly timedNodeCount: number;
104
+ readonly slowestNode?: FrameGraphDebugNode;
105
+ readonly transientEstimatedByteSize?: number;
106
+ readonly logicalCapacityBytes?: number;
107
+ readonly physicalEstimatedBytes?: number;
108
+ readonly aliasReuseBytes?: number;
109
+ readonly aliasedAllocationCount: number;
110
+ };
111
+ export type FrameGraphDebugSnapshotSource = {
112
+ readonly kind: 'live' | 'file' | 'programmatic';
113
+ readonly label: string;
114
+ readonly migratedFromLegacy?: boolean;
115
+ };
116
+ export type FrameGraphDebugViewModel = {
117
+ readonly protocol: FrameGraphSnapshot;
118
+ readonly source: FrameGraphDebugSnapshotSource;
119
+ readonly frameIndex: number;
120
+ readonly nodes: readonly FrameGraphDebugNode[];
121
+ readonly resources: readonly FrameGraphDebugResource[];
122
+ readonly edges: readonly FrameGraphDebugEdge[];
123
+ readonly accessEdges: readonly FrameGraphDebugAccessEdge[];
124
+ readonly roots: readonly FrameGraphDebugRoot[];
125
+ readonly culledNodes: readonly FrameGraphDebugCulledNode[];
126
+ readonly physicalAllocations: readonly FrameGraphDebugPhysicalAllocation[];
127
+ readonly debugGroups: readonly FrameGraphDebugGroup[];
128
+ readonly executionSegments: readonly FrameGraphDebugExecutionSegment[];
129
+ readonly textureViewById: ReadonlyMap<string, FrameGraphSnapshot['graph']['textureViews'][number]>;
130
+ readonly nodeById: ReadonlyMap<string, FrameGraphDebugNode>;
131
+ readonly resourceById: ReadonlyMap<string, FrameGraphDebugResource>;
132
+ readonly groupById: ReadonlyMap<string, FrameGraphDebugGroup>;
133
+ readonly groupByPathKey: ReadonlyMap<string, FrameGraphDebugGroup>;
134
+ readonly allocationById: ReadonlyMap<string, FrameGraphDebugPhysicalAllocation>;
135
+ readonly accessesByNodeId: ReadonlyMap<string, readonly FrameGraphDebugAccessEdge[]>;
136
+ readonly accessesByResourceId: ReadonlyMap<string, readonly FrameGraphDebugAccessEdge[]>;
137
+ readonly segmentByNodeId: ReadonlyMap<string, FrameGraphDebugExecutionSegment>;
138
+ readonly segmentByIndex: ReadonlyMap<number, FrameGraphDebugExecutionSegment>;
139
+ readonly metrics: FrameGraphDebugMetrics;
140
+ readonly profiling: {
141
+ readonly status: 'available';
142
+ readonly frameIndex: number;
143
+ readonly timings: readonly {
144
+ readonly nodeId: string;
145
+ readonly gpuDurationMicros: number;
146
+ }[];
147
+ readonly gpuFrameDurationMicros: number;
148
+ } | {
149
+ readonly status: 'unavailable';
150
+ readonly frameIndex: number;
151
+ readonly reason: Extract<FrameGraphSnapshotGpuTimings, {
152
+ readonly status: 'unavailable';
153
+ }>['reason'];
154
+ readonly timings: readonly [];
155
+ };
156
+ readonly resourcePool: FrameGraphSnapshot['memory']['poolReport'];
157
+ readonly availability: {
158
+ readonly groups: boolean;
159
+ readonly textureViews: boolean;
160
+ readonly recordingOrder: boolean;
161
+ readonly accessRegions: boolean;
162
+ };
163
+ };
164
+ export declare function createDebugViewModel(snapshot: FrameGraphSnapshot, source?: FrameGraphDebugSnapshotSource): FrameGraphDebugViewModel;
165
+ export {};
166
+ //# sourceMappingURL=debugCaptureModel.d.ts.map
@@ -0,0 +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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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,CA2N1B"}
@@ -0,0 +1,364 @@
1
+ export function createDebugViewModel(snapshot, source = { kind: 'programmatic', label: 'Programmatic' }) {
2
+ const compilation = snapshot.graph;
3
+ const unavailable = new Set(snapshot.capture.migration?.unavailableFacts ?? []);
4
+ const availability = {
5
+ groups: !unavailable.has('graph.groups'),
6
+ textureViews: !unavailable.has('graph.textureViews'),
7
+ recordingOrder: !unavailable.has('graph.nodes.recordingOrder'),
8
+ accessRegions: !unavailable.has('graph.accesses.regions'),
9
+ };
10
+ const resolvedSource = snapshot.capture.migration?.sourceFormat === 'legacy-v0'
11
+ ? { ...source, migratedFromLegacy: true }
12
+ : source;
13
+ const gpuTiming = snapshot.timings.gpu;
14
+ const resourcePool = snapshot.memory.poolReport;
15
+ const normalizedGroups = normalizeDebugGroups(compilation);
16
+ const knownGroupIds = new Set(normalizedGroups.map((group) => group.id));
17
+ validateDebugGroupReferences(compilation, knownGroupIds);
18
+ const resourcesById = new Map(compilation.resources.map((resource) => [resource.id, resource]));
19
+ const resourceRef = (resourceId) => {
20
+ const resource = resourcesById.get(resourceId);
21
+ if (!resource) {
22
+ throw new Error(`Compilation report references unknown resource ${resourceId}.`);
23
+ }
24
+ return { id: resource.id, kind: resource.kind, label: resource.label };
25
+ };
26
+ const accessEdges = compilation.accesses.map((access) => {
27
+ const common = {
28
+ accessId: access.id,
29
+ nodeId: access.nodeId,
30
+ resource: resourceRef(access.resourceId),
31
+ access: access.access,
32
+ textureViewId: access.textureViewId,
33
+ textureRegion: access.textureRegion,
34
+ bufferRange: access.bufferRange,
35
+ };
36
+ return access.mode === 'read'
37
+ ? { ...common, mode: 'read', producesValue: false }
38
+ : {
39
+ ...common,
40
+ mode: 'write',
41
+ contents: access.contents,
42
+ producesValue: access.producesValue,
43
+ };
44
+ });
45
+ const accessesByNode = new Map();
46
+ const accessesByResource = new Map();
47
+ for (const access of accessEdges) {
48
+ const nodeAccesses = accessesByNode.get(access.nodeId) ?? [];
49
+ nodeAccesses.push(access);
50
+ accessesByNode.set(access.nodeId, nodeAccesses);
51
+ const resourceAccesses = accessesByResource.get(access.resource.id) ?? [];
52
+ resourceAccesses.push(access);
53
+ accessesByResource.set(access.resource.id, resourceAccesses);
54
+ }
55
+ const timings = gpuTiming.status === 'available'
56
+ ? new Map(gpuTiming.nodes.map((timing) => [timing.nodeId, timing.durationMicros]))
57
+ : new Map();
58
+ const nodeAccesses = (nodeId, mode) => ((accessesByNode.get(nodeId) ?? [])
59
+ .filter((access) => access.mode === mode)
60
+ .map(({ nodeId: _nodeId, ...access }) => access));
61
+ const nodes = compilation.nodes
62
+ .filter((node) => node.compileState.status === 'retained')
63
+ .sort((a, b) => a.compileState.status === 'retained' && b.compileState.status === 'retained'
64
+ ? a.compileState.executionOrder - b.compileState.executionOrder
65
+ : 0)
66
+ .map((node) => ({
67
+ id: node.id,
68
+ order: node.compileState.status === 'retained' ? node.compileState.executionOrder : 0,
69
+ kind: node.kind,
70
+ label: node.label,
71
+ sideEffect: node.sideEffect,
72
+ debugGroupId: node.groupId,
73
+ gpuDurationMicros: timings.get(node.id),
74
+ reads: nodeAccesses(node.id, 'read'),
75
+ writes: nodeAccesses(node.id, 'write'),
76
+ }));
77
+ const resources = compilation.resources.map((resource) => ({
78
+ id: resource.id,
79
+ kind: resource.kind,
80
+ label: resource.label,
81
+ origin: resource.origin,
82
+ debugGroupId: resource.groupId,
83
+ usageFlags: resource.usageFlags,
84
+ lifetime: resource.lifetime,
85
+ physicalResourceId: resource.allocationId,
86
+ descriptor: resource.descriptor,
87
+ estimatedByteSize: resource.estimatedByteSize,
88
+ }));
89
+ const edges = compilation.dependencies.map((dependency) => ({
90
+ ...dependency,
91
+ resource: resourceRef(dependency.resourceId),
92
+ }));
93
+ const roots = compilation.roots.map((root) => ({
94
+ reason: root.reason,
95
+ nodeId: root.nodeId,
96
+ resource: root.resourceId === undefined ? undefined : resourceRef(root.resourceId),
97
+ }));
98
+ const culledNodes = compilation.nodes
99
+ .filter((node) => node.compileState.status === 'culled')
100
+ .map((node) => ({
101
+ node: {
102
+ id: node.id,
103
+ kind: node.kind,
104
+ label: node.label,
105
+ sideEffect: node.sideEffect,
106
+ debugGroupId: node.groupId,
107
+ reads: nodeAccesses(node.id, 'read'),
108
+ writes: nodeAccesses(node.id, 'write'),
109
+ },
110
+ reason: node.compileState.status === 'culled' ? node.compileState.reason : 'unknown',
111
+ }));
112
+ const resourceIdsByAllocation = new Map();
113
+ for (const resource of compilation.resources) {
114
+ if (resource.allocationId === undefined)
115
+ continue;
116
+ const resourceIds = resourceIdsByAllocation.get(resource.allocationId) ?? [];
117
+ resourceIds.push(resource.id);
118
+ resourceIdsByAllocation.set(resource.allocationId, resourceIds);
119
+ }
120
+ const physicalAllocations = snapshot.memory.allocationReport.status === 'available'
121
+ ? snapshot.memory.allocationReport.allocations.map((allocation) => ({
122
+ ...allocation,
123
+ resourceIds: resourceIdsByAllocation.get(allocation.id) ?? [],
124
+ }))
125
+ : [];
126
+ const executionSegments = compilation.segments.map((segment) => ({
127
+ ...segment,
128
+ index: segment.order,
129
+ }));
130
+ const debugGroups = buildDebugGroupSummaries({
131
+ groups: normalizedGroups,
132
+ nodes,
133
+ culledNodes,
134
+ resources,
135
+ accessEdges,
136
+ edges,
137
+ roots,
138
+ executionSegments,
139
+ });
140
+ const nodeById = new Map(nodes.map((node) => [node.id, node]));
141
+ const resourceById = new Map(resources.map((resource) => [resource.id, resource]));
142
+ const groupById = new Map(debugGroups.map((group) => [group.id, group]));
143
+ const groupByPathKey = new Map(debugGroups.map((group) => [group.pathKey, group]));
144
+ const allocationById = new Map(physicalAllocations.map((allocation) => [allocation.id, allocation]));
145
+ const textureViewById = new Map(compilation.textureViews.map((view) => [view.id, view]));
146
+ const segmentByNodeId = new Map();
147
+ const segmentByIndex = new Map(executionSegments.map((segment) => [segment.index, segment]));
148
+ for (const segment of executionSegments) {
149
+ for (const nodeId of segment.nodeIds)
150
+ segmentByNodeId.set(nodeId, segment);
151
+ }
152
+ const timingEligibleNodes = nodes.filter((node) => node.kind === 'render' || node.kind === 'compute');
153
+ const timedNodes = timingEligibleNodes.filter((node) => node.gpuDurationMicros !== undefined);
154
+ const slowestNode = timedNodes.reduce((slowest, node) => (!slowest || node.gpuDurationMicros > slowest.gpuDurationMicros ? node : slowest), undefined);
155
+ const transientResources = resources.filter((resource) => resource.origin === 'transient');
156
+ const transientEstimatedByteSize = sumKnown(transientResources.map((resource) => resource.estimatedByteSize));
157
+ const physicalEstimatedBytes = sumKnown(physicalAllocations.map((allocation) => allocation.estimatedByteSize));
158
+ const logicalAllocationSizes = transientResources
159
+ .filter((resource) => resource.physicalResourceId !== undefined)
160
+ .map((resource) => allocationById.get(resource.physicalResourceId)?.estimatedByteSize);
161
+ const logicalCapacityBytes = sumKnown(logicalAllocationSizes);
162
+ const metrics = {
163
+ timingEligibleNodeCount: timingEligibleNodes.length,
164
+ timedNodeCount: timedNodes.length,
165
+ slowestNode,
166
+ transientEstimatedByteSize,
167
+ logicalCapacityBytes,
168
+ physicalEstimatedBytes,
169
+ aliasReuseBytes: logicalCapacityBytes === undefined || physicalEstimatedBytes === undefined
170
+ ? undefined
171
+ : Math.max(0, logicalCapacityBytes - physicalEstimatedBytes),
172
+ aliasedAllocationCount: physicalAllocations.filter((allocation) => allocation.resourceIds.length > 1).length,
173
+ };
174
+ return {
175
+ protocol: snapshot,
176
+ source: resolvedSource,
177
+ frameIndex: snapshot.capture.frameIndex,
178
+ nodes,
179
+ resources,
180
+ edges,
181
+ accessEdges,
182
+ roots,
183
+ culledNodes,
184
+ physicalAllocations,
185
+ debugGroups,
186
+ executionSegments,
187
+ textureViewById,
188
+ nodeById,
189
+ resourceById,
190
+ groupById,
191
+ groupByPathKey,
192
+ allocationById,
193
+ accessesByNodeId: accessesByNode,
194
+ accessesByResourceId: accessesByResource,
195
+ segmentByNodeId,
196
+ segmentByIndex,
197
+ metrics,
198
+ profiling: gpuTiming.status === 'available'
199
+ ? {
200
+ status: 'available',
201
+ frameIndex: snapshot.capture.frameIndex,
202
+ timings: gpuTiming.nodes.map((timing) => ({
203
+ nodeId: timing.nodeId,
204
+ gpuDurationMicros: timing.durationMicros,
205
+ })),
206
+ gpuFrameDurationMicros: gpuTiming.frameSpanMicros,
207
+ }
208
+ : {
209
+ status: 'unavailable',
210
+ frameIndex: snapshot.capture.frameIndex,
211
+ timings: [],
212
+ reason: gpuTiming.reason,
213
+ },
214
+ resourcePool,
215
+ availability,
216
+ };
217
+ }
218
+ function sumKnown(values) {
219
+ let total = 0;
220
+ for (const value of values) {
221
+ if (value === undefined)
222
+ return undefined;
223
+ total += value;
224
+ }
225
+ return total;
226
+ }
227
+ function normalizeDebugGroups(compilation) {
228
+ const rawGroups = compilation.groups;
229
+ const rawById = new Map();
230
+ const siblingOccurrences = new Map();
231
+ const nextOccurrenceByParent = new Map();
232
+ for (const group of rawGroups) {
233
+ if (rawById.has(group.id)) {
234
+ throw new Error(`Compilation report contains duplicate debug group id ${group.id}.`);
235
+ }
236
+ const label = group.label.trim();
237
+ if (label.length === 0) {
238
+ throw new Error(`Compilation report debug group ${group.id} has an empty label.`);
239
+ }
240
+ rawById.set(group.id, { ...group, label });
241
+ const nextOccurrenceByLabel = nextOccurrenceByParent.get(group.parentId) ?? new Map();
242
+ const occurrence = nextOccurrenceByLabel.get(label) ?? 0;
243
+ siblingOccurrences.set(group.id, occurrence);
244
+ nextOccurrenceByLabel.set(label, occurrence + 1);
245
+ nextOccurrenceByParent.set(group.parentId, nextOccurrenceByLabel);
246
+ }
247
+ const normalizedById = new Map();
248
+ const identityPathById = new Map();
249
+ const visiting = new Set();
250
+ const resolve = (id) => {
251
+ const existing = normalizedById.get(id);
252
+ if (existing)
253
+ return existing;
254
+ const raw = rawById.get(id);
255
+ if (!raw)
256
+ throw new Error(`Compilation report references unknown debug group ${id}.`);
257
+ if (visiting.has(id))
258
+ throw new Error(`Compilation report debug group ${id} has a parent cycle.`);
259
+ visiting.add(id);
260
+ const parent = raw.parentId === undefined ? undefined : resolve(raw.parentId);
261
+ const path = [...(parent?.path ?? []), raw.label];
262
+ const identityPath = [
263
+ ...(raw.parentId === undefined ? [] : identityPathById.get(raw.parentId)),
264
+ [raw.label, siblingOccurrences.get(raw.id)],
265
+ ];
266
+ const ancestorIds = [...(parent?.ancestorIds ?? []), raw.id];
267
+ const normalized = {
268
+ id: raw.id,
269
+ parentId: raw.parentId,
270
+ label: raw.label,
271
+ path,
272
+ pathKey: JSON.stringify(identityPath),
273
+ depth: path.length - 1,
274
+ ancestorIds,
275
+ };
276
+ visiting.delete(id);
277
+ identityPathById.set(id, identityPath);
278
+ normalizedById.set(id, normalized);
279
+ return normalized;
280
+ };
281
+ return rawGroups.map((group) => resolve(group.id));
282
+ }
283
+ function validateDebugGroupReferences(compilation, knownGroupIds) {
284
+ for (const entry of [...compilation.nodes, ...compilation.resources]) {
285
+ if (entry.groupId !== undefined && !knownGroupIds.has(entry.groupId)) {
286
+ throw new Error(`Compilation report references unknown debug group ${entry.groupId}.`);
287
+ }
288
+ }
289
+ }
290
+ function buildDebugGroupSummaries(input) {
291
+ const groupsById = new Map(input.groups.map((group) => [group.id, group]));
292
+ const resourcesById = new Map(input.resources.map((resource) => [resource.id, resource]));
293
+ const isInGroup = (candidateId, groupId) => (candidateId !== undefined && groupsById.get(candidateId)?.ancestorIds.includes(groupId) === true);
294
+ return input.groups.map((group) => {
295
+ const retained = input.nodes.filter((node) => isInGroup(node.debugGroupId, group.id));
296
+ const culled = input.culledNodes.filter((entry) => isInGroup(entry.node.debugGroupId, group.id));
297
+ const retainedIds = new Set(retained.map((node) => node.id));
298
+ const allIds = new Set([...retainedIds, ...culled.map((entry) => entry.node.id)]);
299
+ const nodeKindCounts = {};
300
+ for (const node of [...retained, ...culled.map((entry) => entry.node)]) {
301
+ nodeKindCounts[node.kind] = (nodeKindCounts[node.kind] ?? 0) + 1;
302
+ }
303
+ const inputIds = new Set();
304
+ const outputIds = new Set();
305
+ for (const edge of input.edges) {
306
+ const fromInside = retainedIds.has(edge.fromNodeId);
307
+ const toInside = retainedIds.has(edge.toNodeId);
308
+ if (!fromInside && toInside)
309
+ inputIds.add(edge.resource.id);
310
+ if (fromInside && !toInside)
311
+ outputIds.add(edge.resource.id);
312
+ }
313
+ for (const access of input.accessEdges) {
314
+ if (!retainedIds.has(access.nodeId))
315
+ continue;
316
+ const resource = resourcesById.get(access.resource.id);
317
+ const hasRetainedValueProducer = input.edges.some((edge) => (edge.toNodeId === access.nodeId
318
+ && edge.resource.id === access.resource.id
319
+ && edge.kind === 'value'));
320
+ if (access.mode === 'read' && resource && resource.origin !== 'transient' && !hasRetainedValueProducer) {
321
+ inputIds.add(resource.id);
322
+ }
323
+ }
324
+ for (const root of input.roots) {
325
+ if (!root.resource)
326
+ continue;
327
+ if (input.accessEdges.some((access) => retainedIds.has(access.nodeId)
328
+ && access.resource.id === root.resource.id && access.mode === 'write')) {
329
+ outputIds.add(root.resource.id);
330
+ }
331
+ }
332
+ const registeredTransient = input.resources.filter((resource) => resource.origin === 'transient'
333
+ && isInGroup(resource.debugGroupId, group.id));
334
+ const registeredTransientIds = new Set(registeredTransient.map((resource) => resource.id));
335
+ const accessedTransientIds = new Set(input.accessEdges
336
+ .filter((access) => allIds.has(access.nodeId) && registeredTransientIds.has(access.resource.id))
337
+ .map((access) => access.resource.id));
338
+ const allocationIds = new Set(registeredTransient.flatMap((resource) => (resource.physicalResourceId === undefined ? [] : [resource.physicalResourceId])));
339
+ const segmentIds = new Set(input.executionSegments
340
+ .filter((segment) => segment.nodeIds.some((id) => retainedIds.has(id)))
341
+ .map((segment) => segment.index));
342
+ const timingEligible = retained.filter((node) => node.kind === 'render' || node.kind === 'compute');
343
+ const timed = timingEligible.filter((node) => node.gpuDurationMicros !== undefined);
344
+ return {
345
+ ...group,
346
+ summary: {
347
+ retainedNodeCount: retained.length,
348
+ culledNodeCount: culled.length,
349
+ nodeKindCounts,
350
+ inputResources: [...inputIds].map((id) => resourcesById.get(id)).filter(Boolean),
351
+ outputResources: [...outputIds].map((id) => resourcesById.get(id)).filter(Boolean),
352
+ registeredTransientResourceCount: registeredTransient.length,
353
+ accessedTransientResourceCount: accessedTransientIds.size,
354
+ physicalAllocationCount: allocationIds.size,
355
+ executionSegmentCount: segmentIds.size,
356
+ externalSubmissionCount: retained.filter((node) => node.kind === 'external-submission').length,
357
+ gpuWorkDurationMicros: timed.reduce((sum, node) => sum + node.gpuDurationMicros, 0),
358
+ timedNodeCount: timed.length,
359
+ timingEligibleNodeCount: timingEligible.length,
360
+ },
361
+ };
362
+ });
363
+ }
364
+ //# sourceMappingURL=debugCaptureModel.js.map