@tscircuit/schematic-trace-solver 0.0.136 → 0.0.140

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 (25) hide show
  1. package/.github/workflows/bun-pver-release.yml +7 -3
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.js +333 -45
  4. package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationObstacleIndex.ts +182 -0
  5. package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +67 -25
  6. package/lib/solvers/AvailableNetOrientationSolver/constants.ts +2 -0
  7. package/lib/solvers/Example28Solver/labelMovement.ts +71 -0
  8. package/lib/solvers/SameNetJunctionAlignmentSolver/SameNetJunctionAlignmentSolver.ts +5 -2
  9. package/lib/solvers/SameNetJunctionAlignmentSolver/alignSameNetJunctions.ts +93 -14
  10. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +12 -4
  11. package/package.json +5 -1
  12. package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +4 -4
  13. package/tests/bug-reports/bug-report-20260721T221026Z/bug-report-20260721T221026Z.test.ts +11 -0
  14. package/tests/bug-reports/bug-report-20260815T073240Z/__snapshots__/bug-report-20260815T073240Z.snap.svg +3 -3
  15. package/tests/bug-reports/bug-report-20260815T073240Z/bug-report-20260815T073240Z.test.ts +39 -0
  16. package/tests/bug-reports/bug-report-20260819T091818Z/__snapshots__/bug-report-20260819T091818Z.snap.svg +237 -0
  17. package/tests/bug-reports/bug-report-20260819T091818Z/bug-report-20260819T091818Z.json +1052 -0
  18. package/tests/bug-reports/bug-report-20260819T091818Z/bug-report-20260819T091818Z.test.ts +33 -0
  19. package/tests/repros/__snapshots__/repro-board-589-regulator-section.snap.svg +4 -4
  20. package/tests/repros/__snapshots__/repro-board-648-esp12f-section.snap.svg +124 -0
  21. package/tests/repros/assets/repro-board-648-esp12f-section.input.json +537 -0
  22. package/tests/repros/repro-board-589-regulator-section.test.ts +23 -1
  23. package/tests/repros/repro-board-648-esp12f-section.test.ts +13 -0
  24. package/tests/repros/repro161-power-section-autolayout.test.ts +7 -0
  25. package/tests/solvers/AvailableNetOrientationSolver/AvailableNetOrientationObstacleIndex.test.ts +122 -0
@@ -1,4 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
+ import { tracePathContainsPoint } from "lib/solvers/RailNetLabelCornerPlacementSolver/geometry"
2
3
  import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
4
  import inputProblem from "./bug-report-20260721T221026Z.json"
4
5
  import "tests/fixtures/matcher"
@@ -8,5 +9,15 @@ test("bug-report-20260721T221026Z", () => {
8
9
 
9
10
  solver.solve()
10
11
 
12
+ const junctionOutput = solver.sameNetJunctionAlignmentSolver!.getOutput()
13
+ const alignedTrace = junctionOutput.traces.find(
14
+ (trace) => trace.mspPairId === "R_RUN.1-C_MCU1.1",
15
+ )!
16
+ const attachedLabel = junctionOutput.netLabelPlacements.find((label) =>
17
+ label.mspConnectionPairIds.includes(alignedTrace.mspPairId),
18
+ )!
19
+ expect(
20
+ tracePathContainsPoint(alignedTrace.tracePath, attachedLabel.anchorPoint),
21
+ ).toBe(true)
11
22
  expect(solver).toMatchSolverSnapshot(import.meta.path)
12
23
  })
