From d18db53ba20ba1e13fc7403b36c6c495ec6fd2e5 Mon Sep 17 00:00:00 2001 From: up Date: Thu, 17 Sep 2026 19:24:39 +0530 Subject: [PATCH] up --- ...o-esp32-c3-r6-orphaned-v3v3-trace.snap.svg | 227 ++ .../assets/repro-esp32-c3-v1.0.1.input.json | 2031 +++++++++++++++++ ...ro-esp32-c3-r6-orphaned-v3v3-trace.test.ts | 54 + 3 files changed, 2312 insertions(+) create mode 100644 tests/repros/__snapshots__/repro-esp32-c3-r6-orphaned-v3v3-trace.snap.svg create mode 100644 tests/repros/assets/repro-esp32-c3-v1.0.1.input.json create mode 100644 tests/repros/repro-esp32-c3-r6-orphaned-v3v3-trace.test.ts diff --git a/tests/repros/__snapshots__/repro-esp32-c3-r6-orphaned-v3v3-trace.snap.svg b/tests/repros/__snapshots__/repro-esp32-c3-r6-orphaned-v3v3-trace.snap.svg new file mode 100644 index 000000000..6fd399ed7 --- /dev/null +++ b/tests/repros/__snapshots__/repro-esp32-c3-r6-orphaned-v3v3-trace.snap.svg @@ -0,0 +1,227 @@ + + + IO20IO21IO2IO2IO3ENENIO0IO1IO10IO4IO5IO6IO7IO8IO8IO9IO18IO19 + + + GND23GND24GND25GND26GND27GND28GND29GND30GND1GND23V3NC1IO2IO3NC2ENNC3NC4GND3IO0IO1GND4NC5IO10NC6IO4IO5IO6IO7IO8IO9NC7NC8IO18IO19NC9NC10RXD0TXD0NC11NC12NC13NC14GND5GND6GND7GND8GND9GND10GND11GND12GND13GND14GND15GND16GND17GND22GND18GND19GND20GND21anodecathodeanodecathodeanodecathodeanodecathodeanodecathodeanodecathodeanodecathodeXXXXXXXXXXXXESP32-C3-MINI-1-H4XU1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + + \ No newline at end of file diff --git a/tests/repros/assets/repro-esp32-c3-v1.0.1.input.json b/tests/repros/assets/repro-esp32-c3-v1.0.1.input.json new file mode 100644 index 000000000..b527cf4b8 --- /dev/null +++ b/tests/repros/assets/repro-esp32-c3-v1.0.1.input.json @@ -0,0 +1,2031 @@ +{ + "chips": [ + { + "chipId": "schematic_component_0", + "center": { + "x": -13.930497016666665, + "y": -3.892499999999999 + }, + "width": 2, + "height": 4.000000000000002, + "pins": [ + { + "pinId": "schematic_port_0", + "displayName": "SHELL3", + "x": -12.930497016666665, + "y": -5.4925 + }, + { + "pinId": "schematic_port_1", + "displayName": "SHELL4", + "x": -12.930497016666665, + "y": -5.692499999999999 + }, + { + "pinId": "schematic_port_2", + "displayName": "SHELL1", + "x": -12.930497016666665, + "y": -5.092499999999999 + }, + { + "pinId": "schematic_port_3", + "displayName": "SHELL2", + "x": -12.930497016666665, + "y": -5.2924999999999995 + }, + { + "pinId": "schematic_port_4", + "displayName": "A1B12", + "x": -12.930497016666665, + "y": -4.692499999999999 + }, + { + "pinId": "schematic_port_5", + "displayName": "A4B9", + "x": -12.930497016666665, + "y": -2.0924999999999994 + }, + { + "pinId": "schematic_port_6", + "displayName": "B8", + "x": -12.930497016666665, + "y": -4.342499999999999 + }, + { + "pinId": "schematic_port_7", + "displayName": "A5", + "x": -12.930497016666665, + "y": -2.642499999999999 + }, + { + "pinId": "schematic_port_8", + "displayName": "B7", + "x": -12.930497016666665, + "y": -3.7924999999999995 + }, + { + "pinId": "schematic_port_9", + "displayName": "A6", + "x": -12.930497016666665, + "y": -3.192499999999999 + }, + { + "pinId": "schematic_port_10", + "displayName": "A7", + "x": -12.930497016666665, + "y": -3.5924999999999994 + }, + { + "pinId": "schematic_port_11", + "displayName": "B6", + "x": -12.930497016666665, + "y": -3.3925 + }, + { + "pinId": "schematic_port_12", + "displayName": "A8", + "x": -12.930497016666665, + "y": -4.1425 + }, + { + "pinId": "schematic_port_13", + "displayName": "B5", + "x": -12.930497016666665, + "y": -2.8424999999999994 + }, + { + "pinId": "schematic_port_14", + "displayName": "B4A9", + "x": -12.930497016666665, + "y": -2.2924999999999986 + }, + { + "pinId": "schematic_port_15", + "displayName": "B1A12", + "x": -12.930497016666665, + "y": -4.892499999999999 + } + ], + "sectionId": "USB" + }, + { + "chipId": "schematic_component_1", + "center": { + "x": -11.530497016666665, + "y": -8.1975 + }, + "width": 2, + "height": 1.8000000000000007, + "pins": [ + { + "pinId": "schematic_port_16", + "displayName": "GND", + "x": -12.530497016666665, + "y": -7.4975 + }, + { + "pinId": "schematic_port_17", + "displayName": "TXD", + "x": -12.530497016666665, + "y": -7.6975 + }, + { + "pinId": "schematic_port_18", + "displayName": "RXD", + "x": -12.530497016666665, + "y": -7.8975 + }, + { + "pinId": "schematic_port_19", + "displayName": "V3", + "x": -12.530497016666665, + "y": -8.0975 + }, + { + "pinId": "schematic_port_20", + "displayName": "D_POS", + "x": -12.530497016666665, + "y": -8.2975 + }, + { + "pinId": "schematic_port_21", + "displayName": "D_NEG", + "x": -12.530497016666665, + "y": -8.4975 + }, + { + "pinId": "schematic_port_22", + "displayName": "7", + "x": -12.530497016666665, + "y": -8.6975 + }, + { + "pinId": "schematic_port_23", + "displayName": "N_OUT", + "x": -12.530497016666665, + "y": -8.897499999999999 + }, + { + "pinId": "schematic_port_24", + "displayName": "N_CTS", + "x": -10.530497016666665, + "y": -8.897499999999999 + }, + { + "pinId": "schematic_port_25", + "displayName": "N_DSR", + "x": -10.530497016666665, + "y": -8.6975 + }, + { + "pinId": "schematic_port_26", + "displayName": "N_RI", + "x": -10.530497016666665, + "y": -8.4975 + }, + { + "pinId": "schematic_port_27", + "displayName": "N_DCD", + "x": -10.530497016666665, + "y": -8.2975 + }, + { + "pinId": "schematic_port_28", + "displayName": "N_DTR", + "x": -10.530497016666665, + "y": -8.0975 + }, + { + "pinId": "schematic_port_29", + "displayName": "N_RTS", + "x": -10.530497016666665, + "y": -7.8975 + }, + { + "pinId": "schematic_port_30", + "displayName": "R232", + "x": -10.530497016666665, + "y": -7.6975 + }, + { + "pinId": "schematic_port_31", + "displayName": "VCC", + "x": -10.530497016666665, + "y": -7.4975 + } + ], + "sectionId": "USB" + }, + { + "chipId": "schematic_component_2", + "center": { + "x": -3.9396636833333316, + "y": -6.089999999999999 + }, + "width": 2, + "height": 0.5999999999999996, + "pins": [ + { + "pinId": "schematic_port_32", + "displayName": "VIN", + "x": -4.939663683333332, + "y": -5.889999999999999 + }, + { + "pinId": "schematic_port_33", + "displayName": "GND", + "x": -4.939663683333332, + "y": -6.089999999999999 + }, + { + "pinId": "schematic_port_34", + "displayName": "EN", + "x": -4.939663683333332, + "y": -6.289999999999999 + }, + { + "pinId": "schematic_port_35", + "displayName": "NC", + "x": -2.9396636833333316, + "y": -6.189999999999999 + }, + { + "pinId": "schematic_port_36", + "displayName": "VOUT", + "x": -2.9396636833333316, + "y": -5.989999999999999 + } + ], + "sectionId": "POWER" + }, + { + "chipId": "schematic_component_3", + "center": { + "x": 5.59408631666667, + "y": -5.735 + }, + "width": 2, + "height": 6.200000000000001, + "pins": [ + { + "pinId": "schematic_port_37", + "displayName": "GND23", + "x": 6.59408631666667, + "y": -4.235 + }, + { + "pinId": "schematic_port_38", + "displayName": "GND24", + "x": 6.59408631666667, + "y": -4.035 + }, + { + "pinId": "schematic_port_39", + "displayName": "GND25", + "x": 6.59408631666667, + "y": -3.835 + }, + { + "pinId": "schematic_port_40", + "displayName": "GND26", + "x": 6.59408631666667, + "y": -3.635 + }, + { + "pinId": "schematic_port_41", + "displayName": "GND27", + "x": 6.59408631666667, + "y": -3.4349999999999996 + }, + { + "pinId": "schematic_port_42", + "displayName": "GND28", + "x": 6.59408631666667, + "y": -3.2349999999999994 + }, + { + "pinId": "schematic_port_43", + "displayName": "GND29", + "x": 6.59408631666667, + "y": -3.0349999999999993 + }, + { + "pinId": "schematic_port_44", + "displayName": "GND30", + "x": 6.59408631666667, + "y": -2.834999999999999 + }, + { + "pinId": "schematic_port_45", + "displayName": "GND1", + "x": 4.59408631666667, + "y": -2.734999999999999 + }, + { + "pinId": "schematic_port_46", + "displayName": "GND2", + "x": 4.59408631666667, + "y": -2.934999999999999 + }, + { + "pinId": "schematic_port_47", + "displayName": "3V3", + "x": 4.59408631666667, + "y": -3.134999999999999 + }, + { + "pinId": "schematic_port_48", + "displayName": "NC1", + "x": 4.59408631666667, + "y": -3.334999999999999 + }, + { + "pinId": "schematic_port_49", + "displayName": "IO2", + "x": 4.59408631666667, + "y": -3.5349999999999993 + }, + { + "pinId": "schematic_port_50", + "displayName": "IO3", + "x": 4.59408631666667, + "y": -3.734999999999999 + }, + { + "pinId": "schematic_port_51", + "displayName": "NC2", + "x": 4.59408631666667, + "y": -3.9349999999999987 + }, + { + "pinId": "schematic_port_52", + "displayName": "EN", + "x": 4.59408631666667, + "y": -4.134999999999999 + }, + { + "pinId": "schematic_port_53", + "displayName": "NC3", + "x": 4.59408631666667, + "y": -4.334999999999999 + }, + { + "pinId": "schematic_port_54", + "displayName": "NC4", + "x": 4.59408631666667, + "y": -4.534999999999998 + }, + { + "pinId": "schematic_port_55", + "displayName": "GND3", + "x": 4.59408631666667, + "y": -4.7349999999999985 + }, + { + "pinId": "schematic_port_56", + "displayName": "IO0", + "x": 4.59408631666667, + "y": -4.934999999999999 + }, + { + "pinId": "schematic_port_57", + "displayName": "IO1", + "x": 4.59408631666667, + "y": -5.134999999999999 + }, + { + "pinId": "schematic_port_58", + "displayName": "GND4", + "x": 4.59408631666667, + "y": -5.334999999999999 + }, + { + "pinId": "schematic_port_59", + "displayName": "NC5", + "x": 4.59408631666667, + "y": -5.534999999999999 + }, + { + "pinId": "schematic_port_60", + "displayName": "IO10", + "x": 4.59408631666667, + "y": -5.734999999999999 + }, + { + "pinId": "schematic_port_61", + "displayName": "NC6", + "x": 4.59408631666667, + "y": -5.935 + }, + { + "pinId": "schematic_port_62", + "displayName": "IO4", + "x": 4.59408631666667, + "y": -6.135 + }, + { + "pinId": "schematic_port_63", + "displayName": "IO5", + "x": 4.59408631666667, + "y": -6.335 + }, + { + "pinId": "schematic_port_64", + "displayName": "IO6", + "x": 4.59408631666667, + "y": -6.535 + }, + { + "pinId": "schematic_port_65", + "displayName": "IO7", + "x": 4.59408631666667, + "y": -6.734999999999999 + }, + { + "pinId": "schematic_port_66", + "displayName": "IO8", + "x": 4.59408631666667, + "y": -6.9350000000000005 + }, + { + "pinId": "schematic_port_67", + "displayName": "IO9", + "x": 4.59408631666667, + "y": -7.135 + }, + { + "pinId": "schematic_port_68", + "displayName": "NC7", + "x": 4.59408631666667, + "y": -7.335000000000001 + }, + { + "pinId": "schematic_port_69", + "displayName": "NC8", + "x": 4.59408631666667, + "y": -7.535 + }, + { + "pinId": "schematic_port_70", + "displayName": "IO18", + "x": 4.59408631666667, + "y": -7.735000000000001 + }, + { + "pinId": "schematic_port_71", + "displayName": "IO19", + "x": 4.59408631666667, + "y": -7.9350000000000005 + }, + { + "pinId": "schematic_port_72", + "displayName": "NC9", + "x": 4.59408631666667, + "y": -8.135000000000002 + }, + { + "pinId": "schematic_port_73", + "displayName": "NC10", + "x": 4.59408631666667, + "y": -8.335 + }, + { + "pinId": "schematic_port_74", + "displayName": "RXD0", + "x": 4.59408631666667, + "y": -8.535000000000002 + }, + { + "pinId": "schematic_port_75", + "displayName": "TXD0", + "x": 4.59408631666667, + "y": -8.735000000000001 + }, + { + "pinId": "schematic_port_76", + "displayName": "NC11", + "x": 6.59408631666667, + "y": -8.635000000000002 + }, + { + "pinId": "schematic_port_77", + "displayName": "NC12", + "x": 6.59408631666667, + "y": -8.435000000000002 + }, + { + "pinId": "schematic_port_78", + "displayName": "NC13", + "x": 6.59408631666667, + "y": -8.235000000000001 + }, + { + "pinId": "schematic_port_79", + "displayName": "NC14", + "x": 6.59408631666667, + "y": -8.035000000000002 + }, + { + "pinId": "schematic_port_80", + "displayName": "GND5", + "x": 6.59408631666667, + "y": -7.835000000000002 + }, + { + "pinId": "schematic_port_81", + "displayName": "GND6", + "x": 6.59408631666667, + "y": -7.635000000000002 + }, + { + "pinId": "schematic_port_82", + "displayName": "GND7", + "x": 6.59408631666667, + "y": -7.435000000000001 + }, + { + "pinId": "schematic_port_83", + "displayName": "GND8", + "x": 6.59408631666667, + "y": -7.235000000000001 + }, + { + "pinId": "schematic_port_84", + "displayName": "GND9", + "x": 6.59408631666667, + "y": -7.035000000000002 + }, + { + "pinId": "schematic_port_85", + "displayName": "GND10", + "x": 6.59408631666667, + "y": -6.835000000000002 + }, + { + "pinId": "schematic_port_86", + "displayName": "GND11", + "x": 6.59408631666667, + "y": -6.635000000000002 + }, + { + "pinId": "schematic_port_87", + "displayName": "GND12", + "x": 6.59408631666667, + "y": -6.435000000000002 + }, + { + "pinId": "schematic_port_88", + "displayName": "GND13", + "x": 6.59408631666667, + "y": -6.235000000000001 + }, + { + "pinId": "schematic_port_89", + "displayName": "GND14", + "x": 6.59408631666667, + "y": -6.035000000000002 + }, + { + "pinId": "schematic_port_90", + "displayName": "GND15", + "x": 6.59408631666667, + "y": -5.835000000000001 + }, + { + "pinId": "schematic_port_91", + "displayName": "GND16", + "x": 6.59408631666667, + "y": -5.635000000000002 + }, + { + "pinId": "schematic_port_92", + "displayName": "GND17", + "x": 6.59408631666667, + "y": -5.4350000000000005 + }, + { + "pinId": "schematic_port_93", + "displayName": "GND22", + "x": 6.59408631666667, + "y": -5.235000000000001 + }, + { + "pinId": "schematic_port_94", + "displayName": "GND18", + "x": 6.59408631666667, + "y": -5.035 + }, + { + "pinId": "schematic_port_95", + "displayName": "GND19", + "x": 6.59408631666667, + "y": -4.835000000000001 + }, + { + "pinId": "schematic_port_96", + "displayName": "GND20", + "x": 6.59408631666667, + "y": -4.635000000000001 + }, + { + "pinId": "schematic_port_97", + "displayName": "GND21", + "x": 6.59408631666667, + "y": -4.4350000000000005 + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_4", + "center": { + "x": 13.00408631666667, + "y": -3.892499999999999 + }, + "width": 2, + "height": 0.40000000000000036, + "pins": [ + { + "pinId": "schematic_port_98", + "displayName": "B", + "x": 12.00408631666667, + "y": -3.792499999999999 + }, + { + "pinId": "schematic_port_99", + "displayName": "E", + "x": 12.00408631666667, + "y": -3.9924999999999993 + }, + { + "pinId": "schematic_port_100", + "displayName": "C", + "x": 14.00408631666667, + "y": -3.892499999999999 + } + ], + "sectionId": "AUTO" + }, + { + "chipId": "schematic_component_5", + "center": { + "x": 13.00408631666667, + "y": -6.2924999999999995 + }, + "width": 2, + "height": 0.40000000000000036, + "pins": [ + { + "pinId": "schematic_port_101", + "displayName": "B", + "x": 12.00408631666667, + "y": -6.192499999999999 + }, + { + "pinId": "schematic_port_102", + "displayName": "E", + "x": 12.00408631666667, + "y": -6.3925 + }, + { + "pinId": "schematic_port_103", + "displayName": "C", + "x": 14.00408631666667, + "y": -6.2924999999999995 + } + ], + "sectionId": "AUTO" + }, + { + "chipId": "schematic_component_6", + "center": { + "x": 15.56854166666667, + "y": -6.762499999999999 + }, + "width": 0.7189106999999986, + "height": 0.9399999999999995, + "pins": [ + { + "pinId": "schematic_port_104", + "displayName": "1", + "x": 15.56854166666667, + "y": -6.2924999999999995, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_105", + "displayName": "2", + "x": 15.56854166666667, + "y": -7.232499999999999, + "_facingDirection": "y-" + } + ], + "sectionId": "AUTO" + }, + { + "chipId": "schematic_component_7", + "center": { + "x": 15.56854166666667, + "y": -4.6125 + }, + "width": 0.7189106999999986, + "height": 0.9399999999999995, + "pins": [ + { + "pinId": "schematic_port_106", + "displayName": "1", + "x": 15.56854166666667, + "y": -4.1425, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_107", + "displayName": "2", + "x": 15.56854166666667, + "y": -5.0825, + "_facingDirection": "y-" + } + ], + "sectionId": "AUTO" + }, + { + "chipId": "schematic_component_8", + "center": { + "x": -3.0300000000000002, + "y": -15.919999999999998 + }, + "width": 1.1250000000000004, + "height": 1.1300000000000008, + "pins": [ + { + "pinId": "schematic_port_108", + "displayName": "anode", + "x": -3.2675, + "y": -15.354999999999997, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_109", + "displayName": "cathode", + "x": -3.2675, + "y": -16.485, + "_facingDirection": "y-" + } + ], + "sectionId": "LED" + }, + { + "chipId": "schematic_component_9", + "center": { + "x": -11.167997016666664, + "y": -5.3925 + }, + "width": 1.084999999999999, + "height": 0.6000000000000014, + "pins": [ + { + "pinId": "schematic_port_110", + "displayName": "anode", + "x": -11.385497016666665, + "y": -5.092499999999999 + }, + { + "pinId": "schematic_port_111", + "displayName": "cathode", + "x": -11.385497016666665, + "y": -5.692500000000001 + } + ], + "sectionId": "USB" + }, + { + "chipId": "schematic_component_10", + "center": { + "x": -11.167997016666664, + "y": -3.5824999999999996 + }, + "width": 1.084999999999999, + "height": 0.5999999999999996, + "pins": [ + { + "pinId": "schematic_port_112", + "displayName": "anode", + "x": -11.385497016666665, + "y": -3.2824999999999998, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_113", + "displayName": "cathode", + "x": -11.385497016666665, + "y": -3.8824999999999994, + "_facingDirection": "y-" + } + ], + "sectionId": "USB" + }, + { + "chipId": "schematic_component_11", + "center": { + "x": 1.142836316666669, + "y": -5.6075 + }, + "width": 0.9649999999999999, + "height": 0.5999999999999996, + "pins": [ + { + "pinId": "schematic_port_114", + "displayName": "anode", + "x": 0.9853363166666691, + "y": -5.3075, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_115", + "displayName": "cathode", + "x": 0.9853363166666691, + "y": -5.9075, + "_facingDirection": "y-" + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_12", + "center": { + "x": 3.2065863166666695, + "y": -7.379999999999999 + }, + "width": 0.9650000000000003, + "height": 0.5999999999999996, + "pins": [ + { + "pinId": "schematic_port_116", + "displayName": "anode", + "x": 3.0490863166666697, + "y": -7.079999999999999, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_117", + "displayName": "cathode", + "x": 3.0490863166666697, + "y": -7.679999999999999, + "_facingDirection": "y-" + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_13", + "center": { + "x": 3.2065863166666695, + "y": -9.189999999999998 + }, + "width": 0.9650000000000003, + "height": 0.6000000000000014, + "pins": [ + { + "pinId": "schematic_port_118", + "displayName": "anode", + "x": 3.0490863166666697, + "y": -8.889999999999997, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_119", + "displayName": "cathode", + "x": 3.0490863166666697, + "y": -9.489999999999998, + "_facingDirection": "y-" + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_14", + "center": { + "x": 3.2065863166666695, + "y": -1.7999999999999998 + }, + "width": 0.9650000000000003, + "height": 0.5999999999999999, + "pins": [ + { + "pinId": "schematic_port_120", + "displayName": "anode", + "x": 3.0490863166666697, + "y": -1.5, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_121", + "displayName": "cathode", + "x": 3.0490863166666697, + "y": -2.0999999999999996, + "_facingDirection": "y-" + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_15", + "center": { + "x": 10.494086316666671, + "y": -5.092499999999999 + }, + "width": 0.6000000000000014, + "height": 0.6799999999999997, + "pins": [ + { + "pinId": "schematic_port_122", + "displayName": "anode", + "x": 10.19408631666667, + "y": -5.092499999999999, + "_facingDirection": "x-" + }, + { + "pinId": "schematic_port_123", + "displayName": "cathode", + "x": 10.794086316666672, + "y": -5.092499999999999, + "_facingDirection": "x+" + } + ], + "sectionId": "AUTO" + }, + { + "chipId": "schematic_component_16", + "center": { + "x": 10.494086316666671, + "y": -6.972499999999999 + }, + "width": 0.6000000000000014, + "height": 0.6799999999999997, + "pins": [ + { + "pinId": "schematic_port_124", + "displayName": "anode", + "x": 10.19408631666667, + "y": -6.972499999999999, + "_facingDirection": "x-" + }, + { + "pinId": "schematic_port_125", + "displayName": "cathode", + "x": 10.794086316666672, + "y": -6.972499999999999, + "_facingDirection": "x+" + } + ], + "sectionId": "AUTO" + }, + { + "chipId": "schematic_component_17", + "center": { + "x": -3.5675, + "y": -13.814999999999998 + }, + "width": 0.5999999999999996, + "height": 0.6799999999999997, + "pins": [ + { + "pinId": "schematic_port_126", + "displayName": "anode", + "x": -3.8674999999999997, + "y": -13.814999999999998, + "_facingDirection": "x-" + }, + { + "pinId": "schematic_port_127", + "displayName": "cathode", + "x": -3.2675, + "y": -13.814999999999998, + "_facingDirection": "x+" + } + ], + "sectionId": "LED" + }, + { + "chipId": "schematic_component_18", + "center": { + "x": -6.407997016666665, + "y": -4.899999999999999 + }, + "width": 1.045, + "height": 0.7599999999999998, + "pins": [ + { + "pinId": "schematic_port_128", + "displayName": "anode", + "x": -6.480497016666665, + "y": -4.519999999999999, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_129", + "displayName": "cathode", + "x": -6.480497016666665, + "y": -5.2799999999999985, + "_facingDirection": "y-" + } + ], + "sectionId": "POWER" + }, + { + "chipId": "schematic_component_19", + "center": { + "x": -4.962997016666666, + "y": -4.899999999999999 + }, + "width": 1.0450000000000008, + "height": 0.7599999999999998, + "pins": [ + { + "pinId": "schematic_port_130", + "displayName": "anode", + "x": -5.035497016666666, + "y": -4.519999999999999, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_131", + "displayName": "cathode", + "x": -5.035497016666666, + "y": -5.2799999999999985, + "_facingDirection": "y-" + } + ], + "sectionId": "POWER" + }, + { + "chipId": "schematic_component_20", + "center": { + "x": 1.7790863166666693, + "y": -3.634999999999999 + }, + "width": 1.0449999999999997, + "height": 0.7600000000000002, + "pins": [ + { + "pinId": "schematic_port_132", + "displayName": "anode", + "x": 1.7065863166666695, + "y": -3.254999999999999, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_133", + "displayName": "cathode", + "x": 1.7065863166666695, + "y": -4.014999999999999, + "_facingDirection": "y-" + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_21", + "center": { + "x": 3.3440863166666697, + "y": -3.634999999999999 + }, + "width": 1.1650000000000005, + "height": 0.7600000000000002, + "pins": [ + { + "pinId": "schematic_port_134", + "displayName": "anode", + "x": 3.2115863166666694, + "y": -3.254999999999999, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_135", + "displayName": "cathode", + "x": 3.2115863166666694, + "y": -4.014999999999999, + "_facingDirection": "y-" + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_22", + "center": { + "x": 3.000336316666669, + "y": -5.6075 + }, + "width": 0.9250000000000003, + "height": 0.7599999999999998, + "pins": [ + { + "pinId": "schematic_port_136", + "displayName": "anode", + "x": 2.987836316666669, + "y": -5.2275, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_137", + "displayName": "cathode", + "x": 2.987836316666669, + "y": -5.9875, + "_facingDirection": "y-" + } + ], + "sectionId": "MCU" + }, + { + "chipId": "schematic_component_23", + "center": { + "x": -15.345497016666666, + "y": -8.5975 + }, + "width": 1.1649999999999991, + "height": 0.759999999999998, + "pins": [ + { + "pinId": "schematic_port_138", + "displayName": "anode", + "x": -15.477997016666666, + "y": -8.217500000000001, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_139", + "displayName": "cathode", + "x": -15.477997016666666, + "y": -8.9775, + "_facingDirection": "y-" + } + ], + "sectionId": "USB" + }, + { + "chipId": "schematic_component_24", + "center": { + "x": -13.780497016666665, + "y": -8.5975 + }, + "width": 1.1649999999999991, + "height": 0.759999999999998, + "pins": [ + { + "pinId": "schematic_port_140", + "displayName": "anode", + "x": -13.912997016666665, + "y": -8.217500000000001, + "_facingDirection": "y+" + }, + { + "pinId": "schematic_port_141", + "displayName": "cathode", + "x": -13.912997016666665, + "y": -8.9775, + "_facingDirection": "y-" + } + ], + "sectionId": "USB" + }, + { + "chipId": "schematic_component_25", + "center": { + "x": 1.2575000000000003, + "y": -14.987499999999999 + }, + "width": 1.2000000000000002, + "height": 2.1999999999999993, + "pins": [ + { + "pinId": "schematic_port_142", + "displayName": "1", + "x": 1.8575000000000004, + "y": -14.087499999999999 + }, + { + "pinId": "schematic_port_143", + "displayName": "2", + "x": 1.8575000000000004, + "y": -14.2875 + }, + { + "pinId": "schematic_port_144", + "displayName": "3", + "x": 1.8575000000000004, + "y": -14.487499999999999 + }, + { + "pinId": "schematic_port_145", + "displayName": "4", + "x": 1.8575000000000004, + "y": -14.687499999999998 + }, + { + "pinId": "schematic_port_146", + "displayName": "5", + "x": 1.8575000000000004, + "y": -14.8875 + }, + { + "pinId": "schematic_port_147", + "displayName": "6", + "x": 1.8575000000000004, + "y": -15.087499999999999 + }, + { + "pinId": "schematic_port_148", + "displayName": "7", + "x": 1.8575000000000004, + "y": -15.287499999999998 + }, + { + "pinId": "schematic_port_149", + "displayName": "8", + "x": 1.8575000000000004, + "y": -15.487499999999999 + }, + { + "pinId": "schematic_port_150", + "displayName": "9", + "x": 1.8575000000000004, + "y": -15.687499999999998 + }, + { + "pinId": "schematic_port_151", + "displayName": "10", + "x": 1.8575000000000004, + "y": -15.8875 + } + ], + "sectionId": "HEADERS" + }, + { + "chipId": "schematic_component_26", + "center": { + "x": 3.6675000000000004, + "y": -14.987499999999999 + }, + "width": 1.1999999999999993, + "height": 2.1999999999999993, + "pins": [ + { + "pinId": "schematic_port_152", + "displayName": "1", + "x": 4.2675, + "y": -14.087499999999999 + }, + { + "pinId": "schematic_port_153", + "displayName": "2", + "x": 4.2675, + "y": -14.2875 + }, + { + "pinId": "schematic_port_154", + "displayName": "3", + "x": 4.2675, + "y": -14.487499999999999 + }, + { + "pinId": "schematic_port_155", + "displayName": "4", + "x": 4.2675, + "y": -14.687499999999998 + }, + { + "pinId": "schematic_port_156", + "displayName": "5", + "x": 4.2675, + "y": -14.8875 + }, + { + "pinId": "schematic_port_157", + "displayName": "6", + "x": 4.2675, + "y": -15.087499999999999 + }, + { + "pinId": "schematic_port_158", + "displayName": "7", + "x": 4.2675, + "y": -15.287499999999998 + }, + { + "pinId": "schematic_port_159", + "displayName": "8", + "x": 4.2675, + "y": -15.487499999999999 + }, + { + "pinId": "schematic_port_160", + "displayName": "9", + "x": 4.2675, + "y": -15.687499999999998 + }, + { + "pinId": "schematic_port_161", + "displayName": "10", + "x": 4.2675, + "y": -15.8875 + } + ], + "sectionId": "HEADERS" + } + ], + "directConnections": [], + "netConnections": [ + { + "netId": "GND", + "isGround": true, + "netLabelWidth": 0.42, + "netLabelHeight": 0.48, + "pinIds": [ + "schematic_port_0", + "schematic_port_1", + "schematic_port_2", + "schematic_port_3", + "schematic_port_4", + "schematic_port_15", + "schematic_port_16", + "schematic_port_33", + "schematic_port_37", + "schematic_port_38", + "schematic_port_39", + "schematic_port_40", + "schematic_port_41", + "schematic_port_42", + "schematic_port_43", + "schematic_port_44", + "schematic_port_45", + "schematic_port_46", + "schematic_port_55", + "schematic_port_58", + "schematic_port_80", + "schematic_port_81", + "schematic_port_82", + "schematic_port_83", + "schematic_port_84", + "schematic_port_85", + "schematic_port_86", + "schematic_port_87", + "schematic_port_88", + "schematic_port_89", + "schematic_port_90", + "schematic_port_91", + "schematic_port_92", + "schematic_port_93", + "schematic_port_94", + "schematic_port_95", + "schematic_port_96", + "schematic_port_97", + "schematic_port_105", + "schematic_port_107", + "schematic_port_109", + "schematic_port_111", + "schematic_port_113", + "schematic_port_129", + "schematic_port_131", + "schematic_port_133", + "schematic_port_135", + "schematic_port_137", + "schematic_port_139", + "schematic_port_141", + "schematic_port_143", + "schematic_port_153" + ] + }, + { + "netId": "VBUS", + "isGround": false, + "netLabelWidth": 0.42, + "netLabelHeight": 0.6, + "pinIds": [ + "schematic_port_5", + "schematic_port_14", + "schematic_port_32", + "schematic_port_34", + "schematic_port_128", + "schematic_port_152" + ] + }, + { + "netId": "CC1", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_7", + "schematic_port_110" + ] + }, + { + "netId": "USB_DM", + "isGround": false, + "netLabelWidth": 0.84, + "anchoredNetLabelWidth": 0.84, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.56, + "pinIds": [ + "schematic_port_8", + "schematic_port_10", + "schematic_port_21" + ] + }, + { + "netId": "USB_DP", + "isGround": false, + "netLabelWidth": 0.84, + "anchoredNetLabelWidth": 0.84, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.56, + "pinIds": [ + "schematic_port_9", + "schematic_port_11", + "schematic_port_20" + ] + }, + { + "netId": "CC2", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_13", + "schematic_port_112" + ] + }, + { + "netId": "IO20", + "isGround": false, + "netLabelWidth": 0.6, + "anchoredNetLabelWidth": 0.6, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.4, + "pinIds": [ + "schematic_port_17", + "schematic_port_74", + "schematic_port_156" + ] + }, + { + "netId": "IO21", + "isGround": false, + "netLabelWidth": 0.6, + "anchoredNetLabelWidth": 0.6, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.4, + "pinIds": [ + "schematic_port_18", + "schematic_port_75", + "schematic_port_155" + ] + }, + { + "netId": "V3V3", + "isGround": false, + "netLabelWidth": 0.42, + "netLabelHeight": 0.6, + "pinIds": [ + "schematic_port_19", + "schematic_port_31", + "schematic_port_36", + "schematic_port_47", + "schematic_port_114", + "schematic_port_116", + "schematic_port_118", + "schematic_port_120", + "schematic_port_130", + "schematic_port_132", + "schematic_port_134", + "schematic_port_138", + "schematic_port_140", + "schematic_port_142" + ] + }, + { + "netId": "DTR", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_28", + "schematic_port_102", + "schematic_port_122" + ] + }, + { + "netId": "RTS", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_29", + "schematic_port_99", + "schematic_port_124" + ] + }, + { + "netId": "IO2", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_49", + "schematic_port_121", + "schematic_port_146" + ] + }, + { + "netId": "IO3", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_50", + "schematic_port_147" + ] + }, + { + "netId": "EN", + "isGround": false, + "netLabelWidth": 0.36, + "anchoredNetLabelWidth": 0.36, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.24, + "pinIds": [ + "schematic_port_52", + "schematic_port_100", + "schematic_port_106", + "schematic_port_115", + "schematic_port_136", + "schematic_port_154" + ] + }, + { + "netId": "IO0", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_56", + "schematic_port_144" + ] + }, + { + "netId": "IO1", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_57", + "schematic_port_145" + ] + }, + { + "netId": "IO10", + "isGround": false, + "netLabelWidth": 0.6, + "anchoredNetLabelWidth": 0.6, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.4, + "pinIds": [ + "schematic_port_60", + "schematic_port_126", + "schematic_port_159" + ] + }, + { + "netId": "IO4", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_62", + "schematic_port_148" + ] + }, + { + "netId": "IO5", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_63", + "schematic_port_149" + ] + }, + { + "netId": "IO6", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_64", + "schematic_port_150" + ] + }, + { + "netId": "IO7", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_65", + "schematic_port_151" + ] + }, + { + "netId": "IO8", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_66", + "schematic_port_119", + "schematic_port_161" + ] + }, + { + "netId": "IO9", + "isGround": false, + "netLabelWidth": 0.48, + "anchoredNetLabelWidth": 0.48, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.32, + "pinIds": [ + "schematic_port_67", + "schematic_port_103", + "schematic_port_104", + "schematic_port_117", + "schematic_port_160" + ] + }, + { + "netId": "IO18", + "isGround": false, + "netLabelWidth": 0.6, + "anchoredNetLabelWidth": 0.6, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.4, + "pinIds": [ + "schematic_port_70", + "schematic_port_158" + ] + }, + { + "netId": "IO19", + "isGround": false, + "netLabelWidth": 0.6, + "anchoredNetLabelWidth": 0.6, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.4, + "pinIds": [ + "schematic_port_71", + "schematic_port_157" + ] + }, + { + "netId": "BASE_EN", + "isGround": false, + "netLabelWidth": 0.96, + "anchoredNetLabelWidth": 0.96, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.64, + "pinIds": [ + "schematic_port_98", + "schematic_port_123" + ] + }, + { + "netId": "BASE_BOOT", + "isGround": false, + "netLabelWidth": 1.2, + "anchoredNetLabelWidth": 1.2, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.8, + "pinIds": [ + "schematic_port_101", + "schematic_port_125" + ] + }, + { + "netId": "LED_A", + "isGround": false, + "netLabelWidth": 0.72, + "anchoredNetLabelWidth": 0.72, + "allowInlineNetLabel": true, + "inlineNetLabelHeight": 0.12, + "inlineNetLabelWidth": 0.48, + "pinIds": [ + "schematic_port_108", + "schematic_port_127" + ] + } + ], + "textBoxes": [ + { + "chipId": "schematic_component_0", + "center": { + "x": -13.270497016666665, + "y": -6.022499999999999 + }, + "width": 2.5199999999999996, + "height": 0.17999999999999972, + "text": "TYPE-C 16PIN 2MD(073)" + }, + { + "chipId": "schematic_component_0", + "center": { + "x": -14.410497016666664, + "y": -1.7774999999999985 + }, + "width": 0.3600000000000012, + "height": 0.2500000000000002, + "text": "J1" + }, + { + "chipId": "schematic_component_1", + "center": { + "x": -11.770497016666663, + "y": -9.2275 + }, + "width": 0.7200000000000006, + "height": 0.17999999999999972, + "text": "CH340C" + }, + { + "chipId": "schematic_component_1", + "center": { + "x": -12.010497016666665, + "y": -7.182499999999999 + }, + "width": 0.3600000000000012, + "height": 0.2499999999999991, + "text": "U2" + }, + { + "chipId": "schematic_component_2", + "center": { + "x": -3.6396636833333322, + "y": -6.519999999999999 + }, + "width": 1.7999999999999998, + "height": 0.17999999999999972, + "text": "AP2112K-3.3TRG1" + }, + { + "chipId": "schematic_component_2", + "center": { + "x": -4.419663683333332, + "y": -5.674999999999999 + }, + "width": 0.35999999999999943, + "height": 0.2499999999999991, + "text": "U3" + }, + { + "chipId": "schematic_component_3", + "center": { + "x": 6.134086316666669, + "y": -8.965 + }, + "width": 2.2799999999999994, + "height": 0.17999999999999972, + "text": "ESP32-C3-MINI-1-H4X" + }, + { + "chipId": "schematic_component_3", + "center": { + "x": 5.114086316666669, + "y": -2.5200000000000005 + }, + "width": 0.35999999999999943, + "height": 0.24999999999999956, + "text": "U1" + }, + { + "chipId": "schematic_component_4", + "center": { + "x": 12.884086316666671, + "y": -4.222499999999999 + }, + "width": 0.9600000000000009, + "height": 0.17999999999999972, + "text": "MMBT3904" + }, + { + "chipId": "schematic_component_4", + "center": { + "x": 12.524086316666672, + "y": -3.577499999999999 + }, + "width": 0.3600000000000012, + "height": 0.24999999999999956, + "text": "Q1" + }, + { + "chipId": "schematic_component_5", + "center": { + "x": 12.884086316666671, + "y": -6.6225 + }, + "width": 0.9600000000000009, + "height": 0.17999999999999972, + "text": "MMBT3904" + }, + { + "chipId": "schematic_component_5", + "center": { + "x": 12.524086316666672, + "y": -5.977499999999999 + }, + "width": 0.3600000000000012, + "height": 0.2499999999999991, + "text": "Q2" + }, + { + "chipId": "schematic_component_25", + "center": { + "x": 1.1775000000000002, + "y": -13.772499999999999 + }, + "width": 0.3600000000000001, + "height": 0.25, + "text": "J2" + }, + { + "chipId": "schematic_component_26", + "center": { + "x": 3.5875000000000004, + "y": -13.772499999999999 + }, + "width": 0.3600000000000003, + "height": 0.25, + "text": "J3" + } + ], + "availableNetLabelOrientations": { + "VBUS": [ + "y+" + ], + "V3V3": [ + "y+" + ], + "GND": [ + "y-" + ], + "CC1": [ + "x-", + "x+" + ], + "CC2": [ + "x-", + "x+" + ], + "USB_DP": [ + "x-", + "x+" + ], + "USB_DM": [ + "x-", + "x+" + ], + "DTR": [ + "x-", + "x+" + ], + "RTS": [ + "x-", + "x+" + ], + "EN": [ + "x-", + "x+" + ], + "BASE_EN": [ + "x-", + "x+" + ], + "BASE_BOOT": [ + "x-", + "x+" + ], + "LED_A": [ + "x-", + "x+" + ], + "IO0": [ + "x-", + "x+" + ], + "IO1": [ + "x-", + "x+" + ], + "IO2": [ + "x-", + "x+" + ], + "IO3": [ + "x-", + "x+" + ], + "IO4": [ + "x-", + "x+" + ], + "IO5": [ + "x-", + "x+" + ], + "IO6": [ + "x-", + "x+" + ], + "IO7": [ + "x-", + "x+" + ], + "IO8": [ + "x-", + "x+" + ], + "IO9": [ + "x-", + "x+" + ], + "IO10": [ + "x-", + "x+" + ], + "IO18": [ + "x-", + "x+" + ], + "IO19": [ + "x-", + "x+" + ], + "IO20": [ + "x-", + "x+" + ], + "IO21": [ + "x-", + "x+" + ] + }, + "maxMspPairDistance": 2.4, + "_hideRatsNet": false +} diff --git a/tests/repros/repro-esp32-c3-r6-orphaned-v3v3-trace.test.ts b/tests/repros/repro-esp32-c3-r6-orphaned-v3v3-trace.test.ts new file mode 100644 index 000000000..2850e5968 --- /dev/null +++ b/tests/repros/repro-esp32-c3-r6-orphaned-v3v3-trace.test.ts @@ -0,0 +1,54 @@ +import { expect, test } from "bun:test" +import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver" +import capturedInput from "./assets/repro-esp32-c3-v1.0.1.input.json" +import "tests/fixtures/matcher" + +// Exact solver input captured from mohan-bee/esp32-c3 v1.0.1, reduced to its +// MCU section so the orphaned branch is visible in the snapshot. R6 is +// schematic_component_14 and its V3V3 pin is schematic_port_120. +const chips = capturedInput.chips.filter((chip) => chip.sectionId === "MCU") +const pinIds = new Set( + chips.flatMap((chip) => chip.pins.map((pin) => pin.pinId)), +) +const inputProblem = { + ...capturedInput, + chips, + directConnections: [], + netConnections: capturedInput.netConnections + .map((connection) => ({ + ...connection, + pinIds: connection.pinIds.filter((pinId) => pinIds.has(pinId)), + })) + .filter((connection) => connection.pinIds.length > 0), + textBoxes: capturedInput.textBoxes.filter((textBox) => + chips.some((chip) => chip.chipId === textBox.chipId), + ), +} + +test("repro ESP32-C3 fallback label leaves an orphaned V3V3 trace", () => { + const solver = new SchematicTracePipelineSolver(inputProblem as any) + + solver.solve() + + const output = solver.netLabelToTraceSolver!.getOutput() + const r6Trace = output.traces.find( + (trace) => + trace.pinIds.includes("schematic_port_120") && + trace.pinIds.includes("schematic_port_134"), + )! + const traceEnd = r6Trace.tracePath.at(-1)! + const targetPin = inputProblem.chips + .flatMap((chip) => chip.pins) + .find((pin) => pin.pinId === "schematic_port_134")! + const r6FallbackLabel = output.netLabelPlacements.find( + (label) => + label.netId === "V3V3" && label.pinIds.includes("schematic_port_120"), + ) + + expect((r6Trace as typeof r6Trace & { error?: string }).error).toBe( + "No collision-free path found", + ) + expect(traceEnd).not.toMatchObject({ x: targetPin.x, y: targetPin.y }) + expect(r6FallbackLabel).toBeDefined() + expect(solver).toMatchSolverSnapshot(import.meta.path) +})