Repository navigation
refactor: preserve subgraph topology during unpack - #15018
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughSubgraph unpacking now resolves external input links directly from link objects, preserves serialized link definitions, and remaps internal targets without mutating link data. A regression test covers shared link definitions and parent-node remapping. ChangesSubgraph link reconstruction
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized refactor preserves subgraph topology during unpack without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review. Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1813 passed, 0 failed · 2 flaky📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-08-15T00:44:32.940Z",
"gitSha": "a4be732853676fa75d682e29c923ae6affa14716",
"branch": "drjkl/split-link-replacement",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2050.4569999999944,
"styleRecalcs": 6,
"styleRecalcDurationMs": 6.402999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 573.596,
"heapDeltaBytes": 8519744,
"heapUsedBytes": 77203752,
"domNodes": 12,
"jsHeapTotalBytes": 20971520,
"scriptDurationMs": 34.613,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2054.689000000053,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.375,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 489.63800000000003,
"heapDeltaBytes": 8116368,
"heapUsedBytes": 76970332,
"domNodes": 16,
"jsHeapTotalBytes": 20971520,
"scriptDurationMs": 28.122,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2461.4199999999755,
"styleRecalcs": 80,
"styleRecalcDurationMs": 45.715,
"layouts": 12,
"layoutDurationMs": 3.913,
"taskDurationMs": 1478.517,
"heapDeltaBytes": -16241008,
"heapUsedBytes": 52464196,
"domNodes": -282,
"jsHeapTotalBytes": 21336064,
"scriptDurationMs": 196.73000000000002,
"eventListeners": -187,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2224.164000000087,
"styleRecalcs": 79,
"styleRecalcDurationMs": 42.612,
"layouts": 12,
"layoutDurationMs": 3.6100000000000003,
"taskDurationMs": 1249.617,
"heapDeltaBytes": 891300,
"heapUsedBytes": 69439900,
"domNodes": -280,
"jsHeapTotalBytes": 21073920,
"scriptDurationMs": 175.25099999999998,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1737.3900000000049,
"styleRecalcs": 32,
"styleRecalcDurationMs": 17.759,
"layouts": 6,
"layoutDurationMs": 0.5929999999999999,
"taskDurationMs": 407.117,
"heapDeltaBytes": -15942092,
"heapUsedBytes": 52846472,
"domNodes": 76,
"jsHeapTotalBytes": 20709376,
"scriptDurationMs": 30.694000000000003,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1709.7219999999425,
"styleRecalcs": 30,
"styleRecalcDurationMs": 16.488999999999997,
"layouts": 6,
"layoutDurationMs": 0.7129999999999999,
"taskDurationMs": 396.65000000000003,
"heapDeltaBytes": -16095676,
"heapUsedBytes": 52517060,
"domNodes": 76,
"jsHeapTotalBytes": 20709376,
"scriptDurationMs": 29.57,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 787.5239999999621,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.549000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 489.32200000000006,
"heapDeltaBytes": -2136940,
"heapUsedBytes": 66563772,
"domNodes": 16,
"jsHeapTotalBytes": 21233664,
"scriptDurationMs": 41.598000000000006,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 756.4959999999701,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.0969999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 460.55500000000006,
"heapDeltaBytes": -2189084,
"heapUsedBytes": 66517348,
"domNodes": 16,
"jsHeapTotalBytes": 21495808,
"scriptDurationMs": 39.791,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2054.3420000000197,
"styleRecalcs": 5,
"styleRecalcDurationMs": 4.665000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 879.972,
"heapDeltaBytes": 4956396,
"heapUsedBytes": 68614892,
"domNodes": -280,
"jsHeapTotalBytes": 2719744,
"scriptDurationMs": 330.356,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2045.05400000005,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.905000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 806.662,
"heapDeltaBytes": 4790168,
"heapUsedBytes": 70081816,
"domNodes": -284,
"jsHeapTotalBytes": 1933312,
"scriptDurationMs": 308.196,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 3863.4159999999724,
"styleRecalcs": 65,
"styleRecalcDurationMs": 10.100999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3006.442,
"heapDeltaBytes": 21494876,
"heapUsedBytes": 87924784,
"domNodes": -284,
"jsHeapTotalBytes": 3436544,
"scriptDurationMs": 1434.36,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-pan",
"durationMs": 3506.389000000013,
"styleRecalcs": 66,
"styleRecalcDurationMs": 10.441,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2819.381,
"heapDeltaBytes": 22824800,
"heapUsedBytes": 87245396,
"domNodes": -285,
"jsHeapTotalBytes": 4485120,
"scriptDurationMs": 1313.0739999999998,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666636,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 5166.567999999984,
"styleRecalcs": 67,
"styleRecalcDurationMs": 12.424000000000001,
"layouts": 60,
"layoutDurationMs": 7.4110000000000005,
"taskDurationMs": 3176.5080000000003,
"heapDeltaBytes": -13280040,
"heapUsedBytes": 58454892,
"domNodes": -264,
"jsHeapTotalBytes": 4030464,
"scriptDurationMs": 1522.818,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 4925.613999999996,
"styleRecalcs": 66,
"styleRecalcDurationMs": 10.824,
"layouts": 60,
"layoutDurationMs": 7.254,
"taskDurationMs": 2893.366,
"heapDeltaBytes": -5382388,
"heapUsedBytes": 67056676,
"domNodes": 24,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 1389.5610000000001,
"eventListeners": 12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 4187.787000000015,
"styleRecalcs": 41,
"styleRecalcDurationMs": 4.329,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2889.6949999999997,
"heapDeltaBytes": -12137400,
"heapUsedBytes": 59788440,
"domNodes": -288,
"jsHeapTotalBytes": 9797632,
"scriptDurationMs": 773.499,
"eventListeners": -108,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 4195.549000000028,
"styleRecalcs": 43,
"styleRecalcDurationMs": 5.716000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2801.362,
"heapDeltaBytes": -11606648,
"heapUsedBytes": 59619752,
"domNodes": -285,
"jsHeapTotalBytes": 9797632,
"scriptDurationMs": 738.051,
"eventListeners": -108,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2054.079999999999,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.944999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 899.1310000000001,
"heapDeltaBytes": -1667164,
"heapUsedBytes": 65330800,
"domNodes": -282,
"jsHeapTotalBytes": 2457600,
"scriptDurationMs": 336.79,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2038.5519999999815,
"styleRecalcs": 2,
"styleRecalcDurationMs": 1.3330000000000009,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 822.202,
"heapDeltaBytes": 6071352,
"heapUsedBytes": 73006752,
"domNodes": -284,
"jsHeapTotalBytes": 2457600,
"scriptDurationMs": 316.29799999999994,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 756.0339999999997,
"styleRecalcs": 45,
"styleRecalcDurationMs": 9.663,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 564.8409999999999,
"heapDeltaBytes": -4821508,
"heapUsedBytes": 64372192,
"domNodes": 16,
"jsHeapTotalBytes": 21757952,
"scriptDurationMs": 145.009,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 743.0679999999938,
"styleRecalcs": 45,
"styleRecalcDurationMs": 8.465,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 525.182,
"heapDeltaBytes": -4885224,
"heapUsedBytes": 64300048,
"domNodes": 16,
"jsHeapTotalBytes": 22282240,
"scriptDurationMs": 137.54,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2038.5180000000105,
"styleRecalcs": 10,
"styleRecalcDurationMs": 10.093,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 584.75,
"heapDeltaBytes": -17676508,
"heapUsedBytes": 51552208,
"domNodes": -297,
"jsHeapTotalBytes": 19894272,
"scriptDurationMs": 25.645999999999997,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2022.2239999999374,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.507000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 512.504,
"heapDeltaBytes": -20669844,
"heapUsedBytes": 48631068,
"domNodes": -296,
"jsHeapTotalBytes": 19369984,
"scriptDurationMs": 19.939,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1922.050000000013,
"styleRecalcs": 79,
"styleRecalcDurationMs": 42.035000000000004,
"layouts": 16,
"layoutDurationMs": 4.699,
"taskDurationMs": 1180.472,
"heapDeltaBytes": -11789132,
"heapUsedBytes": 57491392,
"domNodes": -296,
"jsHeapTotalBytes": 20418560,
"scriptDurationMs": 126.45100000000001,
"eventListeners": -203,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1805.9799999999768,
"styleRecalcs": 75,
"styleRecalcDurationMs": 34.111000000000004,
"layouts": 16,
"layoutDurationMs": 4.008,
"taskDurationMs": 1095.966,
"heapDeltaBytes": -22571396,
"heapUsedBytes": 46712800,
"domNodes": 18,
"jsHeapTotalBytes": 19107840,
"scriptDurationMs": 116.513,
"eventListeners": -233,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 1401.1879999999337,
"styleRecalcs": 19,
"styleRecalcDurationMs": 30.191999999999997,
"layouts": 15,
"layoutDurationMs": 12.536999999999999,
"taskDurationMs": 998.5239999999998,
"heapDeltaBytes": 28365988,
"heapUsedBytes": 92669960,
"domNodes": 13671,
"jsHeapTotalBytes": 12058624,
"scriptDurationMs": 50.861000000000004,
"eventListeners": 2381,
"totalBlockingTimeMs": 132,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 14668.611999999996,
"styleRecalcs": 246,
"styleRecalcDurationMs": 36.36000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10912.98,
"heapDeltaBytes": 17312936,
"heapUsedBytes": 81908076,
"domNodes": -281,
"jsHeapTotalBytes": 4485120,
"scriptDurationMs": 5069.445,
"eventListeners": -123,
"totalBlockingTimeMs": 1,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 13425.815000000057,
"styleRecalcs": 248,
"styleRecalcDurationMs": 34.296,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9928.511999999999,
"heapDeltaBytes": 27714448,
"heapUsedBytes": 90685560,
"domNodes": -280,
"jsHeapTotalBytes": 5271552,
"scriptDurationMs": 4623.695,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 18005.496999999992,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17982.873000000003,
"heapDeltaBytes": -26497892,
"heapUsedBytes": 164903184,
"domNodes": -6548,
"jsHeapTotalBytes": 2678784,
"scriptDurationMs": 1256.331,
"eventListeners": -7469,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.330000000000048,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 18268.103999999992,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18245.664999999997,
"heapDeltaBytes": -39244636,
"heapUsedBytes": 166788200,
"domNodes": -6548,
"jsHeapTotalBytes": 3203072,
"scriptDurationMs": 1284.108,
"eventListeners": -7469,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 22530.819000000007,
"styleRecalcs": 170,
"styleRecalcDurationMs": 23.554999999999993,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22507.097999999998,
"heapDeltaBytes": -32663040,
"heapUsedBytes": 159784476,
"domNodes": -6548,
"jsHeapTotalBytes": 3465216,
"scriptDurationMs": 1841.811,
"eventListeners": -7465,
"totalBlockingTimeMs": 740,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 22723.094999999943,
"styleRecalcs": 173,
"styleRecalcDurationMs": 25.10899999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22702.559,
"heapDeltaBytes": -21796256,
"heapUsedBytes": 167598780,
"domNodes": -6548,
"jsHeapTotalBytes": 2940928,
"scriptDurationMs": 1831.473,
"eventListeners": -7467,
"totalBlockingTimeMs": 744,
"frameDurationMs": 18.330000000000048,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 472.60099999994054,
"styleRecalcs": 19,
"styleRecalcDurationMs": 24.958000000000002,
"layouts": 4,
"layoutDurationMs": 1.4950000000000003,
"taskDurationMs": 147.84099999999998,
"heapDeltaBytes": -13817524,
"heapUsedBytes": 52899580,
"domNodes": 150,
"jsHeapTotalBytes": 9175040,
"scriptDurationMs": 10.947999999999999,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 475.0649999999723,
"styleRecalcs": 15,
"styleRecalcDurationMs": 25.384999999999998,
"layouts": 3,
"layoutDurationMs": 0.741,
"taskDurationMs": 137.60699999999997,
"heapDeltaBytes": -14138652,
"heapUsedBytes": 52236144,
"domNodes": 123,
"jsHeapTotalBytes": 9961472,
"scriptDurationMs": 11.454,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## feature/ecs-migration #15018 +/- ##
========================================================
Coverage ? 81.08%
========================================================
Files ? 1898
Lines ? 109769
Branches ? 34122
========================================================
Hits ? 89007
Misses ? 20373
Partials ? 389
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
7fc5aa4 to
d1fc17a
Compare
|
Reviewed as part of triaging the cloud subgraph reports. One verified defect, plus a delivery-path question. Removing
|
|
@christian-byrne I think some of your concerns are addressed in the parent PR. I'll mark these downstream ones as drafts for now. |
8f7ebed to
fba1037
Compare
fba1037 to
c0474f9
Compare
f5da9ff to
588402b
Compare
72983e1 to
0e008c9
Compare
0e008c9 to
b9d4cc6
Compare
b9d4cc6 to
234ecb9
Compare
AustinMroz
left a comment
There was a problem hiding this comment.
Changes to this code still scare me on a fundamental level, but I do not see any specific issue here.
Adds e2e coverage for `Convert to Subgraph` with a **partial** selection. ## The gap `browser_tests/tests/subgraph/subgraphCrud.spec.ts:68` is the only e2e test of subgraph creation. It calls `comfyPage.keyboard.selectAll()` first, so every node is inside the selection, **there are zero boundary links**, and the entire rewiring block in `_convertToSubgraphImpl` (`src/lib/litegraph/src/LGraph.ts:1861-1939`) never executes. It then asserts node counts, never link topology. Partial selection — what users actually do — had no e2e coverage at all. That block reconnects boundary links by positional index (`subgraphNode.inputs[i - 1]`, `subgraphNode.outputs[i - 1]`) against a slot array built independently in `mapSubgraphInputsAndLinks`, so a drift there is silent. ## What it does Packs `KSampler` + `VAE Decode` out of the default workflow and asserts: - the exact post-conversion link table, with the new subgraph node rendered as `HOST` (five boundary inputs rewired onto it, one boundary output to SaveImage, and the two `CheckpointLoaderSimple → CLIP` links that lie entirely outside the selection left untouched) - every rewired link lands on a type-compatible slot - the result survives a serialize/reload round trip ## Status — currently red, cause not yet established Please do not read the red as a confirmed product bug yet; I do not want to overstate it. The first run failed, but **my expected link count was wrong** (I asserted six root links and forgot the two external-only CLIP links; the correct total is eight). That error is fixed in `0566c82c5a`, which now asserts the full topology rather than a count. What the first run reported that is *not* explained by my arithmetic error, and is still open: - the `4:2` VAE boundary link was absent from the links targeting the host - one host input slot was left unconnected - SaveImage's input was not fed by the host - nine root links, where the corrected expectation is eight Against that, a faithful unit-level reduction of the same graph shape (same node/slot/type layout, same selection) **passes**: all five host inputs connect, SaveImage is fed by the host, and the link count is eight. So either the trigger is something the reduction lacks (real node defs, widget-backed inputs, the app's `SubgraphNode` registration path), or the browser selection was not the two nodes I assumed. The corrected assertion prints the actual table on failure, which should settle it on the next run. I have deliberately **not** written a fix. Test-only PR. ## Related - Does **not** overlap #15002 (subgraph **unpack**, FE-1539 — different action, different code path `_unpackSubgraphImpl`). - Does **not** overlap #15009 / #15018, which are based on `feature/ecs-migration` and change `src/stores/linkStore.ts` / `rerouteStore.ts` — files that do not exist on `main`. - Does **not** overlap #14569 (preview/output display only). --------- Co-authored-by: Connor Byrne <c.byrne@comfy.org> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: DrJKL <DrJKL0424@gmail.com> Co-authored-by: Amp <amp@ampcode.com>
## Summary Still-draft feature branch for migrating entity state from LiteGraph objects and runtime mirrors into dedicated stores with derived, reactive views. This consolidates the reviewed ECS migration slices, strengthens their coverage, incorporates the layout-state follow-up, and documents the current migration status and remaining work. ## Changes - Move widget values and node shell state into dedicated stores. - Make link topology the source of truth for connectivity. - Store reroute chains while deriving membership and floating-link state. - Derive widgeted input connectivity, badges, and promoted widget rows from store-backed state. - Remove the input and output runtime link mirrors. - Keep DOM measurements separate from persisted node layout state. - Add migration coverage, extension guidance, and architecture/status documentation. Reviewed PRs merged into this feature branch: - [Comfy-Org#13322 — Move widgets out of node data](Comfy-Org#13322) - [Comfy-Org#13434 — Host-scoped promoted widget rows](Comfy-Org#13434) - [Comfy-Org#13436 — Link topology store](Comfy-Org#13436) - [Comfy-Org#13449 — Reroute chain store](Comfy-Org#13449) - [Comfy-Org#13451 — Derived floating links and reroute cleanup](Comfy-Org#13451) - [Comfy-Org#13455 — Store-backed widgeted input connectivity](Comfy-Org#13455) - [Comfy-Org#13458 — Badge store and system](Comfy-Org#13458) - [Comfy-Org#13479 — Remove the output-link runtime mirror](Comfy-Org#13479) - [Comfy-Org#13498 — Remove the input-link runtime mirror](Comfy-Org#13498) - [Comfy-Org#13528 — Cross-stack migration audit fixes](Comfy-Org#13528) - [Comfy-Org#13686 — Derive badges on read](Comfy-Org#13686) - [Comfy-Org#13963 — Node data store](Comfy-Org#13963) - [Comfy-Org#14110 — Centralize node, group, and reroute geometry](Comfy-Org#14110) - [Comfy-Org#14128 — Register node geometry at attach](Comfy-Org#14128) - [Comfy-Org#14133 — Read node geometry from the store](Comfy-Org#14133) - [Comfy-Org#14758 — Keep DOM measurements out of saved node sizes](Comfy-Org#14758) - [Comfy-Org#15001 — Extract entity ID allocation](Comfy-Org#15001) - [Comfy-Org#15009 — Scope link and reroute topology by owning graph](Comfy-Org#15009) - [Comfy-Org#15017 — Centralize layout ownership and command submission](Comfy-Org#15017) - [Comfy-Org#15018 — Preserve subgraph topology during unpack](Comfy-Org#15018) - [Comfy-Org#15019 — Transfer node ownership during replacement](Comfy-Org#15019) - [Comfy-Org#15330 — Map migration status and remaining work](Comfy-Org#15330) ## Review Focus - Store ownership and synchronization boundaries. - Serialization, undo/redo, subgraph, and extension compatibility. - Whether remaining direct entity state should migrate before this feature leaves draft. ## Status Still draft. The branch is rebased onto `main`; CI is running against the rebased history. --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Matt Miller <mattmiller@comfy.org>
Split 3/6 of #14480. Stacked on #15009.
The original version replaced every rewired link with a fresh ID. #15009 now addresses that root cause more simply: endpoint changes are validated and applied atomically at the link-store mutation boundary while preserving link identity. This PR has therefore been reduced to the remaining independent cleanup.
LGraph._unpackSubgraphImpl()previously rewrote the registered links in the shared subgraph definition while calculating their parent-graph endpoints. Unpacking one instance could transiently reindex or partially mutate topology still used by another instance.This change computes mapped origin/target endpoints in local variables, leaving the source definition and its store registration untouched. The behavioral test keeps another instance of the definition alive, unpacks one instance, and verifies both the original topology and copied parent link.
Deliberately omitted:
linkReplacement.tslinkStoreTest plan:
pnpm test:unit src/lib/litegraph/src/subgraph/SubgraphConversion.test.ts