@@ -1,11 +1,11 @@
1
- <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-2.6508333333333325,2.473333333333333 -4.532499999999999,1.8875000000000002" data-type="line" data-label="" points="151.35991186393994,208.0385595262687 64.29250154926669,235.1459064931488" fill="none" stroke="hsl(32, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-4.532499999999999,1.8875000000000002 -1.5208333333333326,2.473333333333333" data-type="line" data-label="" points="64.29250154926669,235.1459064931488 203.64662948426633,208.0385595262687" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,1.8875000000000002 -2.6508333333333325,2.473333333333333" data-type="line" data-label="" points="64.29250154926669,235.1459064931488 151.35991186393994,208.0385595262687" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.5208333333333326,2.473333333333333 -2.6508333333333325,2.473333333333333" data-type="line" data-label="" points="203.64662948426633,208.0385595262687 151.35991186393994,208.0385595262687" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -1.2850000000000001,0.2" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 214.55897541830194,313.2289471872203" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -1.2850000000000001,-0.2" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 214.55897541830194,331.7375197961854" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -2.469999999999999,1.7475" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 159.72732906424295,241.6239069062866" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -1.2850000000000001,-0.2" data-type="line" data-label="" points="214.55897541830194,313.2289471872203 214.55897541830194,331.7375197961854" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -2.469999999999999,1.7475" data-type="line" data-label="" points="214.55897541830194,313.2289471872203 159.72732906424295,241.6239069062866" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -2.469999999999999,1.7475" data-type="line" data-label="" points="214.55897541830194,331.7375197961854 159.72732906424295,241.6239069062866" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -2.469999999999999,0.9875000000000003" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 159.72732906424295,276.79019486332027" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 2.6075,-0.78" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 394.6705226192935,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 6.245,-2.4050000000000002" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 562.9828547820698,433.76602630310543" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 3.9924999999999997,-0.78" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.469999999999999,0.9875000000000003 2.6075,-0.78" data-type="line" data-label="" points="159.72732906424295,276.79019486332027 394.6705226192935,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.469999999999999,0.9875000000000003 6.245,-2.4050000000000002" data-type="line" data-label="" points="159.72732906424295,276.79019486332027 562.9828547820698,433.76602630310543" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.469999999999999,0.9875000000000003 3.9924999999999997,-0.78" data-type="line" data-label="" points="159.72732906424295,276.79019486332027 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.78 6.245,-2.4050000000000002" data-type="line" data-label="" points="394.6705226192935,358.57495007918476 562.9828547820698,433.76602630310543" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.78 3.9924999999999997,-0.78" data-type="line" data-label="" points="394.6705226192935,358.57495007918476 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="6.245,-2.4050000000000002 3.9924999999999997,-0.78" data-type="line" data-label="" points="562.9828547820698,433.76602630310543 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 2.6075,-0.019999999999999907" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 394.6705226192935,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 6.245,-0.07500000000000018" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 562.9828547820698,325.9535908558838" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 458.75645527783513,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.019999999999999907 6.245,-0.07500000000000018" data-type="line" data-label="" points="394.6705226192935,323.4086621221511 562.9828547820698,325.9535908558838" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.019999999999999907 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="394.6705226192935,323.4086621221511 458.75645527783513,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="6.245,-0.07500000000000018 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="562.9828547820698,325.9535908558838 458.75645527783513,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="6.245,-1.205 6.245,-1.8050000000000006" data-type="line" data-label="" points="562.9828547820698,378.2403084762102 562.9828547820698,406.00316738965785" fill="none" stroke="hsl(187, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -1.485,-0.2 -1.485,0.2 -1.2850000000000001,0.2" data-type="line" data-label="" points="214.55897541830194,331.7375197961854 205.30468911381942,331.7375197961854 205.30468911381942,313.2289471872203 214.55897541830194,313.2289471872203" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,0 -2.469999999999999,0 -2.469999999999999,0.9875000000000003" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 159.72732906424295,322.48323349170283 159.72732906424295,276.79019486332027" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="3.9924999999999997,-0.78 3.9924999999999997,-0.9800000000000002 2.6075,-0.9800000000000002 2.6075,-0.78" data-type="line" data-label="" points="458.75645527783513,358.57495007918476 458.75645527783513,367.8292363836673 394.6705226192935,367.8292363836673 394.6705226192935,358.57495007918476" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="3.9924999999999997,-0.019999999999999907 3.9924999999999997,0.18000000000000027 2.6075,0.18000000000000027 2.6075,-0.019999999999999907" data-type="line" data-label="" points="458.75645527783513,323.4086621221511 458.75645527783513,314.15437581766855 394.6705226192935,314.15437581766855 394.6705226192935,323.4086621221511" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.2850000000000001,0.1 2.6075,0.1 2.6075,-0.019999999999999907" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 394.6705226192935,317.85609033946156 394.6705226192935,323.4086621221511" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="6.245,-0.07500000000000007 6.245,0.18000000000000027 3.9924999999999997,0.18000000000000027 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="562.9828547820698,325.9535908558838 562.9828547820698,314.15437581766855 458.75645527783513,314.15437581766855 458.75645527783513,323.4086621221511" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="6.245,-1.205 6.245,-1.8050000000000006" data-type="line" data-label="" points="562.9828547820698,378.2403084762102 562.9828547820698,406.00316738965785" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-4.532499999999999,1.8875000000000002 -4.532499999999999,2.473333333333333 -2.8508333333333327,2.473333333333333" data-type="line" data-label="" points="64.29250154926669,235.1459064931488 64.29250154926669,208.0385595262687 142.1056255594574,208.0385595262687" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -4.532499999999999,-0.20000000000000018 -1.2850000000000001,-0.20000000000000018" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 64.29250154926669,331.7375197961854 214.55897541830194,331.7375197961854" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.6508333333333325,2.473333333333333 -2.8508333333333327,2.473333333333333 -2.8508333333333327,1.8933333333333333 -1.3208333333333324,1.8933333333333333 -1.3208333333333324,2.473333333333333 -1.5208333333333326,2.473333333333333" data-type="line" data-label="" points="151.35991186393994,208.0385595262687 142.1056255594574,208.0385595262687 142.1056255594574,234.87598980926808 212.90091578874888,234.87598980926808 212.90091578874888,208.0385595262687 203.64662948426633,208.0385595262687" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.469999999999999,1.7475 -2.469999999999999,1.8485 -2.9209999999999985,1.8485" data-type="line" data-label="" points="159.72732906424295,241.6239069062866 159.72732906424295,236.9504923225229 138.85891344763482,236.9504923225229" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.8774999999999995,0 -4.817499999999998,0 -4.817499999999998,-0.051000000000000004" data-type="line" data-label="" points="187.14315224127245,322.48323349170283 51.10514356537911,322.48323349170283 51.10514356537911,324.8430764993459" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-4.432499999999998" data-y="1.3675000000000002" x="51.79921503821528" y="235.1459064931488" width="34.24085932658542" height="48.12228878330927" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-2.0858333333333325" data-y="2.513333333333333" x="151.35991186393994" y="186.75370102595883" width="52.286717620326385" height="38.868002478826696" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="0" data-y="0" x="214.55897541830194" y="308.601804034979" width="118.91757901260075" height="27.762858913447644" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_3" data-x="-2.397499999999999" data-y="1.3675000000000002" x="138.90518487915722" y="241.6239069062866" width="48.353645940921325" height="35.16628795703366" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_4" data-x="2.6799999999999997" data-y="-0.39999999999999997" x="373.8483784342077" y="323.4086621221511" width="48.35364594092135" height="35.16628795703366" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_5" data-x="6.4825" data-y="-0.6400000000000001" x="547.9446395372856" y="325.9535908558838" width="52.05536046271436" height="52.286717620326385" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_6" data-x="6.4025" data-y="-2.1050000000000004" x="547.9446395372856" y="406.00316738965785" width="44.65193141912823" height="27.762858913447587" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_7" data-x="4.005" data-y="-0.39999999999999997" x="437.93431109274934" y="323.4086621221511" width="42.80107415823181" height="35.16628795703366" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="AP2112K-3.3" data-x="-0.2250000000000001" data-y="-0.43" x="233.06754802726704" y="338.21552020932313" width="61.0782896095848" height="8.328857674034339" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="U2" data-x="-0.765" data-y="0.41500000000000004" x="230.2912621359223" y="297.4966604696" width="16.657715348068564" height="11.567857880603128" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: VBUS
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-2.6508333333333325,2.473333333333333 -4.532499999999999,1.8875000000000002" data-type="line" data-label="" points="151.35991186393994,208.0385595262687 64.29250154926669,235.1459064931488" fill="none" stroke="hsl(32, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-4.532499999999999,1.8875000000000002 -1.5208333333333326,2.473333333333333" data-type="line" data-label="" points="64.29250154926669,235.1459064931488 203.64662948426633,208.0385595262687" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,1.8875000000000002 -2.6508333333333325,2.473333333333333" data-type="line" data-label="" points="64.29250154926669,235.1459064931488 151.35991186393994,208.0385595262687" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.5208333333333326,2.473333333333333 -2.6508333333333325,2.473333333333333" data-type="line" data-label="" points="203.64662948426633,208.0385595262687 151.35991186393994,208.0385595262687" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -1.2850000000000001,0.2" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 214.55897541830194,313.2289471872203" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -1.2850000000000001,-0.2" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 214.55897541830194,331.7375197961854" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -2.469999999999999,1.7475" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 159.72732906424295,241.6239069062866" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -1.2850000000000001,-0.2" data-type="line" data-label="" points="214.55897541830194,313.2289471872203 214.55897541830194,331.7375197961854" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -2.469999999999999,1.7475" data-type="line" data-label="" points="214.55897541830194,313.2289471872203 159.72732906424295,241.6239069062866" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -2.469999999999999,1.7475" data-type="line" data-label="" points="214.55897541830194,331.7375197961854 159.72732906424295,241.6239069062866" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -2.469999999999999,0.9875000000000003" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 159.72732906424295,276.79019486332027" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 2.6075,-0.78" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 394.6705226192935,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 6.245,-2.4050000000000002" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 562.9828547820698,433.76602630310543" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 3.9924999999999997,-0.78" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.469999999999999,0.9875000000000003 2.6075,-0.78" data-type="line" data-label="" points="159.72732906424295,276.79019486332027 394.6705226192935,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.469999999999999,0.9875000000000003 6.245,-2.4050000000000002" data-type="line" data-label="" points="159.72732906424295,276.79019486332027 562.9828547820698,433.76602630310543" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.469999999999999,0.9875000000000003 3.9924999999999997,-0.78" data-type="line" data-label="" points="159.72732906424295,276.79019486332027 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.78 6.245,-2.4050000000000002" data-type="line" data-label="" points="394.6705226192935,358.57495007918476 562.9828547820698,433.76602630310543" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.78 3.9924999999999997,-0.78" data-type="line" data-label="" points="394.6705226192935,358.57495007918476 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="6.245,-2.4050000000000002 3.9924999999999997,-0.78" data-type="line" data-label="" points="562.9828547820698,433.76602630310543 458.75645527783513,358.57495007918476" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 2.6075,-0.019999999999999907" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 394.6705226192935,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 6.245,-0.07500000000000018" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 562.9828547820698,325.9535908558838" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 458.75645527783513,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.019999999999999907 6.245,-0.07500000000000018" data-type="line" data-label="" points="394.6705226192935,323.4086621221511 562.9828547820698,325.9535908558838" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.6075,-0.019999999999999907 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="394.6705226192935,323.4086621221511 458.75645527783513,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="6.245,-0.07500000000000018 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="562.9828547820698,325.9535908558838 458.75645527783513,323.4086621221511" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="6.245,-1.205 6.245,-1.8050000000000006" data-type="line" data-label="" points="562.9828547820698,378.2403084762102 562.9828547820698,406.00316738965785" fill="none" stroke="hsl(187, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -1.485,-0.2 -1.485,0.2 -1.2850000000000001,0.2" data-type="line" data-label="" points="214.55897541830194,331.7375197961854 205.30468911381942,331.7375197961854 205.30468911381942,313.2289471872203 214.55897541830194,313.2289471872203" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,0 -2.469999999999999,0 -2.469999999999999,0.9875000000000003" data-type="line" data-label="" points="214.55897541830194,322.48323349170283 159.72732906424295,322.48323349170283 159.72732906424295,276.79019486332027" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="3.9924999999999997,-0.78 3.9924999999999997,-0.9800000000000002 2.6075,-0.9800000000000002 2.6075,-0.78" data-type="line" data-label="" points="458.75645527783513,358.57495007918476 458.75645527783513,367.8292363836673 394.6705226192935,367.8292363836673 394.6705226192935,358.57495007918476" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="3.9924999999999997,-0.019999999999999907 3.9924999999999997,0.1 2.6075,0.1 2.6075,-0.019999999999999907" data-type="line" data-label="" points="458.75645527783513,323.4086621221511 458.75645527783513,317.85609033946156 394.6705226192935,317.85609033946156 394.6705226192935,323.4086621221511" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.2850000000000001,0.1 2.6075,0.1 2.6075,-0.019999999999999907" data-type="line" data-label="" points="333.4765544309027,317.85609033946156 394.6705226192935,317.85609033946156 394.6705226192935,323.4086621221511" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="6.245,-0.07500000000000018 6.245,0.1 3.9924999999999997,0.1 3.9924999999999997,-0.019999999999999907" data-type="line" data-label="" points="562.9828547820698,325.9535908558838 562.9828547820698,317.85609033946156 458.75645527783513,317.85609033946156 458.75645527783513,323.4086621221511" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="6.245,-1.205 6.245,-1.8050000000000006" data-type="line" data-label="" points="562.9828547820698,378.2403084762102 562.9828547820698,406.00316738965785" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-4.532499999999999,1.8875000000000002 -4.532499999999999,2.473333333333333 -2.8508333333333327,2.473333333333333" data-type="line" data-label="" points="64.29250154926669,235.1459064931488 64.29250154926669,208.0385595262687 142.1056255594574,208.0385595262687" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-4.532499999999999,0.8475000000000001 -4.532499999999999,-0.20000000000000018 -1.2850000000000001,-0.20000000000000018" data-type="line" data-label="" points="64.29250154926669,283.2681952764581 64.29250154926669,331.7375197961854 214.55897541830194,331.7375197961854" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.6508333333333325,2.473333333333333 -2.8508333333333327,2.473333333333333 -2.8508333333333327,1.8933333333333333 -1.3208333333333324,1.8933333333333333 -1.3208333333333324,2.473333333333333 -1.5208333333333326,2.473333333333333" data-type="line" data-label="" points="151.35991186393994,208.0385595262687 142.1056255594574,208.0385595262687 142.1056255594574,234.87598980926808 212.90091578874888,234.87598980926808 212.90091578874888,208.0385595262687 203.64662948426633,208.0385595262687" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.469999999999999,1.7475 -2.469999999999999,1.8485 -2.9209999999999985,1.8485" data-type="line" data-label="" points="159.72732906424295,241.6239069062866 159.72732906424295,236.9504923225229 138.85891344763482,236.9504923225229" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.8774999999999995,0 -4.817499999999998,0 -4.817499999999998,-0.051000000000000004" data-type="line" data-label="" points="187.14315224127245,322.48323349170283 51.10514356537911,322.48323349170283 51.10514356537911,324.8430764993459" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-4.432499999999998" data-y="1.3675000000000002" x="51.79921503821528" y="235.1459064931488" width="34.24085932658542" height="48.12228878330927" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-2.0858333333333325" data-y="2.513333333333333" x="151.35991186393994" y="186.75370102595883" width="52.286717620326385" height="38.868002478826696" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="0" data-y="0" x="214.55897541830194" y="308.601804034979" width="118.91757901260075" height="27.762858913447644" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_3" data-x="-2.397499999999999" data-y="1.3675000000000002" x="138.90518487915722" y="241.6239069062866" width="48.353645940921325" height="35.16628795703366" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_4" data-x="2.6799999999999997" data-y="-0.39999999999999997" x="373.8483784342077" y="323.4086621221511" width="48.35364594092135" height="35.16628795703366" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_5" data-x="6.4825" data-y="-0.6400000000000001" x="547.9446395372856" y="325.9535908558838" width="52.05536046271436" height="52.286717620326385" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_6" data-x="6.4025" data-y="-2.1050000000000004" x="547.9446395372856" y="406.00316738965785" width="44.65193141912823" height="27.762858913447587" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="schematic_component_7" data-x="4.005" data-y="-0.39999999999999997" x="437.93431109274934" y="323.4086621221511" width="42.80107415823181" height="35.16628795703366" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="AP2112K-3.3" data-x="-0.2250000000000001" data-y="-0.43" x="233.06754802726704" y="338.21552020932313" width="61.0782896095848" height="8.328857674034339" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="U2" data-x="-0.765" data-y="0.41500000000000004" x="230.2912621359223" y="297.4966604696" width="16.657715348068564" height="11.567857880603128" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: VBUS
2
2
  globalConnNetId: connectivity_net0" data-x="-4.532499999999999" data-y="2.683333333333333" x="50.41107209254287" y="188.60455828685537" width="27.762858913447644" height="19.434001239413334" fill="#ef444466" stroke="#ef4444" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: RAW
3
3
  globalConnNetId: connectivity_net1" data-x="-4.772499999999999" data-y="0.32375" x="42.08221441850857" y="302.8757143840804" width="22.210287130758132" height="9.254286304482548" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: RAW
4
4
  globalConnNetId: connectivity_net1" data-x="-3.1609999999999987" data-y="1.8485" x="116.64862631687667" y="232.32334917028163" width="22.210287130758132" height="9.254286304482548" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: GND
5
5
  globalConnNetId: connectivity_net2" data-x="-4.817499999999998" data-y="-0.261" x="40.00000000000004" y="324.8430764993459" width="22.210287130758132" height="19.434001239413305" fill="#00000066" stroke="#000000" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: GND
6
6
  globalConnNetId: connectivity_net2" data-x="3.9924999999999997" data-y="-1.1900000000000002" x="447.65131171245605" y="367.8292363836673" width="22.21028713075816" height="19.434001239413362" fill="#00000066" stroke="#000000" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: GND
7
7
  globalConnNetId: connectivity_net2" data-x="6.245" data-y="-2.616" x="551.8777112166907" y="433.8122977346278" width="22.21028713075816" height="19.434001239413362" fill="#00000066" stroke="#000000" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: V3V3
8
- globalConnNetId: connectivity_net3" data-x="3.9924999999999997" data-y="0.39000000000000024" x="444.8750258211113" y="294.72037457825513" width="27.762858913447644" height="19.434001239413362" fill="#ef444466" stroke="#ef4444" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: PWR_LED_K
8
+ globalConnNetId: connectivity_net3" data-x="3.9924999999999997" data-y="0.30999999999999994" x="444.8750258211113" y="298.4220891000482" width="27.762858913447644" height="19.434001239413362" fill="#ef444466" stroke="#ef4444" stroke-width="0.02161160714285714"/></g><g><rect data-type="rect" data-label="netId: PWR_LED_K
9
9
  globalConnNetId: connectivity_net4" data-x="5.6450000000000005" data-y="-1.5050000000000003" x="507.4571369551745" y="387.49459478069275" width="55.52571782689529" height="9.254286304482548" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.02161160714285714"/></g><g><circle data-type="point" data-label="schematic_port_0
10
10
  y+" data-x="-4.532499999999999" data-y="1.8875000000000002" cx="64.29250154926669" cy="235.1459064931488" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_1
11
11
  y-" data-x="-4.532499999999999" data-y="0.8475000000000001" cx="64.29250154926669" cy="283.2681952764581" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_2
@@ -32,7 +32,7 @@ orientation: x-" data-x="-2.9209999999999985" data-y="1.8485" cx="138.8589134476
32
32
  orientation: y-" data-x="-4.817499999999998" data-y="-0.051000000000000004" cx="51.10514356537911" cy="324.8430764993459" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
33
33
  orientation: y-" data-x="3.9924999999999997" data-y="-0.9800000000000002" cx="458.75645527783513" cy="367.8292363836673" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
34
34
  orientation: y-" data-x="6.245" data-y="-2.4050000000000002" cx="562.9828547820698" cy="433.76602630310543" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
35
- orientation: y+" data-x="3.9924999999999997" data-y="0.18000000000000027" cx="458.75645527783513" cy="314.15437581766855" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
35
+ orientation: y+" data-x="3.9924999999999997" data-y="0.1" cx="458.75645527783513" cy="317.85609033946156" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
36
36
  orientation: x-" data-x="6.245" data-y="-1.5050000000000003" cx="562.9828547820698" cy="392.121737932934" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></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[
37
37
  document.currentScript.parentElement.addEventListener('mousemove', (e) => {
38
38
  const svg = e.currentTarget;
@@ -1,12 +1,51 @@
1
1
  import { expect, test } from "bun:test"
2
+ import { tracePathContainsPoint } from "lib/solvers/RailNetLabelCornerPlacementSolver/geometry"
2
3
  import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
4
  import inputProblem from "./bug-report-20260815T073240Z.json"
4
5
  import "tests/fixtures/matcher"
5
6
 
7
+ const V3V3_TRACE_IDS = [
8
+ "schematic_port_8-schematic_port_11",
9
+ "schematic_port_17-schematic_port_11",
10
+ "schematic_port_13-schematic_port_17",
11
+ ]
12
+
6
13
  test("bug-report-20260815T073240Z", () => {
7
14
  const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
15
 
9
16
  solver.solve()
10
17
 
18
+ const junctionOutput = solver.sameNetJunctionAlignmentSolver!.getOutput()
19
+ const v3V3Label = junctionOutput.netLabelPlacements.find(
20
+ (label) => label.netId === "V3V3",
21
+ )!
22
+ const v3V3Traces = V3V3_TRACE_IDS.map(
23
+ (traceId) =>
24
+ junctionOutput.traces.find((trace) => trace.mspPairId === traceId)!,
25
+ )
26
+
27
+ expect(
28
+ solver.sameNetJunctionAlignmentSolver!.stats.alignedJunctionCount,
29
+ ).toBe(2)
30
+ expect(
31
+ tracePathContainsPoint(v3V3Traces[1]!.tracePath, v3V3Label.anchorPoint),
32
+ ).toBe(true)
33
+ for (const trace of v3V3Traces) {
34
+ expect(
35
+ trace.tracePath.some(
36
+ (point, index) =>
37
+ point.y === v3V3Label.anchorPoint.y &&
38
+ trace.tracePath[index + 1]?.y === v3V3Label.anchorPoint.y,
39
+ ),
40
+ ).toBe(true)
41
+ expect(
42
+ trace.tracePath.every(
43
+ (point, index, path) =>
44
+ index === 0 ||
45
+ point.x === path[index - 1]!.x ||
46
+ point.y === path[index - 1]!.y,
47
+ ),
48
+ ).toBe(true)
49
+ }
11
50
  expect(solver).toMatchSolverSnapshot(import.meta.path)
12
51
  })