@tscircuit/schematic-trace-solver 0.0.121 → 0.0.123

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 (48) hide show
  1. package/dist/index.d.ts +10 -3
  2. package/dist/index.js +247 -31
  3. package/lib/solvers/RailNetLabelCornerPlacementSolver/RailNetLabelCornerPlacementSolver.ts +223 -21
  4. package/lib/solvers/RailNetLabelCornerPlacementSolver/types.ts +3 -3
  5. package/lib/solvers/SameNetJunctionAlignmentSolver/alignSameNetJunctions.ts +50 -5
  6. package/lib/solvers/SameNetJunctionAlignmentSolver/pathIntersectsAnyNetLabel.ts +29 -0
  7. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +34 -9
  8. package/package.json +1 -1
  9. package/site/bug-reports/bug-report-20260804T095800Z.page.tsx +4 -0
  10. package/site/bug-reports/bug-report-20260804T171919Z.page.tsx +4 -0
  11. package/site/bug-reports/bug-report-20260804T225912Z.page.tsx +4 -0
  12. package/tests/bug-reports/bug-report-20260706T213649Z/__snapshots__/bug-report-20260706T213649Z.snap.svg +4 -4
  13. package/tests/bug-reports/bug-report-20260706T220324Z/__snapshots__/bug-report-20260706T220324Z.snap.svg +5 -5
  14. package/tests/bug-reports/bug-report-20260717T042845Z/__snapshots__/bug-report-20260717T042845Z.snap.svg +12 -12
  15. package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +2 -2
  16. package/tests/bug-reports/bug-report-20260728T144234Z/__snapshots__/bug-report-20260728T144234Z.snap.svg +2 -2
  17. package/tests/bug-reports/bug-report-20260804T095800Z/__snapshots__/bug-report-20260804T095800Z.snap.svg +135 -0
  18. package/tests/bug-reports/bug-report-20260804T095800Z/bug-report-20260804T095800Z.json +634 -0
  19. package/tests/bug-reports/bug-report-20260804T095800Z/bug-report-20260804T095800Z.test.ts +12 -0
  20. package/tests/bug-reports/bug-report-20260804T171919Z/__snapshots__/bug-report-20260804T171919Z.snap.svg +355 -0
  21. package/tests/bug-reports/bug-report-20260804T171919Z/bug-report-20260804T171919Z.json +1775 -0
  22. package/tests/bug-reports/bug-report-20260804T171919Z/bug-report-20260804T171919Z.test.ts +12 -0
  23. package/tests/bug-reports/bug-report-20260804T225912Z/__snapshots__/bug-report-20260804T225912Z.snap.svg +60 -0
  24. package/tests/bug-reports/bug-report-20260804T225912Z/bug-report-20260804T225912Z.json +148 -0
  25. package/tests/bug-reports/bug-report-20260804T225912Z/bug-report-20260804T225912Z.test.ts +12 -0
  26. package/tests/examples/__snapshots__/example12.snap.svg +2 -2
  27. package/tests/examples/__snapshots__/example13.snap.svg +4 -4
  28. package/tests/examples/__snapshots__/example14.snap.svg +36 -36
  29. package/tests/examples/__snapshots__/example31.snap.svg +6 -6
  30. package/tests/examples/__snapshots__/example43.snap.svg +2 -2
  31. package/tests/examples/__snapshots__/example44.snap.svg +2 -2
  32. package/tests/repros/__snapshots__/board-15984-same-net-junction.snap.svg +2 -2
  33. package/tests/repros/__snapshots__/bugreport-001-gnd-overlap.snap.svg +26 -26
  34. package/tests/repros/__snapshots__/netlabel-connector-through-rail-label.snap.svg +2 -2
  35. package/tests/repros/__snapshots__/repro-atmega328p-fault-pullup.snap.svg +2 -2
  36. package/tests/repros/__snapshots__/repro-atmega328p-missing-gnd-netlabel.snap.svg +2 -2
  37. package/tests/repros/__snapshots__/repro-bq25895-cross-net-trace-overlap.snap.svg +2 -2
  38. package/tests/repros/__snapshots__/repro-missing-trace-netlabel.snap.svg +18 -18
  39. package/tests/repros/__snapshots__/repro-netlabel-overlap-trace.snap.svg +3 -3
  40. package/tests/repros/__snapshots__/repro-nrf52810-clock-routing.snap.svg +82 -0
  41. package/tests/repros/__snapshots__/repro161-power-section-autolayout.snap.svg +112 -0
  42. package/tests/repros/assets/repro-nrf52810-clock-routing.input.json +234 -0
  43. package/tests/repros/assets/repro161-power-section-autolayout.input.json +578 -0
  44. package/tests/repros/repro-bq25895-cross-net-trace-overlap.test.ts +13 -0
  45. package/tests/repros/repro-missing-trace-netlabel.test.ts +12 -0
  46. package/tests/repros/repro-netlabel-overlap-trace.test.ts +38 -0
  47. package/tests/repros/repro-nrf52810-clock-routing.test.ts +28 -0
  48. package/tests/repros/repro161-power-section-autolayout.test.ts +34 -0
