@tscircuit/schematic-trace-solver 0.0.173 → 0.0.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +200 -74
  3. package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +12 -1
  4. package/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts +16 -1
  5. package/lib/solvers/InlineNetLabelSolver/restoreReroutesAroundSupersededLabels.ts +174 -0
  6. package/lib/solvers/NetLabelToTraceSolver/NetLabelToTraceSolver.ts +2 -30
  7. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +9 -0
  8. package/lib/utils/doesPathCoincideWithTraces.ts +17 -4
  9. package/lib/utils/pathIntersectsRenderedLabel.ts +33 -0
  10. package/package.json +1 -1
  11. package/site/bug-reports/bug-report-20260831T133233Z.page.tsx +4 -0
  12. package/site/bug-reports/bug-report-20260901T055358Z.page.tsx +4 -0
  13. package/site/bug-reports/bug-report-20260901T064117Z.page.tsx +4 -0
  14. package/site/bug-reports/bug-report-20260901T134241Z.page.tsx +4 -0
  15. package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +18 -18
  16. package/tests/bug-reports/bug-report-20260831T133233Z/__snapshots__/bug-report-20260831T133233Z.snap.svg +85 -0
  17. package/tests/bug-reports/bug-report-20260831T133233Z/bug-report-20260831T133233Z.json +172 -0
  18. package/tests/bug-reports/bug-report-20260831T133233Z/bug-report-20260831T133233Z.test.ts +25 -0
  19. package/tests/bug-reports/bug-report-20260901T055358Z/__snapshots__/bug-report-20260901T055358Z.snap.svg +676 -0
  20. package/tests/bug-reports/bug-report-20260901T055358Z/bug-report-20260901T055358Z.json +2467 -0
  21. package/tests/bug-reports/bug-report-20260901T055358Z/bug-report-20260901T055358Z.test.ts +59 -0
  22. package/tests/bug-reports/bug-report-20260901T064117Z/__snapshots__/bug-report-20260901T064117Z.snap.svg +134 -0
  23. package/tests/bug-reports/bug-report-20260901T064117Z/bug-report-20260901T064117Z.json +215 -0
  24. package/tests/bug-reports/bug-report-20260901T064117Z/bug-report-20260901T064117Z.test.ts +12 -0
  25. package/tests/bug-reports/bug-report-20260901T134241Z/__snapshots__/bug-report-20260901T134241Z.snap.svg +115 -0
  26. package/tests/bug-reports/bug-report-20260901T134241Z/bug-report-20260901T134241Z.json +359 -0
  27. package/tests/bug-reports/bug-report-20260901T134241Z/bug-report-20260901T134241Z.test.ts +12 -0
  28. package/tests/repros/__snapshots__/repro-bq40z60-current-sense.snap.svg +94 -0
  29. package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +10 -10
  30. package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +87 -87
  31. package/tests/repros/__snapshots__/repro-tida-01389-hbridge.snap.svg +47 -153
  32. package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +1625 -1625
  33. package/tests/repros/__snapshots__/repro-trellis-core-gnd-net-label-overlap.snap.svg +134 -0
  34. package/tests/repros/__snapshots__/repro-wireless-mouse-charger-section.snap.svg +164 -0
  35. package/tests/repros/assets/repro-bq40z60-current-sense.input.json +158 -0
  36. package/tests/repros/assets/repro-tida-01389-hbridge.input.json +67 -657
  37. package/tests/repros/assets/repro-trellis-core-gnd-net-label-overlap.input.json +178 -0
  38. package/tests/repros/assets/repro-wireless-mouse-charger-section.input.json +591 -0
  39. package/tests/repros/repro-bq40z60-current-sense.test.ts +18 -0
  40. package/tests/repros/repro-tida-01389-hbridge.test.ts +27 -6
  41. package/tests/repros/repro-trellis-core-gnd-net-label-overlap.test.ts +73 -0
  42. package/tests/repros/repro-wireless-mouse-charger-section.test.ts +16 -0
  43. package/tests/solvers/InlineNetLabelSolver/restore-reroutes-around-superseded-labels.test.ts +186 -0
