@tscircuit/schematic-trace-solver 0.0.197 → 0.0.198
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.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +82 -4
- package/lib/solvers/RailNetLabelCornerPlacementSolver/RailNetLabelCornerPlacementSolver.ts +128 -2
- package/lib/solvers/RailNetLabelCornerPlacementSolver/types.ts +1 -0
- package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +2 -0
- package/package.json +1 -1
- package/site/SchematicTracePipelineSolver/repro-am3352-sheet3-power-rails.page.tsx +7 -0
- package/site/bug-reports/bug-report-20260911T195723Z.page.tsx +4 -0
- package/tests/bug-reports/bug-report-20260911T195723Z/__snapshots__/bug-report-20260911T195723Z.snap.svg +559 -0
- package/tests/bug-reports/bug-report-20260911T195723Z/bug-report-20260911T195723Z.json +1792 -0
- package/tests/bug-reports/bug-report-20260911T195723Z/bug-report-20260911T195723Z.test.ts +35 -0
- package/tests/repros/__snapshots__/repro-am3352-sheet3-power-rails.snap.svg +187 -0
- package/tests/repros/__snapshots__/repro-normal-net-label-branch-from-junction.snap.svg +31 -31
- package/tests/repros/assets/repro-am3352-sheet3-power-rails.input.json +698 -0
- package/tests/repros/repro-am3352-sheet3-power-rails.md +66 -0
- package/tests/repros/repro-am3352-sheet3-power-rails.test.ts +39 -0
- package/tests/repros/repro-normal-net-label-branch-from-junction.test.ts +13 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
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
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="-6.7,-19 -4.7,-19" data-type="line" data-label="" points="261.6314199395772,
|
|
4
|
-
globalConnNetId: connectivity_net1" data-x="-7.721" data-y="-19" x="40.00000000000034" y="
|
|
5
|
-
globalConnNetId: connectivity_net0" data-x="-6.
|
|
6
|
-
globalConnNetId: connectivity_net2" data-x="-5.801" data-y="-19" x="322.99917605053565" y="
|
|
7
|
-
x-" data-x="-7.3" data-y="-19" cx="169.34907992309832" cy="
|
|
8
|
-
x+" data-x="-6.7" data-y="-19" cx="261.6314199395772" cy="
|
|
9
|
-
x-" data-x="-5.3" data-y="-19" cx="476.95687997802816" cy="
|
|
10
|
-
x+" data-x="-4.7" data-y="-19" cx="569.2392199945072" cy="
|
|
11
|
-
orientation: x-" data-x="-7.3" data-y="-19" cx="169.34907992309832" cy="
|
|
12
|
-
orientation: y+" data-x="-6.
|
|
13
|
-
orientation: x-" data-x="-5.3" data-y="-19" cx="476.95687997802816" cy="
|
|
3
|
+
<rect width="100%" height="100%" fill="white"/><g><polyline data-points="-6.7,-19 -4.7,-19" data-type="line" data-label="" points="261.6314199395772,343.5319967042019 569.2392199945072,343.5319967042019" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-6.7,-19 -6.5,-19 -6.5,-19.525 -4.5,-19.525 -4.5,-19 -4.7,-19" data-type="line" data-label="" points="261.6314199395772,343.5319967042019 292.39219994507016,343.5319967042019 292.39219994507016,424.27904421862104 600.0000000000001,424.27904421862104 600.0000000000001,343.5319967042019 569.2392199945072,343.5319967042019" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-6.5,-19 -6.5,-18.649" data-type="line" data-label="" points="292.39219994507016,343.5319967042019 292.39219994507016,289.546827794562" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="R8" data-x="-7" data-y="-19" x="169.34907992309832" y="293.5457291952757" width="92.28234001647888" height="99.97253501785235" fill="hsl(78, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006501785714285714"/></g><g><rect data-type="rect" data-label="R7" data-x="-5" data-y="-19" x="476.9568799780281" y="293.5457291952757" width="92.282340016479" height="99.97253501785235" fill="hsl(77, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006501785714285714"/></g><g><rect data-type="rect" data-label="netId: U1_IO22
|
|
4
|
+
globalConnNetId: connectivity_net1" data-x="-7.721" data-y="-19" x="40.00000000000034" y="311.23317769843425" width="129.1952760230704" height="64.59763801153531" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006501785714285714"/></g><g><rect data-type="rect" data-label="netId: V3V3
|
|
5
|
+
globalConnNetId: connectivity_net0" data-x="-6.5" data-y="-18.409000000000002" x="260.0933809393025" y="215.7209557813792" width="64.59763801153531" height="73.82587201318302" fill="#ef444466" stroke="#ef4444" stroke-width="0.006501785714285714"/></g><g><rect data-type="rect" data-label="netId: U1_IO21
|
|
6
|
+
globalConnNetId: connectivity_net2" data-x="-5.801" data-y="-19" x="322.99917605053565" y="311.23317769843425" width="153.80390002746503" height="64.59763801153531" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006501785714285714"/></g><g><circle data-type="point" data-label="R8.pin1
|
|
7
|
+
x-" data-x="-7.3" data-y="-19" cx="169.34907992309832" cy="343.5319967042019" r="3" fill="hsl(140, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R8.pin2
|
|
8
|
+
x+" data-x="-6.7" data-y="-19" cx="261.6314199395772" cy="343.5319967042019" r="3" fill="hsl(141, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R7.pin1
|
|
9
|
+
x-" data-x="-5.3" data-y="-19" cx="476.95687997802816" cy="343.5319967042019" r="3" fill="hsl(349, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="R7.pin2
|
|
10
|
+
x+" data-x="-4.7" data-y="-19" cx="569.2392199945072" cy="343.5319967042019" r="3" fill="hsl(350, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
11
|
+
orientation: x-" data-x="-7.3" data-y="-19" cx="169.34907992309832" cy="343.5319967042019" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
12
|
+
orientation: y+" data-x="-6.5" data-y="-18.649" cx="292.39219994507016" cy="289.546827794562" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
13
|
+
orientation: x-" data-x="-5.3" data-y="-19" cx="476.95687997802816" cy="343.5319967042019" 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[
|
|
14
14
|
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
15
15
|
const svg = e.currentTarget;
|
|
16
16
|
const rect = svg.getBoundingClientRect();
|
|
@@ -32,7 +32,7 @@ orientation: x-" data-x="-5.3" data-y="-19" cx="476.95687997802816" cy="335.8418
|
|
|
32
32
|
v.setAttribute('y2', '640');
|
|
33
33
|
|
|
34
34
|
// Calculate real coordinates using inverse transformation
|
|
35
|
-
const matrix = {"a":153.80390002746498,"c":0,"e":1292.1175501235925,"b":0,"d":-153.80390002746498,"f":-
|
|
35
|
+
const matrix = {"a":153.80390002746498,"c":0,"e":1292.1175501235925,"b":0,"d":-153.80390002746498,"f":-2578.7421038176326};
|
|
36
36
|
// Manually invert and apply the affine transform
|
|
37
37
|
// Since we only use translate and scale, we can directly compute:
|
|
38
38
|
// x' = (x - tx) / sx
|
|
@@ -67,27 +67,27 @@ orientation: x-" data-x="-5.3" data-y="-19" cx="476.95687997802816" cy="335.8418
|
|
|
67
67
|
.port-label { fill: rgb(0, 100, 100); }
|
|
68
68
|
.component-name { fill: rgb(0, 100, 100); }
|
|
69
69
|
|
|
70
|
-
</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 500.98568079765005
|
|
71
|
-
M 348.4734656989501,
|
|
72
|
-
L 334.7473663400671,
|
|
73
|
-
L 127.09351258234827,
|
|
74
|
-
L 127.09351258234827,
|
|
75
|
-
L 334.7473663400671,
|
|
70
|
+
</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 500.98568079765005 446.7534668282997 L 551.8230858305501 446.7534668282997 L 551.8230858305501 580.201655039662 L 1060.1971361595502 580.201655039662 L 1060.1971361595502 446.7534668282997 L 1009.3597311266501 446.7534668282997" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="40.669924026320004px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 500.98568079765005 446.7534668282997 L 551.8230858305501 446.7534668282997 L 551.8230858305501 580.201655039662 L 1060.1971361595502 580.201655039662 L 1060.1971361595502 446.7534668282997 L 1009.3597311266501 446.7534668282997" stroke="rgb(0, 150, 0)" fill="none" stroke-width="5.0837405032900005px" 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 551.8230858305501 446.7534668282997 L 551.8230858305501 357.53382099556075" class="trace-invisible-hover-outline sch-trace-hitbox" stroke="rgb(0, 150, 0)" fill="none" stroke-width="40.669924026320004px" stroke-linecap="round" opacity="0" stroke-linejoin="round"/><path class="sch-trace-path" d="M 551.8230858305501 446.7534668282997 L 551.8230858305501 357.53382099556075" stroke="rgb(0, 150, 0)" fill="none" stroke-width="5.0837405032900005px" 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"><circle cx="551.8230858305501" cy="446.7534668282997" r="7.625610754935" class="trace-junction sch-trace-junction" fill="rgb(0, 150, 0)"/></g><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="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_0__stack1"><rect class="component-overlay sch-component-overlay" x="348.4734656989501" y="426.423588555643" width="152.51221509869993" height="40.65975654531337" fill="transparent"/><path class="sch-component-symbol-path" d="M 348.4734656989501 446.7534668282997 L 373.8972519559034 446.7534668282997" stroke="rgb(132, 0, 0)" fill="none" stroke-width="5.0837405032900005px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 475.56189454069676 446.7534668282997 L 500.98568079765005 446.7534668282997" stroke="rgb(132, 0, 0)" fill="none" stroke-width="5.0837405032900005px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 373.8972519559034 426.423588555643 L 475.56189454069676 426.423588555643 L 475.56189454069676 467.08334510095636 L 373.8972519559034 467.08334510095636 L 373.8972519559034 426.423588555643" stroke="rgb(132, 0, 0)" fill="none" stroke-width="5.0837405032900005px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="424.7295732483001" y="406.0835428019797" stroke="rgb(245, 241, 237)" stroke-width="5.0837405032900005px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="45.75366452961px">R8</text><text class="sch-component-text" x="424.7295732483001" y="487.42339085461964" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="45.75366452961px"></text><circle class="component-pin sch-component-pin" cx="348.4734656989501" cy="446.7534668282997" r="5.0837405032900005px" stroke-width="5.0837405032900005px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_1__stack1"><rect class="component-overlay sch-component-overlay" x="856.8475160279502" y="426.423588555643" width="152.51221509869993" height="40.65975654531337" fill="transparent"/><path class="sch-component-symbol-path" d="M 856.8475160279502 446.7534668282997 L 882.2713022849034 446.7534668282997" stroke="rgb(132, 0, 0)" fill="none" stroke-width="5.0837405032900005px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 983.9359448696969 446.7534668282997 L 1009.3597311266501 446.7534668282997" stroke="rgb(132, 0, 0)" fill="none" stroke-width="5.0837405032900005px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 882.2713022849034 426.423588555643 L 983.9359448696969 426.423588555643 L 983.9359448696969 467.08334510095636 L 882.2713022849034 467.08334510095636 L 882.2713022849034 426.423588555643" stroke="rgb(132, 0, 0)" fill="none" stroke-width="5.0837405032900005px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="933.1036235773001" y="406.0835428019797" stroke="rgb(245, 241, 237)" stroke-width="5.0837405032900005px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="45.75366452961px">R7</text><text class="sch-component-text" x="933.1036235773001" y="487.42339085461964" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="45.75366452961px"></text><circle class="component-pin sch-component-pin" cx="856.8475160279502" cy="446.7534668282997" r="5.0837405032900005px" stroke-width="5.0837405032900005px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_0__stack1"><circle cx="348.4734656989501" cy="446.7534668282997" r="10.167481006580001" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0_1__stack1"><circle cx="500.98568079765005" cy="446.7534668282997" r="10.167481006580001" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_1_0__stack1"><circle cx="856.8475160279502" cy="446.7534668282997" r="10.167481006580001" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_1_1__stack1"><circle cx="1009.3597311266501" cy="446.7534668282997" r="10.167481006580001" fill="red" opacity="0"/></g><path class="net-label sch-net-label" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_0__stack1" d="
|
|
71
|
+
M 348.4734656989501,446.7534668282997
|
|
72
|
+
L 334.7473663400671,472.1721693447497
|
|
73
|
+
L 127.09351258234827,472.17216934474965
|
|
74
|
+
L 127.09351258234827,421.33476431184965
|
|
75
|
+
L 334.7473663400671,421.33476431184965
|
|
76
76
|
Z
|
|
77
|
-
" fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="5.0837405032900005px"/><text class="net-label-text sch-net-label-text" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_0__stack1" x="325.59663343414513" y="
|
|
78
|
-
M
|
|
79
|
-
L
|
|
80
|
-
L
|
|
81
|
-
L
|
|
82
|
-
L
|
|
77
|
+
" fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="5.0837405032900005px"/><text class="net-label-text sch-net-label-text" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_0__stack1" x="325.59663343414513" y="446.7534668282997" fill="rgb(132, 0, 0)" text-anchor="end" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="45.75366452961px" transform="">U1_IO22</text><path class="net-label sch-net-label" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_1__stack1" d="
|
|
78
|
+
M 551.8230858305501,357.53382099556075
|
|
79
|
+
L 526.4043833141001,343.80772163667774
|
|
80
|
+
L 526.4043833141001,207.088993701532
|
|
81
|
+
L 577.2417883470001,207.088993701532
|
|
82
|
+
L 577.2417883470001,343.80772163667774
|
|
83
83
|
Z
|
|
84
|
-
" fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="5.0837405032900005px"/><text class="net-label-text sch-net-label-text" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_1__stack1" x="
|
|
85
|
-
M 856.8475160279502,
|
|
86
|
-
L 843.1214166690672,
|
|
87
|
-
L 635.4675629113483,
|
|
88
|
-
L 635.4675629113483,
|
|
89
|
-
L 843.1214166690672,
|
|
84
|
+
" fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="5.0837405032900005px"/><text class="net-label-text sch-net-label-text" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_1__stack1" x="551.8230858305501" y="334.65698873075576" fill="rgb(132, 0, 0)" text-anchor="start" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="45.75366452961px" transform="rotate(-90 551.8230858305501 334.65698873075576)">V3V3</text><path class="net-label sch-net-label" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_2__stack1" d="
|
|
85
|
+
M 856.8475160279502,446.7534668282997
|
|
86
|
+
L 843.1214166690672,472.1721693447497
|
|
87
|
+
L 635.4675629113483,472.17216934474965
|
|
88
|
+
L 635.4675629113483,421.33476431184965
|
|
89
|
+
L 843.1214166690672,421.33476431184965
|
|
90
90
|
Z
|
|
91
|
-
" fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="5.0837405032900005px"/><text class="net-label-text sch-net-label-text" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_2__stack1" x="833.9706837631452" y="
|
|
91
|
+
" fill="rgba(255, 255, 255, 0.6)" stroke="rgb(132, 0, 0)" stroke-width="5.0837405032900005px"/><text class="net-label-text sch-net-label-text" data-circuit-json-type="schematic_net_label" data-schematic-net-label-id="schematic_net_label_2__stack1" x="833.9706837631452" y="446.7534668282997" fill="rgb(132, 0, 0)" text-anchor="end" dominant-baseline="central" font-family="sans-serif" font-variant-numeric="tabular-nums" font-size="45.75366452961px" transform="">U1_IO21</text>
|
|
92
92
|
</g>
|
|
93
93
|
</svg>
|