Repository navigation
fix: keep released subgraph definitions consistent across convert-to-subgraph - #18040
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎭 Playwright: ✅ 2120 passed, 0 failed📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 9.97 MB gzip 🔴 +108 BDetailsSummary
Category Glance App Entry Points — 3.87 kB (baseline 3.87 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.44 MB (baseline 1.44 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 132 kB (baseline 132 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 14 added / 14 removed / 4 unchanged Panels & Settings — 639 kB (baseline 639 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 18 unchanged User & Accounts — 37.9 kB (baseline 37.9 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 5 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 124 kB (baseline 124 kB) • ⚪ 0 BReusable component library chunks
Status: 7 added / 7 removed / 9 unchanged Data & Services — 3.92 MB (baseline 3.92 MB) • 🔴 +530 BStores, services, APIs, and repositories
Status: 13 added / 13 removed / 3 unchanged Utilities & Hooks — 577 kB (baseline 577 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 19 added / 19 removed / 19 unchanged Vendor & Third-Party — 17.4 MB (baseline 17.4 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 17.8 MB (baseline 17.8 MB) • ⚪ 0 BBundles that do not match a named category
Status: 74 added / 74 removed / 228 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-23T02:48:26.324Z",
"gitSha": "a5b55ccce3cee536913702d4144c0db846a26ffe",
"branch": "fix/subgraph-release-serialization-mismatch",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 1992.1889999999962,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.328,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 453.431,
"heapDeltaBytes": 9855628,
"heapUsedBytes": 77425004,
"domNodes": -260,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 8.106000000000002,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-idle",
"durationMs": 1990.4010000000198,
"styleRecalcs": 12,
"styleRecalcDurationMs": 9.479,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 455.64399999999995,
"heapDeltaBytes": 6524344,
"heapUsedBytes": 74068924,
"domNodes": -258,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 7.928000000000001,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1761.2029999999663,
"styleRecalcs": 47,
"styleRecalcDurationMs": 15.748000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 681.7520000000001,
"heapDeltaBytes": -6246580,
"heapUsedBytes": 61235772,
"domNodes": -258,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 148.18200000000002,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1701.9229999999652,
"styleRecalcs": 45,
"styleRecalcDurationMs": 13.530000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 757.717,
"heapDeltaBytes": -6858852,
"heapUsedBytes": 61012132,
"domNodes": -262,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 142.95600000000002,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1723.8310000000183,
"styleRecalcs": 30,
"styleRecalcDurationMs": 14.664,
"layouts": 6,
"layoutDurationMs": 1.1500000000000001,
"taskDurationMs": 336.1139999999999,
"heapDeltaBytes": 3082396,
"heapUsedBytes": 70923516,
"domNodes": 78,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 12.163999999999998,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1739.2769999999018,
"styleRecalcs": 32,
"styleRecalcDurationMs": 15.738999999999999,
"layouts": 6,
"layoutDurationMs": 1.176,
"taskDurationMs": 326.426,
"heapDeltaBytes": 3080948,
"heapUsedBytes": 70550636,
"domNodes": 80,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 10.928999999999998,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 633.3150000000387,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.78,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 422.3190000000001,
"heapDeltaBytes": 19008540,
"heapUsedBytes": 86552420,
"domNodes": 20,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 154.751,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 626.5300000000025,
"styleRecalcs": 14,
"styleRecalcDurationMs": 9.457000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 440.609,
"heapDeltaBytes": 18963764,
"heapUsedBytes": 86406696,
"domNodes": 24,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 162.484,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1138.4909999999877,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 799.8440000000002,
"heapDeltaBytes": 38501960,
"heapUsedBytes": 108210896,
"domNodes": 0,
"jsHeapTotalBytes": 19034112,
"scriptDurationMs": 60.45899999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 526,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1140.2590000000146,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 806.4029999999999,
"heapDeltaBytes": 39066036,
"heapUsedBytes": 106376492,
"domNodes": 0,
"jsHeapTotalBytes": 18509824,
"scriptDurationMs": 62.74199999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 528,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 829.89299999997,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 440.11300000000017,
"heapDeltaBytes": 14538704,
"heapUsedBytes": 89578612,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 137.99700000000004,
"eventListeners": 0,
"totalBlockingTimeMs": 207,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 826.5199999999595,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 454.4139999999999,
"heapDeltaBytes": 14656512,
"heapUsedBytes": 91051104,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 146.82199999999995,
"eventListeners": 0,
"totalBlockingTimeMs": 212,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9483.383000000003,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8557.103,
"heapDeltaBytes": 4094680,
"heapUsedBytes": 86277396,
"domNodes": -16,
"jsHeapTotalBytes": 7864320,
"scriptDurationMs": 6937.133999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 470,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9755.290999999943,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8886.291,
"heapDeltaBytes": -11215732,
"heapUsedBytes": 71133636,
"domNodes": -14,
"jsHeapTotalBytes": 9699328,
"scriptDurationMs": 7180.541,
"eventListeners": 0,
"totalBlockingTimeMs": 419,
"frameDurationMs": 20,
"p95FrameDurationMs": 50
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 8992.037999999979,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8179.811000000001,
"heapDeltaBytes": 2109500,
"heapUsedBytes": 84403276,
"domNodes": -18,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 6558.195,
"eventListeners": 0,
"totalBlockingTimeMs": 206,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9080.637999999908,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8326.092,
"heapDeltaBytes": -6450204,
"heapUsedBytes": 75433976,
"domNodes": -12,
"jsHeapTotalBytes": 6291456,
"scriptDurationMs": 6673.7570000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 295,
"frameDurationMs": 17.776666666666703,
"p95FrameDurationMs": 33.30000000000109
},
{
"name": "large-graph-idle",
"durationMs": 2032.4010000000499,
"styleRecalcs": 6,
"styleRecalcDurationMs": 8.140999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 561.8320000000001,
"heapDeltaBytes": -3374500,
"heapUsedBytes": 83576532,
"domNodes": -246,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 35.884,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2042.724000000021,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.996000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 582.1410000000001,
"heapDeltaBytes": -3681240,
"heapUsedBytes": 83566452,
"domNodes": -244,
"jsHeapTotalBytes": -1282048,
"scriptDurationMs": 34.053,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2185.4129999999827,
"styleRecalcs": 68,
"styleRecalcDurationMs": 12.131999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1545.1090000000002,
"heapDeltaBytes": 15345512,
"heapUsedBytes": 79981120,
"domNodes": -246,
"jsHeapTotalBytes": 1273856,
"scriptDurationMs": 788.55,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 2149.2869999999584,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.329999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1540.0420000000001,
"heapDeltaBytes": 16124936,
"heapUsedBytes": 80528844,
"domNodes": -242,
"jsHeapTotalBytes": 2060288,
"scriptDurationMs": 784.8040000000001,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3566.1660000000097,
"styleRecalcs": 65,
"styleRecalcDurationMs": 15.907000000000002,
"layouts": 60,
"layoutDurationMs": 14.768999999999998,
"taskDurationMs": 1749.17,
"heapDeltaBytes": -7478104,
"heapUsedBytes": 74781416,
"domNodes": -249,
"jsHeapTotalBytes": -532480,
"scriptDurationMs": 791.258,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3460.2570000000696,
"styleRecalcs": 63,
"styleRecalcDurationMs": 12.863,
"layouts": 60,
"layoutDurationMs": 14.471,
"taskDurationMs": 1633.012,
"heapDeltaBytes": 9050536,
"heapUsedBytes": 74995228,
"domNodes": -248,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 766.915,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3052.208999999948,
"styleRecalcs": 43,
"styleRecalcDurationMs": 6.765999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1871.837,
"heapDeltaBytes": 21017036,
"heapUsedBytes": 87467744,
"domNodes": 6,
"jsHeapTotalBytes": 2252800,
"scriptDurationMs": 967.6080000000001,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3123.391999999967,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.291999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1913.3159999999998,
"heapDeltaBytes": -3428988,
"heapUsedBytes": 87336464,
"domNodes": -246,
"jsHeapTotalBytes": 446464,
"scriptDurationMs": 965.843,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2030.9740000000147,
"styleRecalcs": 7,
"styleRecalcDurationMs": 4.803000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 555.77,
"heapDeltaBytes": -4258160,
"heapUsedBytes": 84144544,
"domNodes": -246,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 34.819,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2032.6479999999947,
"styleRecalcs": 6,
"styleRecalcDurationMs": 4.529999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 548.6370000000001,
"heapDeltaBytes": -4797408,
"heapUsedBytes": 84184412,
"domNodes": -247,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 30.989000000000004,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 559.1609999999605,
"styleRecalcs": 48,
"styleRecalcDurationMs": 11.904,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 355.41100000000006,
"heapDeltaBytes": 13824204,
"heapUsedBytes": 83631704,
"domNodes": 22,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 142.914,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 564.3089999999802,
"styleRecalcs": 48,
"styleRecalcDurationMs": 11.1,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 391.11199999999997,
"heapDeltaBytes": 14162144,
"heapUsedBytes": 83967052,
"domNodes": 22,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 147.635,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2004.9490000000105,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.852,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 452.76300000000003,
"heapDeltaBytes": 5736548,
"heapUsedBytes": 75640932,
"domNodes": -275,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 6.9739999999999975,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2023.5030000000052,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.138999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 446.53899999999993,
"heapDeltaBytes": 6519292,
"heapUsedBytes": 76370980,
"domNodes": -277,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 7.327,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1727.1800000000326,
"styleRecalcs": 45,
"styleRecalcDurationMs": 15.090000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 618.4879999999999,
"heapDeltaBytes": 8929412,
"heapUsedBytes": 78887128,
"domNodes": -273,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 97.68299999999999,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1719.9030000000448,
"styleRecalcs": 46,
"styleRecalcDurationMs": 14.486,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 601.523,
"heapDeltaBytes": 9368460,
"heapUsedBytes": 78856172,
"domNodes": -273,
"jsHeapTotalBytes": 6545408,
"scriptDurationMs": 96.32400000000001,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 1352.4550000000772,
"styleRecalcs": 17,
"styleRecalcDurationMs": 27.539,
"layouts": 5,
"layoutDurationMs": 12.19,
"taskDurationMs": 872.0920000000001,
"heapDeltaBytes": -6308528,
"heapUsedBytes": 84853480,
"domNodes": 13667,
"jsHeapTotalBytes": 11010048,
"scriptDurationMs": 30.043,
"eventListeners": 2383,
"totalBlockingTimeMs": 124,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8358.859999999993,
"styleRecalcs": 250,
"styleRecalcDurationMs": 41.988,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5725.015,
"heapDeltaBytes": 1346124,
"heapUsedBytes": 81118292,
"domNodes": -242,
"jsHeapTotalBytes": 741376,
"scriptDurationMs": 2696.268,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8378.160999999978,
"styleRecalcs": 248,
"styleRecalcDurationMs": 38.157,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5930.263,
"heapDeltaBytes": 2187988,
"heapUsedBytes": 89579724,
"domNodes": -248,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 2992.1960000000004,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17323.49099999999,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17018.817,
"heapDeltaBytes": -42767340,
"heapUsedBytes": 194477580,
"domNodes": -8061,
"jsHeapTotalBytes": -15839232,
"scriptDurationMs": 295.06200000000007,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17182.069999999952,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16712.852,
"heapDeltaBytes": -20547796,
"heapUsedBytes": 193910672,
"domNodes": -8061,
"jsHeapTotalBytes": -7614464,
"scriptDurationMs": 278.313,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 20969.23399999997,
"styleRecalcs": 156,
"styleRecalcDurationMs": 17.71700000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20693.361,
"heapDeltaBytes": -44794080,
"heapUsedBytes": 180712484,
"domNodes": -8061,
"jsHeapTotalBytes": -15736832,
"scriptDurationMs": 858.997,
"eventListeners": -14928,
"totalBlockingTimeMs": 57,
"frameDurationMs": 18.33666666666674,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 21368.525999999976,
"styleRecalcs": 156,
"styleRecalcDurationMs": 18.53699999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21111.742,
"heapDeltaBytes": -53528820,
"heapUsedBytes": 167645712,
"domNodes": -8061,
"jsHeapTotalBytes": -10760192,
"scriptDurationMs": 868.841,
"eventListeners": -14928,
"totalBlockingTimeMs": 92,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 6103.496999999948,
"styleRecalcs": 20,
"styleRecalcDurationMs": 73.64299999999999,
"layouts": 20,
"layoutDurationMs": 24.249999999999993,
"taskDurationMs": 6028.901999999999,
"heapDeltaBytes": -46694416,
"heapUsedBytes": 194695924,
"domNodes": -8061,
"jsHeapTotalBytes": 9760768,
"scriptDurationMs": 109.64699999999999,
"eventListeners": -14928,
"totalBlockingTimeMs": 441,
"frameDurationMs": 17.776666666666703,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-node-resize-workload",
"durationMs": 6197.745999999938,
"styleRecalcs": 20,
"styleRecalcDurationMs": 75.67099999999999,
"layouts": 20,
"layoutDurationMs": 25.444999999999997,
"taskDurationMs": 6157.065000000001,
"heapDeltaBytes": -51276700,
"heapUsedBytes": 170480656,
"domNodes": -8061,
"jsHeapTotalBytes": 12263424,
"scriptDurationMs": 118.38900000000001,
"eventListeners": -14928,
"totalBlockingTimeMs": 413,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8821.009000000004,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8722.398,
"heapDeltaBytes": 5985004,
"heapUsedBytes": 190240708,
"domNodes": 0,
"jsHeapTotalBytes": -12320768,
"scriptDurationMs": 137.99700000000004,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8761.54000000008,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8654.221,
"heapDeltaBytes": 5145724,
"heapUsedBytes": 176939752,
"domNodes": 0,
"jsHeapTotalBytes": -11010048,
"scriptDurationMs": 134.82000000000005,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 461.2899999999627,
"styleRecalcs": 19,
"styleRecalcDurationMs": 31.823000000000004,
"layouts": 5,
"layoutDurationMs": 2.484,
"taskDurationMs": 150.38000000000002,
"heapDeltaBytes": 5274844,
"heapUsedBytes": 70758504,
"domNodes": 157,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 18.956999999999997,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 103.62599999996291,
"styleRecalcs": 7,
"styleRecalcDurationMs": 12.364000000000003,
"layouts": 2,
"layoutDurationMs": 0.9450000000000001,
"taskDurationMs": 71.00899999999999,
"heapDeltaBytes": 3066344,
"heapUsedBytes": 68738216,
"domNodes": 106,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.393999999999999,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E CoverageNote Shard completeness could not be verified for this run, so these totals may not be comparable with a whole merge.
Top 10 files by uncovered lines
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 1a6456b4a6ae3372779407f1e963e0092389c97d
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #18040 +/- ##
==========================================
+ Coverage 82.78% 84.36% +1.57%
==========================================
Files 2936 2284 -652
Lines 144482 130549 -13933
Branches 37152 36329 -823
==========================================
- Hits 119610 110137 -9473
+ Misses 23615 20116 -3499
+ Partials 1257 296 -961
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1044 files with indirect coverage changes 🚀 New features to boost your workflow:
|
1749842 to
12e6a72
Compare
*PR Created by the Glary-Bot Agent* --- Targets **#18040** (`fix/subgraph-release-serialization-mismatch`), not `main`. Test-only — no product code touched. Requested in [#bug-dump](https://comfy-organization.slack.com/archives/C0A4XMHANP3/p1789759844702229) as follow-up to the [FE-2497 RCA](https://linear.app/comfyorg/issue/FE-2497/bug-nested-subgraphs-disappear-after-wrapping-a-subgraph-in-another#comment-c0ca2d94). #18040 already fixes the root cause; this adds the coverage that pins the user-visible symptom. ## Why #18040's regression test catches the bug only through its telemetry side effect. Deleting its one `expect(reportError).not.toHaveBeenCalled()` line leaves the test **passing on pre-fix `main`**, because `serialiseStoredNodes` falls back to live-node serialization and its remaining assertions only check node *types*: ``` $ # on main (bug present), PR 18040's test with the reportError assertion removed Test Files 1 passed (1) Tests 1 passed (1) [inner def on main] {"nodes":2,"links":0} <-- links destroyed, test still green ``` So the thing FE-2497 was actually reported for — every internal link gone, interior unrenderable — is unpinned. If the mismatch detector is ever moved, throttled, or reworded, the regression walks straight back in. ## What this adds **Vitest** (`SubgraphConversion.nestedDefinitions.test.ts`) — asserts the symptom directly via a `captureHealth` snapshot of interior nodes, links, layout records, the serialized round trip, and reported errors, held across a table of four selection shapes plus a three-deep nest: | shape | rationale | | --- | --- | | host selected on its own | minimal trigger | | host selected alongside a plain sibling | the reported scenario | | host wrapped twice in a row | repeated conversion | | host wrapped from inside the subgraph that owns it | non-root parent graph | | three-deep nest, outermost host wrapped | `collectSubgraphsPostOrder` releases the whole subtree | **Playwright** (`browser_tests/tests/subgraph/subgraphWrapNestedDefinition.spec.ts`) — uses the existing `assets/subgraphs/nested-subgraph` asset, whose shape matches the report exactly (`root → subgraph 2 → subgraph 3`). Three lenses on one wrap: live definition inventory, the saved workflow after `serializeAndReload()`, and navigating into the deepest interior to assert it still renders. **Fixture** (`SubgraphHelper`) — `getDefinitionInventory()` / `getSerializedDefinitionInventory()` return one row per definition sorted by name (an array, not a name-keyed object, since `Convert to Subgraph` names every new definition `New Subgraph`), and `descendSubgraphs(levels)` which requires exactly one subgraph node per level before descending. ## Red / green Reverting only #18040's two-line product change, with the tests unchanged: ``` Vitest 6 failed (6) -> 6 passed (6) Playwright 3 failed -> 3 passed ``` The browser failures are the reported symptom verbatim — `subgraph 2` links `7 -> 0`, `subgraph 3` links `6 -> 0`, and zero Vue nodes rendered in the interior: ``` - "links": 7 + "links": 0 - "links": 6 + "links": 0 Error: expect(locator).toBeVisible() failed — element(s) not found ``` ## Visual proof Captured against a live ComfyUI backend + dev server, navigating to the deepest nested subgraph after the wrap. The broken capture reproduces the reporter's screenshot pixel for pixel — empty canvas with only the subgraph IO node stub. ## Notes for review - **`'New Subgraph': links: 4` is correct**, verified by dumping the live wrapper. The 4th is a boundary link, `-10:0 -> 9:1 (STRING)`: conversion promotes `Save Image`'s `filename_prefix` widget to a wrapper input. Counting only the asset's three explicit root links gives 3 and is wrong — there is a comment on the constant so it doesn't get "corrected". - `layoutStore.resetForTests()` was added to the `beforeEach`. Fixture UUIDs reset per test, so every test reused the same layout-store keys and stale entries could have masked a regression where conversion fails to *recreate* layout rather than deleting it. - The three-deep test's `middle` subgraph is now built from two connected nodes so it carries a real link — previously `interiorNodesWithLayout` was its only load-bearing field. - `reportedErrors` folded into `captureHealth` restores #18040's telemetry guard across all five new cases. - No `test.fail` markers: #18040 fixes this class completely. I probed the adjacent paths it deferred — delete+undo and copy/paste of a subgraph host — and both are healthy (delete correctly releases, undo fully restores 7/6 links). Nothing is left failing to mark. ## Verification - `pnpm typecheck` / `pnpm typecheck:browser`: clean - `eslint`, `oxlint`, `oxfmt --check`: 0 errors (3 pre-existing `import-x/no-restricted-paths` warnings; `LGraph.ts` itself imports `layoutStore`, as do 25 files under `src/lib/litegraph/`) - `vitest run src/lib/litegraph/src/subgraph/`: 19 files, 361 passed - `playwright test browser_tests/tests/subgraph/ --project=chromium`: 145 passed, 2 failed — `subgraphDraftPositions` and `subgraphSeed`, both of which fail identically on this branch with my changes stashed (sandbox reload timeout and a generation-dependent test) - Reviewed by the `deep-reviewer` sub-agent; all actionable findings applied. Its one blocking finding claimed `links: 4` should be `3` — disproved empirically above, and it had flagged the browser suite as unrunnable in its own session. ## Screenshots     --------- Co-authored-by: glary-bot <bot@comfy.org>
Playwright videos for new testsDownload the recorded videos and HTML report Recorded projects: chromium Recorded test titles:
|
dante01yoon
left a comment
There was a problem hiding this comment.
Reviewed at 3185562a757b98d2cd76279fcb7429c018b762ab. Read-only review; I could not run the suite locally (no dependency install in this environment), so everything below is source-level verification against the merge base plus CI evidence.
Bug premise: verified real
This is a fix:, so I traced the whole chain on the merge base (3c5f47df39) rather than taking the description's word for it:
LGraph.ts:2183capturesmultiClone(nodes)beforeLGraph.ts:2255runsfor (const node of nodes) this.remove(node), so the originals are already gone whencreateSubgraph(data)configures the new definition.LGraph.ts:1511releases unconditionally for aSubgraphNode, andfindReleasableSubgraphs(subgraphUtils.ts:557) excludes the node being removed when it computes live ids — so a sole instance's definition, plus its whole nested subtree viacollectSubgraphsPostOrder, comes back as releasable.releaseSubgraphs(LGraph.ts:1576) runsunregisterAllLinkTopologies,detachAllNodesFromStores,detachGraphLayoutsandrootGraph.subgraphs.delete(id)— and never clearssubgraph._nodes.registerSubgraphNodeDef(litegraphService.ts:408) registersclass ComfyNode extends SubgraphNodewhose constructor issuper(app.rootGraph, subgraph, instanceData), closing over that exact instance — so the host re-created inside the new subgraph points at the released one.add()atLGraph.ts:1417-1421walksforEachNode(node.subgraph, …)and re-inserts nested definitions back intorootGraph.subgraphs.serialiseStoredNodes(LGraph.ts:407) then finds live_nodesagainst zero stored states and emits exactlygraph_serialization_state_mismatchwithlive node N has no stored stateand the subgraph'sgraphId, falling back to live-node serialization.
That is precisely the RUM signature quoted in the description, so this fixes a real defect rather than a hypothesised one. The fix itself is client-side graph lifecycle only — nothing here synthesises state that should come from the server.
The new tests can fail for the reason they claim
The load-bearing detail is that LGraph.links is a store-backed LinkMap (LinkMap.size delegates to linkStore.graphTopologies(scope)), and unregisterAllLinkTopologies deletes those topologies via useLinkStore().deleteLink(...). So on main both definition.links.size and the serialized links collapse to 0. That makes captureHealth's links/serialisedLinks, the e2e inventories' links (7 and 6), the layout test's positions (dropped by detachGraphLayouts) and reportedErrors: 0 all genuinely flip on main. vite.config.mts:890-891 sets mockReset/restoreMocks, so the reportError counter is per-test rather than an accumulating artefact.
One honest caveat, since it looks like a discriminator but isn't: the nodes: counts on their own would not fail on main, because release never touches _nodes. They're asserted jointly inside a single toEqual with the fields that do flip, so every assertion still fails — but the nodes column is carrying less weight than it appears to.
Scope and house rules
Production change is 5 lines in one file (LGraph.ts +5/−2); the remaining 416 lines are tests. The 356 lines beyond the original unit test came in via stacked PR #18159, which targeted this branch and was reviewed separately — extra coverage for the same defect, not unrelated work riding along. No server/API response types are introduced: the only new interfaces (SubgraphDefinitionRow / SubgraphDefinitionInventory) are local projections of client-side litegraph state read through page.evaluate, and there is no public HTTP API surface or generated file touched here.
No regression to the other removal paths
The option defaults to undefined and only _convertToSubgraphImpl passes it, so the delete paths still release — confirmed against SubgraphDuplicateDeleteOrder.test.ts:195,288-289, which assert subgraphs.has(...) === false through plain rootGraph.remove(...). CI at this head is green: 86 checks pass, 0 fail (15 skipped are conditional jobs), and Playwright reports 2062 passed / 0 failed / 2 flaky. @slow is not in the chromium project's grepInvert (playwright.config.ts:94), so the new e2e spec genuinely executes in CI.
Approving — one non-blocking suggestion inline, and a description nit below.
Unanchored
nit-pick (non-blocking): PR description drift against head, both description-only and not code problems:
- The Changes section still lists only
src/lib/litegraph/src/subgraph/SubgraphConversion.nestedDefinitions.test.ts, but head also addsbrowser_tests/fixtures/helpers/SubgraphHelper.ts,browser_tests/tests/subgraph/subgraphWrapNestedDefinition.spec.tsandsrc/renderer/core/layout/operations/subgraphConversionLayout.test.ts(+356 lines, via #18159). A reader sizing the change from the description will undercount the test surface. - The Red / green section says CI should be red on the test-only commit, but
repos/Comfy-Org/ComfyUI_frontend/commits/c478989b7a/check-runsreturns no check runs at all — that commit was never built here, so the red/green evidence is local-only. Worth stating as local verification rather than as a CI expectation. (I reached the same conclusion from source, so this doesn't change the outcome.)
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 4 finding(s).
| Severity | Count |
|---|---|
| 🟡 Medium | 1 |
| 🟢 Low | 2 |
| ⚪ Nit | 1 |
Panel: 8/8 reviewers contributed findings.
…subgraph (#18040) <!-- ccr-slack-attribution --> _Requested via [Slack thread](https://comfy-organization.slack.com/archives/C09KFK2ABB8/p1788424987450979?thread_ts=1788424987.450979&cid=C09KFK2ABB8)_ ## ELI5 Converting a selection to a subgraph is like packing a box into a bigger box. If the small box was the only one of its kind, the code threw away its packing list the moment it left the shelf, then put the box in the bigger box anyway. Every later save found a box with no list and raised an alarm. Now the packing list survives the move, because the box is being re-shelved, not discarded. ## Motivation `graph_serialization_state_mismatch` is currently the most frequent error type from `serialiseStoredNodes` in production. Datadog RUM shows nearly all of those events as "live node N has no stored state" with a subgraph `graphId`, in sessions that used Convert Selection to Subgraph, Unpack, or New Subgraph. The report fires on every save until reload, and the serialized definition for that subgraph falls back to live-node serialization, so the node store and the saved workflow disagree for the rest of the session. Fixing the trigger in the conversion path removes the dominant source of the alert. ## Provenance - **Authored by:** interactive session - **Verified:** `pnpm vitest run src/lib/litegraph/src/subgraph/SubgraphConversion.nestedDefinitions.test.ts`: 1 failed on the test-only commit ("live node 1 has no stored state"), 1 passed with the fix; `pnpm vitest run src/lib/litegraph/src/subgraph/`: 19 files, 356 passed; `pnpm vitest run src/lib/litegraph/src/LGraph` plus every test file referencing `releaseSubgraphs`, `convertToSubgraph`, `unpackSubgraph`, `findReleasableSubgraphs` or `detachAllNodesFromStores`: 46 files, 648 passed, 7 expected fail, 5 skipped; `pnpm typecheck` (via the pre-commit hook on both commits): clean; `eslint` and `oxlint --type-aware` on the two changed files: 0 errors; `oxfmt --check`: clean; `pnpm knip`: clean - **Deviations:** unknown ## Reviewer context - **Type:** bug fix, litegraph subgraph lifecycle - **Slots into:** no project or epic; ad-hoc production error fix - **Not in scope:** the general hazard that a registered subgraph node type keeps a closure over a released `Subgraph` instance and `LGraph.add()` re-inserts it into `rootGraph.subgraphs` without node state. This PR removes the trigger seen in production; hardening `releaseSubgraphs` / `add()` against resurrection is a follow-up. ## Summary - Convert-to-subgraph no longer releases the subgraph definitions referenced by the nodes it is about to re-create inside the new subgraph. - Adds a regression test that fails on `main` with the production mismatch report and passes with the fix. **Before:** convert nodes A and B into subgraph S1 (host node H1). Then select H1 plus another node and convert that into S2. Serializing the root graph reports `Graph serialization state mismatch` with `mismatch: "live node A has no stored state"` and `graphId: S1`, on every save until reload. **After:** the same sequence serializes cleanly. S1 stays a valid definition, nested inside S2, with all of its nodes stored. **Mechanism:** 1. `_convertToSubgraphImpl` removes the selected nodes with `this.remove(node)` before configuring the new subgraph from the serialized selection. 2. `removeNode` sees that H1 is a `SubgraphNode` and calls `releaseSubgraphs(findReleasableSubgraphs(...))`. H1 was S1's only instance, so S1 is released: its node store records are deleted and it is dropped from `rootGraph.subgraphs`, but the `Subgraph` instance keeps its `_nodes`. 3. The registered node type for S1 is a class whose constructor closes over that same `Subgraph` instance, so `LiteGraph.createNode(S1.id)` inside S2's configure returns a host pointing at the released instance. 4. `LGraph.add()` walks nested subgraph nodes and re-inserts S1 into `rootGraph.subgraphs`. S1 now has live nodes and zero stored state, and `serialiseStoredNodes` reports the mismatch on every serialize. **Fix choice:** option (a), skip the release for nodes that the conversion is moving. Every node removed in that loop is re-created inside the new subgraph from the same serialized data, so the set of definitions in use is identical before and after the operation and nothing should be released. This is a three-line change behind a new `GraphRemoveOptions.preserveSubgraphDefinitions` flag, used only by `_convertToSubgraphImpl`. The alternative (tearing down released instances fully and teaching `add()` to re-attach or refuse them) touches the release and add paths for every caller and is a broader behavioral change; unregistering the node type is not viable because the nested host inside the new subgraph is created through that type. ## Changes - **What**: `GraphRemoveOptions.preserveSubgraphDefinitions`; `removeNode` skips `releaseSubgraphs` when it is set; `_convertToSubgraphImpl` passes it when removing the moved nodes. New test `src/lib/litegraph/src/subgraph/SubgraphConversion.nestedDefinitions.test.ts`. If `createSubgraph` throws after the originals are removed, `_convertToSubgraphImpl` releases the removed nodes' definitions that no live node still references (`findOrphanedSubgraphs` in `subgraphUtils.ts`) and rethrows, so a failed conversion leaves no orphaned definitions registered. ## Red / green The first commit adds only the failing test (CI should be red on it), the second commit adds the fix (CI should be green). Unpack was checked and is not affected by this trigger: it materializes the inner nodes into the parent before removing the host, so the definitions are still live when the host is released. ## Review Focus - `findReleasableSubgraphs` is still called for every other removal path (delete, undo, unpack), so nothing else changes behavior. - If a moved node's type cannot be re-created inside the new subgraph, its definition stays registered but unused; `findUsedSubgraphIds` already excludes unused definitions from serialization. ## Test plan - [ ] CI red on the test-only commit, green on the fix commit - [ ] Convert nodes to a subgraph, then convert a selection containing that subgraph's host into another subgraph, save: no `graph_serialization_state_mismatch` in the console or RUM - [ ] Unpack the outer subgraph afterwards and save again: still clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01TsajsCwfDusee9F9rPWNb7 --- _Generated by [Claude Code](https://claude.ai/code/session_01TsajsCwfDusee9F9rPWNb7)_ --------- Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: glary-bot <bot@comfy.org>
…subgraph (#18040) <!-- ccr-slack-attribution --> _Requested via [Slack thread](https://comfy-organization.slack.com/archives/C09KFK2ABB8/p1788424987450979?thread_ts=1788424987.450979&cid=C09KFK2ABB8)_ ## ELI5 Converting a selection to a subgraph is like packing a box into a bigger box. If the small box was the only one of its kind, the code threw away its packing list the moment it left the shelf, then put the box in the bigger box anyway. Every later save found a box with no list and raised an alarm. Now the packing list survives the move, because the box is being re-shelved, not discarded. ## Motivation `graph_serialization_state_mismatch` is currently the most frequent error type from `serialiseStoredNodes` in production. Datadog RUM shows nearly all of those events as "live node N has no stored state" with a subgraph `graphId`, in sessions that used Convert Selection to Subgraph, Unpack, or New Subgraph. The report fires on every save until reload, and the serialized definition for that subgraph falls back to live-node serialization, so the node store and the saved workflow disagree for the rest of the session. Fixing the trigger in the conversion path removes the dominant source of the alert. ## Provenance - **Authored by:** interactive session - **Verified:** `pnpm vitest run src/lib/litegraph/src/subgraph/SubgraphConversion.nestedDefinitions.test.ts`: 1 failed on the test-only commit ("live node 1 has no stored state"), 1 passed with the fix; `pnpm vitest run src/lib/litegraph/src/subgraph/`: 19 files, 356 passed; `pnpm vitest run src/lib/litegraph/src/LGraph` plus every test file referencing `releaseSubgraphs`, `convertToSubgraph`, `unpackSubgraph`, `findReleasableSubgraphs` or `detachAllNodesFromStores`: 46 files, 648 passed, 7 expected fail, 5 skipped; `pnpm typecheck` (via the pre-commit hook on both commits): clean; `eslint` and `oxlint --type-aware` on the two changed files: 0 errors; `oxfmt --check`: clean; `pnpm knip`: clean - **Deviations:** unknown ## Reviewer context - **Type:** bug fix, litegraph subgraph lifecycle - **Slots into:** no project or epic; ad-hoc production error fix - **Not in scope:** the general hazard that a registered subgraph node type keeps a closure over a released `Subgraph` instance and `LGraph.add()` re-inserts it into `rootGraph.subgraphs` without node state. This PR removes the trigger seen in production; hardening `releaseSubgraphs` / `add()` against resurrection is a follow-up. ## Summary - Convert-to-subgraph no longer releases the subgraph definitions referenced by the nodes it is about to re-create inside the new subgraph. - Adds a regression test that fails on `main` with the production mismatch report and passes with the fix. **Before:** convert nodes A and B into subgraph S1 (host node H1). Then select H1 plus another node and convert that into S2. Serializing the root graph reports `Graph serialization state mismatch` with `mismatch: "live node A has no stored state"` and `graphId: S1`, on every save until reload. **After:** the same sequence serializes cleanly. S1 stays a valid definition, nested inside S2, with all of its nodes stored. **Mechanism:** 1. `_convertToSubgraphImpl` removes the selected nodes with `this.remove(node)` before configuring the new subgraph from the serialized selection. 2. `removeNode` sees that H1 is a `SubgraphNode` and calls `releaseSubgraphs(findReleasableSubgraphs(...))`. H1 was S1's only instance, so S1 is released: its node store records are deleted and it is dropped from `rootGraph.subgraphs`, but the `Subgraph` instance keeps its `_nodes`. 3. The registered node type for S1 is a class whose constructor closes over that same `Subgraph` instance, so `LiteGraph.createNode(S1.id)` inside S2's configure returns a host pointing at the released instance. 4. `LGraph.add()` walks nested subgraph nodes and re-inserts S1 into `rootGraph.subgraphs`. S1 now has live nodes and zero stored state, and `serialiseStoredNodes` reports the mismatch on every serialize. **Fix choice:** option (a), skip the release for nodes that the conversion is moving. Every node removed in that loop is re-created inside the new subgraph from the same serialized data, so the set of definitions in use is identical before and after the operation and nothing should be released. This is a three-line change behind a new `GraphRemoveOptions.preserveSubgraphDefinitions` flag, used only by `_convertToSubgraphImpl`. The alternative (tearing down released instances fully and teaching `add()` to re-attach or refuse them) touches the release and add paths for every caller and is a broader behavioral change; unregistering the node type is not viable because the nested host inside the new subgraph is created through that type. ## Changes - **What**: `GraphRemoveOptions.preserveSubgraphDefinitions`; `removeNode` skips `releaseSubgraphs` when it is set; `_convertToSubgraphImpl` passes it when removing the moved nodes. New test `src/lib/litegraph/src/subgraph/SubgraphConversion.nestedDefinitions.test.ts`. If `createSubgraph` throws after the originals are removed, `_convertToSubgraphImpl` releases the removed nodes' definitions that no live node still references (`findOrphanedSubgraphs` in `subgraphUtils.ts`) and rethrows, so a failed conversion leaves no orphaned definitions registered. ## Red / green The first commit adds only the failing test (CI should be red on it), the second commit adds the fix (CI should be green). Unpack was checked and is not affected by this trigger: it materializes the inner nodes into the parent before removing the host, so the definitions are still live when the host is released. ## Review Focus - `findReleasableSubgraphs` is still called for every other removal path (delete, undo, unpack), so nothing else changes behavior. - If a moved node's type cannot be re-created inside the new subgraph, its definition stays registered but unused; `findUsedSubgraphIds` already excludes unused definitions from serialization. ## Test plan - [ ] CI red on the test-only commit, green on the fix commit - [ ] Convert nodes to a subgraph, then convert a selection containing that subgraph's host into another subgraph, save: no `graph_serialization_state_mismatch` in the console or RUM - [ ] Unpack the outer subgraph afterwards and save again: still clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01TsajsCwfDusee9F9rPWNb7 --- _Generated by [Claude Code](https://claude.ai/code/session_01TsajsCwfDusee9F9rPWNb7)_ --------- Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: glary-bot <bot@comfy.org>
|
|
Requested via Slack thread
ELI5
Converting a selection to a subgraph is like packing a box into a bigger box. If the small box was the only one of its kind, the code threw away its packing list the moment it left the shelf, then put the box in the bigger box anyway. Every later save found a box with no list and raised an alarm. Now the packing list survives the move, because the box is being re-shelved, not discarded.
Motivation
graph_serialization_state_mismatchis currently the most frequent error type fromserialiseStoredNodesin production. Datadog RUM shows nearly all of those events as "live node N has no stored state" with a subgraphgraphId, in sessions that used Convert Selection to Subgraph, Unpack, or New Subgraph. The report fires on every save until reload, and the serialized definition for that subgraph falls back to live-node serialization, so the node store and the saved workflow disagree for the rest of the session. Fixing the trigger in the conversion path removes the dominant source of the alert.Provenance
pnpm vitest run src/lib/litegraph/src/subgraph/SubgraphConversion.nestedDefinitions.test.ts: 1 failed on the test-only commit ("live node 1 has no stored state"), 1 passed with the fix;pnpm vitest run src/lib/litegraph/src/subgraph/: 19 files, 356 passed;pnpm vitest run src/lib/litegraph/src/LGraphplus every test file referencingreleaseSubgraphs,convertToSubgraph,unpackSubgraph,findReleasableSubgraphsordetachAllNodesFromStores: 46 files, 648 passed, 7 expected fail, 5 skipped;pnpm typecheck(via the pre-commit hook on both commits): clean;eslintandoxlint --type-awareon the two changed files: 0 errors;oxfmt --check: clean;pnpm knip: cleanReviewer context
Subgraphinstance andLGraph.add()re-inserts it intorootGraph.subgraphswithout node state. This PR removes the trigger seen in production; hardeningreleaseSubgraphs/add()against resurrection is a follow-up.Summary
mainwith the production mismatch report and passes with the fix.Before: convert nodes A and B into subgraph S1 (host node H1). Then select H1 plus another node and convert that into S2. Serializing the root graph reports
Graph serialization state mismatchwithmismatch: "live node A has no stored state"andgraphId: S1, on every save until reload.After: the same sequence serializes cleanly. S1 stays a valid definition, nested inside S2, with all of its nodes stored.
Mechanism:
_convertToSubgraphImplremoves the selected nodes withthis.remove(node)before configuring the new subgraph from the serialized selection.removeNodesees that H1 is aSubgraphNodeand callsreleaseSubgraphs(findReleasableSubgraphs(...)). H1 was S1's only instance, so S1 is released: its node store records are deleted and it is dropped fromrootGraph.subgraphs, but theSubgraphinstance keeps its_nodes.Subgraphinstance, soLiteGraph.createNode(S1.id)inside S2's configure returns a host pointing at the released instance.LGraph.add()walks nested subgraph nodes and re-inserts S1 intorootGraph.subgraphs. S1 now has live nodes and zero stored state, andserialiseStoredNodesreports the mismatch on every serialize.Fix choice: option (a), skip the release for nodes that the conversion is moving. Every node removed in that loop is re-created inside the new subgraph from the same serialized data, so the set of definitions in use is identical before and after the operation and nothing should be released. This is a three-line change behind a new
GraphRemoveOptions.preserveSubgraphDefinitionsflag, used only by_convertToSubgraphImpl. The alternative (tearing down released instances fully and teachingadd()to re-attach or refuse them) touches the release and add paths for every caller and is a broader behavioral change; unregistering the node type is not viable because the nested host inside the new subgraph is created through that type.Changes
GraphRemoveOptions.preserveSubgraphDefinitions;removeNodeskipsreleaseSubgraphswhen it is set;_convertToSubgraphImplpasses it when removing the moved nodes. New testsrc/lib/litegraph/src/subgraph/SubgraphConversion.nestedDefinitions.test.ts. IfcreateSubgraphthrows after the originals are removed,_convertToSubgraphImplreleases the removed nodes' definitions that no live node still references (findOrphanedSubgraphsinsubgraphUtils.ts) and rethrows, so a failed conversion leaves no orphaned definitions registered.Red / green
The first commit adds only the failing test (CI should be red on it), the second commit adds the fix (CI should be green). Unpack was checked and is not affected by this trigger: it materializes the inner nodes into the parent before removing the host, so the definitions are still live when the host is released.
Review Focus
findReleasableSubgraphsis still called for every other removal path (delete, undo, unpack), so nothing else changes behavior.findUsedSubgraphIdsalready excludes unused definitions from serialization.Test plan
graph_serialization_state_mismatchin the console or RUM🤖 Generated with Claude Code
https://claude.ai/code/session_01TsajsCwfDusee9F9rPWNb7
Generated by Claude Code