@@ -0,0 +1,85 @@
1
+ <svg width="1200" height="2016" viewBox="0 0 1200 2016" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Solver debug visualization on top and Circuit JSON schematic on the bottom">
2
+ <g transform="translate(0, 0) scale(1.875, 1.875) translate(0, 0)">
3
+ <rect width="100%" height="100%" fill="white"/><g><polyline data-points="0.6000000000000001,-0.3 2.3410000000000006,-0.3 2.3410000000000006,-0.9510000000000001" data-type="line" data-label="" points="251.25432254008174,334.8758252121974 557.7491354919837,334.8758252121974 557.7491354919837,449.48129519019176" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.6000000000000001,0.5 1.6,0.5" data-type="line" data-label="" points="251.25432254008174,194.0396101854763 427.2995913234831,194.0396101854763" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.6000000000000001,0.30000000000000004 1.6,0.30000000000000004" data-type="line" data-label="" points="251.25432254008174,229.24866394215658 427.2995913234831,229.24866394215658" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.6000000000000001,0.10000000000000009 1.6,0.10000000000000009" data-type="line" data-label="" points="251.25432254008174,264.45771769883686 427.2995913234831,264.45771769883686" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.6000000000000001,-0.09999999999999998 1.6,-0.09999999999999998" data-type="line" data-label="" points="251.25432254008174,299.66677145551716 427.2995913234831,299.66677145551716" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.6000000000000001,-0.5 1.6,-0.5" data-type="line" data-label="" points="251.25432254008174,370.0848789688777 427.2995913234831,370.0848789688777" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40.00000000000003" y="158.83055642879606" width="211.25432254008172" height="246.46337629676194" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="SM06B-SRSS-TB(LF)(SN)" data-x="1.0599999999999998" data-y="-0.83" x="110.41810751336061" y="412.3357434768941" width="443.6340773341715" height="31.688148381012184" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="SPI1_DISPLAY" data-x="0.52" data-y="0.815" x="99.85539138635653" y="116.57969192077968" width="274.6306193021062" height="44.01131719585038" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="netId: GND
4
+ globalConnNetId: connectivity_net4" data-x="2.3410000000000006" data-y="-1.161" x="515.4982709839674" y="449.48129519019176" width="84.50172901603264" height="73.93901288902862" fill="#00000066" stroke="#000000" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="INLINE netId: SPI1_CS0
5
+ axis: x
6
+ side: y+" data-x="1.06" data-y="0.61" x="268.85884941842187" y="164.11191449229807" width="126.75259352404902" height="21.12543225400816" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="INLINE netId: SPI1_MISO
7
+ axis: x
8
+ side: y+" data-x="1.1" data-y="0.41000000000000003" x="268.8588494184219" y="199.32096824897835" width="140.8362150267211" height="21.12543225400816" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="INLINE netId: SPI1_MOSI
9
+ axis: x
10
+ side: y+" data-x="1.1" data-y="0.21000000000000008" x="268.8588494184219" y="234.53002200565862" width="140.8362150267211" height="21.12543225400816" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="INLINE netId: SPI1_CLK
11
+ axis: x
12
+ side: y+" data-x="1.06" data-y="0.010000000000000023" x="268.85884941842187" y="269.7390757623389" width="126.75259352404902" height="21.12543225400816" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.005680357142857144"/></g><g><rect data-type="rect" data-label="INLINE netId: P3V3
13
+ axis: x
14
+ side: y+" data-x="0.9000000000000001" data-y="-0.39" x="268.85884941842187" y="340.1571832756995" width="70.41810751336055" height="21.12543225400816" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.005680357142857144"/></g><text data-type="text" data-label="SPI1_CS0" data-x="0.7000000000000001" data-y="0.61" x="268.85884941842187" y="174.67463061930215" fill="green" font-size="21.125432254008167" font-family="sans-serif" text-anchor="start" dominant-baseline="central">SPI1_CS0</text><text data-type="text" data-label="SPI1_MISO" data-x="0.7000000000000001" data-y="0.41000000000000003" x="268.85884941842187" y="209.88368437598243" fill="green" font-size="21.125432254008167" font-family="sans-serif" text-anchor="start" dominant-baseline="central">SPI1_MISO</text><text data-type="text" data-label="SPI1_MOSI" data-x="0.7000000000000001" data-y="0.21000000000000008" x="268.85884941842187" y="245.0927381326627" fill="green" font-size="21.125432254008167" font-family="sans-serif" text-anchor="start" dominant-baseline="central">SPI1_MOSI</text><text data-type="text" data-label="SPI1_CLK" data-x="0.7000000000000001" data-y="0.010000000000000023" x="268.85884941842187" y="280.301791889343" fill="green" font-size="21.125432254008167" font-family="sans-serif" text-anchor="start" dominant-baseline="central">SPI1_CLK</text><text data-type="text" data-label="P3V3" data-x="0.7000000000000002" data-y="-0.39" x="268.8588494184219" y="350.71989940270356" fill="green" font-size="21.125432254008167" font-family="sans-serif" text-anchor="start" dominant-baseline="central">P3V3</text><g><circle data-type="point" data-label="6
15
+ x+" data-x="0.6000000000000001" data-y="0.5" cx="251.25432254008174" cy="194.0396101854763" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="5
16
+ x+" data-x="0.6000000000000001" data-y="0.30000000000000004" cx="251.25432254008174" cy="229.24866394215658" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="4
17
+ x+" data-x="0.6000000000000001" data-y="0.10000000000000009" cx="251.25432254008174" cy="264.45771769883686" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="3
18
+ x+" data-x="0.6000000000000001" data-y="-0.09999999999999998" cx="251.25432254008174" cy="299.66677145551716" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="2
19
+ x+" data-x="0.6000000000000001" data-y="-0.3" cx="251.25432254008174" cy="334.8758252121974" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="1
20
+ x+" data-x="0.6000000000000001" data-y="-0.5" cx="251.25432254008174" cy="370.0848789688777" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
21
+ orientation: y-" data-x="2.3410000000000006" data-y="-0.9510000000000001" cx="557.7491354919837" cy="449.48129519019176" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="inline anchor
22
+ SPI1_CS0" data-x="1.1" data-y="0.5" cx="339.2769569317825" cy="194.0396101854763" r="3" fill="green"/></g><g><circle data-type="point" data-label="inline anchor
23
+ SPI1_MISO" data-x="1.1" data-y="0.30000000000000004" cx="339.2769569317825" cy="229.24866394215658" r="3" fill="green"/></g><g><circle data-type="point" data-label="inline anchor
24
+ SPI1_MOSI" data-x="1.1" data-y="0.10000000000000009" cx="339.2769569317825" cy="264.45771769883686" r="3" fill="green"/></g><g><circle data-type="point" data-label="inline anchor
25
+ SPI1_CLK" data-x="1.1" data-y="-0.09999999999999998" cx="339.2769569317825" cy="299.66677145551716" r="3" fill="green"/></g><g><circle data-type="point" data-label="inline anchor
26
+ P3V3" data-x="1.1" data-y="-0.5" cx="339.2769569317825" cy="370.0848789688777" r="3" fill="green"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
27
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
28
+ const svg = e.currentTarget;
29
+ const rect = svg.getBoundingClientRect();
30
+ const x = e.clientX - rect.left;
31
+ const y = e.clientY - rect.top;
32
+ const crosshair = svg.getElementById('crosshair');
33
+ const h = svg.getElementById('crosshair-h');
34
+ const v = svg.getElementById('crosshair-v');
35
+ const coords = svg.getElementById('coordinates');
36
+
37
+ crosshair.style.display = 'block';
38
+ h.setAttribute('x1', '0');
39
+ h.setAttribute('x2', '640');
40
+ h.setAttribute('y1', y);
41
+ h.setAttribute('y2', y);
42
+ v.setAttribute('x1', x);
43
+ v.setAttribute('x2', x);
44
+ v.setAttribute('y1', '0');
45
+ v.setAttribute('y2', '640');
46
+
47
+ // Calculate real coordinates using inverse transformation
48
+ const matrix = {"a":176.0452687834014,"c":0,"e":145.6271612700409,"b":0,"d":-176.0452687834014,"f":282.062244577177};
49
+ // Manually invert and apply the affine transform
50
+ // Since we only use translate and scale, we can directly compute:
51
+ // x' = (x - tx) / sx
52
+ // y' = (y - ty) / sy
53
+ const sx = matrix.a;
54
+ const sy = matrix.d;
55
+ const tx = matrix.e;
56
+ const ty = matrix.f;
57
+ const realPoint = {
58
+ x: (x - tx) / sx,
59
+ y: (y - ty) / sy // Flip y back since we used negative scale
60
+ }
61
+
62
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
63
+ coords.setAttribute('x', (x + 5).toString());
64
+ coords.setAttribute('y', (y - 5).toString());
65
+ });
66
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
67
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
68
+ });
69
+ ]]></script>
70
+ </g>
71
+ <g transform="translate(0, 1216)">
72
+ <style>
73
+ .boundary { fill: rgb(245, 241, 237); }
74
+ .schematic-boundary { fill: none; stroke: #fff; }
75
+ .component { fill: none; stroke: rgb(132, 0, 0); }
76
+ .chip { fill: rgb(255, 255, 194); stroke: rgb(132, 0, 0); }
77
+ .component-pin { fill: none; stroke: rgb(132, 0, 0); }
78
+ .text { font-family: sans-serif; fill: rgb(0, 150, 0); }
79
+ .pin-number { fill: rgb(169, 0, 0); }
80
+ .port-label { fill: rgb(0, 100, 100); }
81
+ .component-name { fill: rgb(0, 100, 100); }
82
+
83
+ </style><rect class="boundary" x="0" y="0" width="1200" height="800"/><g class="trace sch-trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_0__stack1"><path d="M 488.07558952942003 423.36624830191 L 911.6851517671439 423.36624830191 L 911.6851517671439 581.7636205114206" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="38.930229728912px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 488.07558952942003 423.36624830191 L 911.6851517671439 423.36624830191 L 911.6851517671439 581.7636205114206" stroke="rgb(0, 150, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace sch-trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_1__stack1"><path d="M 488.07558952942003 228.71509965734998 L 731.38952533512 228.71509965734998" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="38.930229728912px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 488.07558952942003 228.71509965734998 L 731.38952533512 228.71509965734998" stroke="rgb(0, 150, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace sch-trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_2__stack1"><path d="M 488.07558952942003 277.37788681848997 L 731.38952533512 277.37788681848997" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="38.930229728912px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 488.07558952942003 277.37788681848997 L 731.38952533512 277.37788681848997" stroke="rgb(0, 150, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace sch-trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_3__stack1"><path d="M 488.07558952942003 326.04067397962996 L 731.38952533512 326.04067397962996" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="38.930229728912px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 488.07558952942003 326.04067397962996 L 731.38952533512 326.04067397962996" stroke="rgb(0, 150, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace sch-trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_4__stack1"><path d="M 488.07558952942003 374.70346114076995 L 731.38952533512 374.70346114076995" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="38.930229728912px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 488.07558952942003 374.70346114076995 L 731.38952533512 374.70346114076995" stroke="rgb(0, 150, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace sch-trace" data-layer="base" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_5__stack1"><path d="M 488.07558952942003 472.02903546305 L 731.38952533512 472.02903546305" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="38.930229728912px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 488.07558952942003 472.02903546305 L 731.38952533512 472.02903546305" stroke="rgb(0, 150, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round" stroke-linejoin="round"/></g><g class="trace-overlays sch-trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_0__stack1"/><g class="trace-overlays sch-trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_1__stack1"/><g class="trace-overlays sch-trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_2__stack1"/><g class="trace-overlays sch-trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_3__stack1"/><g class="trace-overlays sch-trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_4__stack1"/><g class="trace-overlays sch-trace-overlays" data-layer="overlay" data-circuit-json-type="schematic_trace" data-schematic-trace-id="schematic_trace_5__stack1"/><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_0__stack1"><rect class="component chip sch-component-body" x="293.42444088486" y="180.05231249621" width="97.32557432227998" height="340.63951012798" stroke-width="4.866278716114px" fill="rgb(255, 255, 194)" stroke="rgb(132, 0, 0)"/><rect class="component-overlay sch-component-overlay" x="293.42444088486" y="180.05231249621" width="97.32557432227998" height="340.63951012798" fill="transparent"/><line class="component-pin sch-component-pin sch-port-line" x1="390.75001520714" y1="228.71509965734998" x2="488.07558952942003" y2="228.71509965734998" stroke-width="4.866278716114px"/><g class="sch-port" data-schematic-port-id="source_port_0_0__stack1"><rect x="483.20931081330605" y="223.84882094123597" width="9.732557432228" height="9.732557432228" opacity="0"/></g><text class="pin-number sch-pin-number" x="439.41280236828004" y="223.84882094123597" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="36.497090370855px" transform="">6</text><line class="component-pin sch-component-pin sch-port-line" x1="390.75001520714" y1="277.37788681848997" x2="488.07558952942003" y2="277.37788681848997" stroke-width="4.866278716114px"/><g class="sch-port" data-schematic-port-id="source_port_0_1__stack1"><rect x="483.20931081330605" y="272.511608102376" width="9.732557432228" height="9.732557432228" opacity="0"/></g><text class="pin-number sch-pin-number" x="439.41280236828004" y="272.51160810237593" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="36.497090370855px" transform="">5</text><line class="component-pin sch-component-pin sch-port-line" x1="390.75001520714" y1="326.04067397962996" x2="488.07558952942003" y2="326.04067397962996" stroke-width="4.866278716114px"/><g class="sch-port" data-schematic-port-id="source_port_0_2__stack1"><rect x="483.20931081330605" y="321.174395263516" width="9.732557432228" height="9.732557432228" opacity="0"/></g><text class="pin-number sch-pin-number" x="439.41280236828004" y="321.174395263516" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="36.497090370855px" transform="">4</text><line class="component-pin sch-component-pin sch-port-line" x1="390.75001520714" y1="374.70346114076995" x2="488.07558952942003" y2="374.70346114076995" stroke-width="4.866278716114px"/><g class="sch-port" data-schematic-port-id="source_port_0_3__stack1"><rect x="483.20931081330605" y="369.83718242465596" width="9.732557432228" height="9.732557432228" opacity="0"/></g><text class="pin-number sch-pin-number" x="439.41280236828004" y="369.83718242465596" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="36.497090370855px" transform="">3</text><line class="component-pin sch-component-pin sch-port-line" x1="390.75001520714" y1="423.36624830191" x2="488.07558952942003" y2="423.36624830191" stroke-width="4.866278716114px"/><g class="sch-port" data-schematic-port-id="source_port_0_4__stack1"><rect x="483.20931081330605" y="418.499969585796" width="9.732557432228" height="9.732557432228" opacity="0"/></g><text class="pin-number sch-pin-number" x="439.41280236828004" y="418.49996958579595" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="36.497090370855px" transform="">2</text><line class="component-pin sch-component-pin sch-port-line" x1="390.75001520714" y1="472.02903546305" x2="488.07558952942003" y2="472.02903546305" stroke-width="4.866278716114px"/><g class="sch-port" data-schematic-port-id="source_port_0_5__stack1"><rect x="483.20931081330605" y="467.162756746936" width="9.732557432228" height="9.732557432228" opacity="0"/></g><text class="pin-number sch-pin-number" x="439.41280236828004" y="467.162756746936" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="36.497090370855px" transform="">1</text></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_0__stack1"><circle cx="488.07558952942003" cy="228.71509965734998" r="9.732557432228" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_1__stack1"><circle cx="488.07558952942003" cy="277.37788681848997" r="9.732557432228" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_2__stack1"><circle cx="488.07558952942003" cy="326.04067397962996" r="9.732557432228" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_3__stack1"><circle cx="488.07558952942003" cy="374.70346114076995" r="9.732557432228" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_4__stack1"><circle cx="488.07558952942003" cy="423.36624830191" r="9.732557432228" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_5__stack1"><circle cx="488.07558952942003" cy="472.02903546305" r="9.732557432228" fill="red" opacity="0"/></g><rect class="component-overlay sch-component-overlay sch-net-label-overlay" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_0__stack1" x="882.4874794704599" y="581.7636205114208" width="58.39534459336801" height="43.79650844502601" fill="transparent"/><path class="sch-net-label-symbol-path" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_0__stack1" d="M 882.4874794704599 625.5601289564466 L 940.8828240638279 625.5601289564468" stroke="rgb(132, 0, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round"/><path class="sch-net-label-symbol-path" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_0__stack1" d="M 911.6851517671439 625.5601289564466 L 911.6851517671439 581.7636205114208" stroke="rgb(132, 0, 0)" fill="none" stroke-width="4.866278716114px" stroke-linecap="round"/><text class="sch-net-label-symbol-text" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_0__stack1" x="911.6851517671439" y="637.7258257467317" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="43.796508445026px">XX</text><text class="sch-text" x="600.000000000042" y="552.322634278931" fill="#7e22ce" text-anchor="middle" dominant-baseline="middle" font-family="sans-serif" font-size="43.796508445025985px" transform="rotate(0, 600.000000000042, 552.322634278931)">SM06B-SRSS-TB(LF)(SN)</text><text class="sch-text" x="468.61047466496404" y="152.0712098785545" fill="#7e22ce" text-anchor="middle" dominant-baseline="middle" font-family="sans-serif" font-size="43.796508445026px" transform="rotate(0, 468.61047466496404, 152.0712098785545)">SPI1_DISPLAY</text><text class="sch-text" x="600.0000000000421" y="201.950566718723" fill="#047857" text-anchor="middle" dominant-baseline="middle" font-family="sans-serif" font-size="29.197672296683997px" transform="rotate(0, 600.0000000000421, 201.950566718723)">XXXXXXXX</text><text class="sch-text" x="609.73255743227" y="250.61335387986298" fill="#047857" text-anchor="middle" dominant-baseline="middle" font-family="sans-serif" font-size="29.197672296683997px" transform="rotate(0, 609.73255743227, 250.61335387986298)">XXXXXXXXX</text><text class="sch-text" x="609.73255743227" y="299.276141041003" fill="#047857" text-anchor="middle" dominant-baseline="middle" font-family="sans-serif" font-size="29.197672296683997px" transform="rotate(0, 609.73255743227, 299.276141041003)">XXXXXXXXX</text><text class="sch-text" x="600.0000000000421" y="347.93892820214296" fill="#047857" text-anchor="middle" dominant-baseline="middle" font-family="sans-serif" font-size="29.197672296683997px" transform="rotate(0, 600.0000000000421, 347.93892820214296)">XXXXXXXX</text><text class="sch-text" x="561.06977027113" y="445.264502524423" fill="#047857" text-anchor="middle" dominant-baseline="middle" font-family="sans-serif" font-size="29.197672296683997px" transform="rotate(0, 561.06977027113, 445.264502524423)">XXXX</text><rect class="schematic-box sch-box" x="293.42444088485996" y="530.4243800564179" width="613.1511182303641" height="43.79650844502601" stroke-width="4.866278716114px" stroke="rgb(132, 0, 0)" fill="transparent" stroke-dasharray="38.930229728912 19.465114864456"/><rect class="schematic-box sch-box" x="278.825604736518" y="121.65696790284198" width="379.56973985689206" height="60.828483951425" stroke-width="4.866278716114px" stroke="rgb(132, 0, 0)" fill="transparent" stroke-dasharray="38.930229728912 19.465114864456"/>
84
+ </g>
85
+ </svg>
@@ -0,0 +1,172 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 1.2000000000000002,
10
+ "height": 1.4,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_0",
14
+ "displayName": "6",
15
+ "x": 0.6000000000000001,
16
+ "y": 0.5
17
+ },
18
+ {
19
+ "pinId": "schematic_port_1",
20
+ "displayName": "5",
21
+ "x": 0.6000000000000001,
22
+ "y": 0.30000000000000004
23
+ },
24
+ {
25
+ "pinId": "schematic_port_2",
26
+ "displayName": "4",
27
+ "x": 0.6000000000000001,
28
+ "y": 0.10000000000000009
29
+ },
30
+ {
31
+ "pinId": "schematic_port_3",
32
+ "displayName": "3",
33
+ "x": 0.6000000000000001,
34
+ "y": -0.09999999999999998
35
+ },
36
+ {
37
+ "pinId": "schematic_port_4",
38
+ "displayName": "2",
39
+ "x": 0.6000000000000001,
40
+ "y": -0.3
41
+ },
42
+ {
43
+ "pinId": "schematic_port_5",
44
+ "displayName": "1",
45
+ "x": 0.6000000000000001,
46
+ "y": -0.5
47
+ }
48
+ ]
49
+ }
50
+ ],
51
+ "directConnections": [],
52
+ "netConnections": [
53
+ {
54
+ "netId": "SPI1_CS0",
55
+ "isGround": false,
56
+ "netLabelWidth": 1.08,
57
+ "anchoredNetLabelWidth": 1.08,
58
+ "allowInlineNetLabel": true,
59
+ "inlineNetLabelHeight": 0.12,
60
+ "inlineNetLabelWidth": 0.72,
61
+ "pinIds": [
62
+ "schematic_port_0"
63
+ ]
64
+ },
65
+ {
66
+ "netId": "SPI1_MISO",
67
+ "isGround": false,
68
+ "netLabelWidth": 1.2,
69
+ "anchoredNetLabelWidth": 1.2,
70
+ "allowInlineNetLabel": true,
71
+ "inlineNetLabelHeight": 0.12,
72
+ "inlineNetLabelWidth": 0.8,
73
+ "pinIds": [
74
+ "schematic_port_1"
75
+ ]
76
+ },
77
+ {
78
+ "netId": "SPI1_MOSI",
79
+ "isGround": false,
80
+ "netLabelWidth": 1.2,
81
+ "anchoredNetLabelWidth": 1.2,
82
+ "allowInlineNetLabel": true,
83
+ "inlineNetLabelHeight": 0.12,
84
+ "inlineNetLabelWidth": 0.8,
85
+ "pinIds": [
86
+ "schematic_port_2"
87
+ ]
88
+ },
89
+ {
90
+ "netId": "SPI1_CLK",
91
+ "isGround": false,
92
+ "netLabelWidth": 1.08,
93
+ "anchoredNetLabelWidth": 1.08,
94
+ "allowInlineNetLabel": true,
95
+ "inlineNetLabelHeight": 0.12,
96
+ "inlineNetLabelWidth": 0.72,
97
+ "pinIds": [
98
+ "schematic_port_3"
99
+ ]
100
+ },
101
+ {
102
+ "netId": "GND",
103
+ "isGround": true,
104
+ "netLabelWidth": 0.42,
105
+ "netLabelHeight": 0.48,
106
+ "pinIds": [
107
+ "schematic_port_4"
108
+ ]
109
+ },
110
+ {
111
+ "netId": "P3V3",
112
+ "isGround": false,
113
+ "netLabelWidth": 0.6,
114
+ "anchoredNetLabelWidth": 0.6,
115
+ "allowInlineNetLabel": true,
116
+ "inlineNetLabelHeight": 0.12,
117
+ "inlineNetLabelWidth": 0.4,
118
+ "pinIds": [
119
+ "schematic_port_5"
120
+ ]
121
+ }
122
+ ],
123
+ "textBoxes": [
124
+ {
125
+ "chipId": "schematic_component_0",
126
+ "center": {
127
+ "x": 1.0599999999999998,
128
+ "y": -0.83
129
+ },
130
+ "width": 2.52,
131
+ "height": 0.17999999999999994,
132
+ "text": "SM06B-SRSS-TB(LF)(SN)"
133
+ },
134
+ {
135
+ "chipId": "schematic_component_0",
136
+ "center": {
137
+ "x": 0.52,
138
+ "y": 0.815
139
+ },
140
+ "width": 1.56,
141
+ "height": 0.25,
142
+ "text": "SPI1_DISPLAY"
143
+ }
144
+ ],
145
+ "availableNetLabelOrientations": {
146
+ "SPI1_CS0": [
147
+ "x-",
148
+ "x+"
149
+ ],
150
+ "SPI1_MISO": [
151
+ "x-",
152
+ "x+"
153
+ ],
154
+ "SPI1_MOSI": [
155
+ "x-",
156
+ "x+"
157
+ ],
158
+ "SPI1_CLK": [
159
+ "x-",
160
+ "x+"
161
+ ],
162
+ "GND": [
163
+ "y-"
164
+ ],
165
+ "P3V3": [
166
+ "x-",
167
+ "x+"
168
+ ]
169
+ },
170
+ "maxMspPairDistance": 2.4,
171
+ "_hideRatsNet": false
172
+ }
@@ -0,0 +1,25 @@
1
+ import { expect, test } from "bun:test"
2
+ import { isPathCollidingWithObstacles } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/collisions"
3
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
4
+ import { getTextBoxBounds } from "lib/utils/textBoxBounds"
5
+ import inputProblem from "./bug-report-20260831T133233Z.json"
6
+ import "tests/fixtures/matcher"
7
+
8
+ test("bug-report-20260831T133233Z", () => {
9
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
10
+
11
+ solver.solve()
12
+
13
+ const textBoxBounds = inputProblem.textBoxes.map((textBox) =>
14
+ getTextBoxBounds(textBox),
15
+ )
16
+ const crossingTraceIds = solver
17
+ .netLabelToTraceSolver!.getOutput()
18
+ .traces.filter((trace) =>
19
+ isPathCollidingWithObstacles(trace.tracePath, textBoxBounds),
20
+ )
21
+ .map((trace) => trace.mspPairId)
22
+
23
+ expect(crossingTraceIds).toEqual([])
24
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
25
+ })