@@ -0,0 +1,634 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "schematic_component_0",
5
+ "center": {
6
+ "x": -5.5,
7
+ "y": 4.4
8
+ },
9
+ "width": 3.2,
10
+ "height": 2.25,
11
+ "pins": [
12
+ {
13
+ "pinId": "schematic_port_0",
14
+ "x": -3.9,
15
+ "y": 4.1000000000000005
16
+ },
17
+ {
18
+ "pinId": "schematic_port_1",
19
+ "x": -3.9,
20
+ "y": 4.7
21
+ },
22
+ {
23
+ "pinId": "schematic_port_2",
24
+ "x": -7.1,
25
+ "y": 4.5
26
+ },
27
+ {
28
+ "pinId": "schematic_port_3",
29
+ "x": -3.9,
30
+ "y": 4.5
31
+ },
32
+ {
33
+ "pinId": "schematic_port_4",
34
+ "x": -7.1,
35
+ "y": 4.300000000000001
36
+ },
37
+ {
38
+ "pinId": "schematic_port_5",
39
+ "x": -3.9,
40
+ "y": 4.300000000000001
41
+ },
42
+ {
43
+ "pinId": "schematic_port_6",
44
+ "x": -5.5,
45
+ "y": 3.2750000000000004
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "chipId": "schematic_component_1",
51
+ "center": {
52
+ "x": -8.567499999999999,
53
+ "y": 4.2
54
+ },
55
+ "width": 1.1649999999999991,
56
+ "height": 0.7600000000000002,
57
+ "pins": [
58
+ {
59
+ "pinId": "schematic_port_7",
60
+ "x": -8.7,
61
+ "y": 4.58,
62
+ "_facingDirection": "y+"
63
+ },
64
+ {
65
+ "pinId": "schematic_port_8",
66
+ "x": -8.7,
67
+ "y": 3.8200000000000003,
68
+ "_facingDirection": "y-"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "chipId": "schematic_component_2",
74
+ "center": {
75
+ "x": -2.4050000000000002,
76
+ "y": 5.4
77
+ },
78
+ "width": 1.0900000000000003,
79
+ "height": 0.5999999999999996,
80
+ "pins": [
81
+ {
82
+ "pinId": "schematic_port_9",
83
+ "x": -2.5,
84
+ "y": 5.1000000000000005,
85
+ "_facingDirection": "y-"
86
+ },
87
+ {
88
+ "pinId": "schematic_port_10",
89
+ "x": -2.5,
90
+ "y": 5.7,
91
+ "_facingDirection": "y+"
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "chipId": "schematic_component_3",
97
+ "center": {
98
+ "x": -5.105,
99
+ "y": 1.15
100
+ },
101
+ "width": 1.0899999999999999,
102
+ "height": 0.6000000000000001,
103
+ "pins": [
104
+ {
105
+ "pinId": "schematic_port_11",
106
+ "x": -5.2,
107
+ "y": 0.8499999999999999,
108
+ "_facingDirection": "y-"
109
+ },
110
+ {
111
+ "pinId": "schematic_port_12",
112
+ "x": -5.2,
113
+ "y": 1.45,
114
+ "_facingDirection": "y+"
115
+ }
116
+ ]
117
+ },
118
+ {
119
+ "chipId": "schematic_component_4",
120
+ "center": {
121
+ "x": -3.35,
122
+ "y": 1.15
123
+ },
124
+ "width": 0.9000000000000004,
125
+ "height": 0.5550000000000002,
126
+ "pins": [
127
+ {
128
+ "pinId": "schematic_port_13",
129
+ "x": -2.9,
130
+ "y": 1.05,
131
+ "_facingDirection": "x+"
132
+ },
133
+ {
134
+ "pinId": "schematic_port_14",
135
+ "x": -3.35,
136
+ "y": 1.4275,
137
+ "_facingDirection": "y+"
138
+ },
139
+ {
140
+ "pinId": "schematic_port_15",
141
+ "x": -3.8000000000000003,
142
+ "y": 1.0499999999999998,
143
+ "_facingDirection": "x-"
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "chipId": "schematic_component_5",
149
+ "center": {
150
+ "x": 3.8999999999999995,
151
+ "y": 5.2
152
+ },
153
+ "width": 0.9000000000000004,
154
+ "height": 0.5549999999999997,
155
+ "pins": [
156
+ {
157
+ "pinId": "schematic_port_16",
158
+ "x": 4.35,
159
+ "y": 5.1000000000000005
160
+ },
161
+ {
162
+ "pinId": "schematic_port_17",
163
+ "x": 3.9,
164
+ "y": 5.4775
165
+ },
166
+ {
167
+ "pinId": "schematic_port_18",
168
+ "x": 3.4499999999999993,
169
+ "y": 5.1000000000000005
170
+ }
171
+ ]
172
+ },
173
+ {
174
+ "chipId": "schematic_component_6",
175
+ "center": {
176
+ "x": 3.1550000000000002,
177
+ "y": 3.7
178
+ },
179
+ "width": 1.2100000000000004,
180
+ "height": 0.5999999999999996,
181
+ "pins": [
182
+ {
183
+ "pinId": "schematic_port_19",
184
+ "x": 3,
185
+ "y": 3.4000000000000004,
186
+ "_facingDirection": "y-"
187
+ },
188
+ {
189
+ "pinId": "schematic_port_20",
190
+ "x": 3,
191
+ "y": 4,
192
+ "_facingDirection": "y+"
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "chipId": "schematic_component_7",
198
+ "center": {
199
+ "x": 4.955,
200
+ "y": 3.7
201
+ },
202
+ "width": 1.21,
203
+ "height": 0.5999999999999996,
204
+ "pins": [
205
+ {
206
+ "pinId": "schematic_port_21",
207
+ "x": 4.8,
208
+ "y": 3.4000000000000004,
209
+ "_facingDirection": "y-"
210
+ },
211
+ {
212
+ "pinId": "schematic_port_22",
213
+ "x": 4.8,
214
+ "y": 4,
215
+ "_facingDirection": "y+"
216
+ }
217
+ ]
218
+ },
219
+ {
220
+ "chipId": "schematic_component_8",
221
+ "center": {
222
+ "x": 9.455000000000002,
223
+ "y": 4.8
224
+ },
225
+ "width": 1.209999999999999,
226
+ "height": 0.5999999999999996,
227
+ "pins": [
228
+ {
229
+ "pinId": "schematic_port_23",
230
+ "x": 9.3,
231
+ "y": 4.5,
232
+ "_facingDirection": "y-"
233
+ },
234
+ {
235
+ "pinId": "schematic_port_24",
236
+ "x": 9.3,
237
+ "y": 5.1,
238
+ "_facingDirection": "y+"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "chipId": "schematic_component_9",
244
+ "center": {
245
+ "x": 9.425,
246
+ "y": 3.35
247
+ },
248
+ "width": 0.8699999999999992,
249
+ "height": 1.08,
250
+ "pins": [
251
+ {
252
+ "pinId": "schematic_port_25",
253
+ "x": 9.3,
254
+ "y": 3.89,
255
+ "_facingDirection": "y+"
256
+ },
257
+ {
258
+ "pinId": "schematic_port_26",
259
+ "x": 9.3,
260
+ "y": 2.81,
261
+ "_facingDirection": "y-"
262
+ }
263
+ ]
264
+ },
265
+ {
266
+ "chipId": "schematic_component_10",
267
+ "center": {
268
+ "x": 9.3,
269
+ "y": 1.95
270
+ },
271
+ "width": 0.3041464999999981,
272
+ "height": 0.8999999999999999,
273
+ "pins": [
274
+ {
275
+ "pinId": "schematic_port_27",
276
+ "x": 9.2999378,
277
+ "y": 1.5,
278
+ "_facingDirection": "y-"
279
+ },
280
+ {
281
+ "pinId": "schematic_port_28",
282
+ "x": 9.300062200000001,
283
+ "y": 2.4,
284
+ "_facingDirection": "y+"
285
+ }
286
+ ]
287
+ },
288
+ {
289
+ "chipId": "schematic_component_11",
290
+ "center": {
291
+ "x": 0.5,
292
+ "y": -0.7
293
+ },
294
+ "width": 0.4,
295
+ "height": 0.19999999999999996,
296
+ "pins": [
297
+ {
298
+ "pinId": "schematic_port_29",
299
+ "x": 0.3,
300
+ "y": -0.7
301
+ }
302
+ ]
303
+ },
304
+ {
305
+ "chipId": "schematic_component_12",
306
+ "center": {
307
+ "x": 0.5,
308
+ "y": -1.05
309
+ },
310
+ "width": 0.4,
311
+ "height": 0.20000000000000007,
312
+ "pins": [
313
+ {
314
+ "pinId": "schematic_port_30",
315
+ "x": 0.3,
316
+ "y": -1.05
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "chipId": "schematic_component_13",
322
+ "center": {
323
+ "x": 0.5,
324
+ "y": -1.4
325
+ },
326
+ "width": 0.4,
327
+ "height": 0.20000000000000018,
328
+ "pins": [
329
+ {
330
+ "pinId": "schematic_port_31",
331
+ "x": 0.3,
332
+ "y": -1.4
333
+ }
334
+ ]
335
+ },
336
+ {
337
+ "chipId": "schematic_component_14",
338
+ "center": {
339
+ "x": 0.5,
340
+ "y": -1.75
341
+ },
342
+ "width": 0.4,
343
+ "height": 0.20000000000000018,
344
+ "pins": [
345
+ {
346
+ "pinId": "schematic_port_32",
347
+ "x": 0.3,
348
+ "y": -1.75
349
+ }
350
+ ]
351
+ },
352
+ {
353
+ "chipId": "schematic_component_15",
354
+ "center": {
355
+ "x": 1.5,
356
+ "y": -5.25
357
+ },
358
+ "width": 1.5,
359
+ "height": 1,
360
+ "pins": [
361
+ {
362
+ "pinId": "schematic_port_33",
363
+ "x": 0.75,
364
+ "y": -5.55
365
+ },
366
+ {
367
+ "pinId": "schematic_port_34",
368
+ "x": 0.75,
369
+ "y": -5.35
370
+ },
371
+ {
372
+ "pinId": "schematic_port_35",
373
+ "x": 0.75,
374
+ "y": -5.15
375
+ },
376
+ {
377
+ "pinId": "schematic_port_36",
378
+ "x": 0.75,
379
+ "y": -4.95
380
+ }
381
+ ]
382
+ },
383
+ {
384
+ "chipId": "schematic_component_16",
385
+ "center": {
386
+ "x": -5.6,
387
+ "y": -5
388
+ },
389
+ "width": 1.3499999999999996,
390
+ "height": 0.40000000000000036,
391
+ "pins": [
392
+ {
393
+ "pinId": "schematic_port_37",
394
+ "x": -6.2749999999999995,
395
+ "y": -5
396
+ }
397
+ ]
398
+ },
399
+ {
400
+ "chipId": "schematic_component_17",
401
+ "center": {
402
+ "x": -5.6,
403
+ "y": -5.75
404
+ },
405
+ "width": 1.3499999999999996,
406
+ "height": 0.40000000000000036,
407
+ "pins": [
408
+ {
409
+ "pinId": "schematic_port_38",
410
+ "x": -6.2749999999999995,
411
+ "y": -5.75
412
+ }
413
+ ]
414
+ }
415
+ ],
416
+ "directConnections": [],
417
+ "netConnections": [
418
+ {
419
+ "netId": "SCL",
420
+ "netLabelWidth": 0.48,
421
+ "pinIds": [
422
+ "schematic_port_0",
423
+ "schematic_port_19",
424
+ "schematic_port_31",
425
+ "schematic_port_36"
426
+ ]
427
+ },
428
+ {
429
+ "netId": "INT",
430
+ "netLabelWidth": 0.48,
431
+ "pinIds": [
432
+ "schematic_port_1",
433
+ "schematic_port_9",
434
+ "schematic_port_37"
435
+ ]
436
+ },
437
+ {
438
+ "netId": "V3_3",
439
+ "netLabelWidth": 0.42,
440
+ "netLabelHeight": 0.6,
441
+ "pinIds": [
442
+ "schematic_port_2",
443
+ "schematic_port_7",
444
+ "schematic_port_10",
445
+ "schematic_port_12",
446
+ "schematic_port_13",
447
+ "schematic_port_17",
448
+ "schematic_port_24",
449
+ "schematic_port_29",
450
+ "schematic_port_34"
451
+ ]
452
+ },
453
+ {
454
+ "netId": "ADDR",
455
+ "netLabelWidth": 0.6,
456
+ "pinIds": [
457
+ "schematic_port_3",
458
+ "schematic_port_14"
459
+ ]
460
+ },
461
+ {
462
+ "netId": "GND",
463
+ "netLabelWidth": 0.42,
464
+ "netLabelHeight": 0.48,
465
+ "pinIds": [
466
+ "schematic_port_4",
467
+ "schematic_port_6",
468
+ "schematic_port_8",
469
+ "schematic_port_27",
470
+ "schematic_port_32",
471
+ "schematic_port_33",
472
+ "schematic_port_38"
473
+ ]
474
+ },
475
+ {
476
+ "netId": "SDA",
477
+ "netLabelWidth": 0.48,
478
+ "pinIds": [
479
+ "schematic_port_5",
480
+ "schematic_port_21",
481
+ "schematic_port_30",
482
+ "schematic_port_35"
483
+ ]
484
+ },
485
+ {
486
+ "netId": "ADDR_15K",
487
+ "netLabelWidth": 1.08,
488
+ "pinIds": [
489
+ "schematic_port_11",
490
+ "schematic_port_15"
491
+ ]
492
+ },
493
+ {
494
+ "netId": "SCL_PU",
495
+ "netLabelWidth": 0.84,
496
+ "pinIds": [
497
+ "schematic_port_16",
498
+ "schematic_port_20"
499
+ ]
500
+ },
501
+ {
502
+ "netId": "SDA_PU",
503
+ "netLabelWidth": 0.84,
504
+ "pinIds": [
505
+ "schematic_port_18",
506
+ "schematic_port_22"
507
+ ]
508
+ },
509
+ {
510
+ "netId": "LED_A",
511
+ "netLabelWidth": 0.72,
512
+ "pinIds": [
513
+ "schematic_port_23",
514
+ "schematic_port_25"
515
+ ]
516
+ },
517
+ {
518
+ "netId": "LED_K",
519
+ "netLabelWidth": 0.72,
520
+ "pinIds": [
521
+ "schematic_port_26",
522
+ "schematic_port_28"
523
+ ]
524
+ }
525
+ ],
526
+ "textBoxes": [
527
+ {
528
+ "chipId": "schematic_component_0",
529
+ "center": {
530
+ "x": -3.66,
531
+ "y": 5.475
532
+ },
533
+ "width": 1.08,
534
+ "height": 0.17999999999999972,
535
+ "text": "STTS22HTR"
536
+ },
537
+ {
538
+ "chipId": "schematic_component_0",
539
+ "center": {
540
+ "x": -4.08,
541
+ "y": 5.24
542
+ },
543
+ "width": 0.3599999999999999,
544
+ "height": 0.2499999999999991,
545
+ "text": "U2"
546
+ },
547
+ {
548
+ "chipId": "schematic_component_15",
549
+ "center": {
550
+ "x": 2.29,
551
+ "y": -5.88
552
+ },
553
+ "width": 2.28,
554
+ "height": 0.17999999999999972,
555
+ "text": "SM04B_SRSS_TB_LF_SN"
556
+ },
557
+ {
558
+ "chipId": "schematic_component_15",
559
+ "center": {
560
+ "x": 1.27,
561
+ "y": -4.635
562
+ },
563
+ "width": 0.3600000000000001,
564
+ "height": 0.2499999999999991,
565
+ "text": "J1"
566
+ },
567
+ {
568
+ "chipId": "schematic_component_16",
569
+ "center": {
570
+ "x": -5.755,
571
+ "y": -4.6850000000000005
572
+ },
573
+ "width": 0.35999999999999943,
574
+ "height": 0.2499999999999991,
575
+ "text": "J3"
576
+ },
577
+ {
578
+ "chipId": "schematic_component_17",
579
+ "center": {
580
+ "x": -5.755,
581
+ "y": -5.4350000000000005
582
+ },
583
+ "width": 0.35999999999999943,
584
+ "height": 0.2499999999999991,
585
+ "text": "J4"
586
+ }
587
+ ],
588
+ "availableNetLabelOrientations": {
589
+ "SCL": [
590
+ "x-",
591
+ "x+"
592
+ ],
593
+ "INT": [
594
+ "x-",
595
+ "x+"
596
+ ],
597
+ "V3_3": [
598
+ "y+"
599
+ ],
600
+ "ADDR": [
601
+ "x-",
602
+ "x+"
603
+ ],
604
+ "GND": [
605
+ "y-"
606
+ ],
607
+ "SDA": [
608
+ "x-",
609
+ "x+"
610
+ ],
611
+ "ADDR_15K": [
612
+ "x-",
613
+ "x+"
614
+ ],
615
+ "SCL_PU": [
616
+ "x-",
617
+ "x+"
618
+ ],
619
+ "SDA_PU": [
620
+ "x-",
621
+ "x+"
622
+ ],
623
+ "LED_A": [
624
+ "x-",
625
+ "x+"
626
+ ],
627
+ "LED_K": [
628
+ "x-",
629
+ "x+"
630
+ ]
631
+ },
632
+ "maxMspPairDistance": 2.4,
633
+ "_hideRatsNet": false
634
+ }
@@ -0,0 +1,12 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "./bug-report-20260804T095800Z.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ test("bug-report-20260804T095800Z", () => {
7
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
8
+
9
+ solver.solve()
10
+
11
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
12
+ })