@tscircuit/schematic-trace-solver 0.0.173 → 0.0.174
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.js +5 -0
- package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +12 -1
- package/package.json +1 -1
- package/site/bug-reports/bug-report-20260831T133233Z.page.tsx +4 -0
- package/tests/bug-reports/bug-report-20260721T221026Z/__snapshots__/bug-report-20260721T221026Z.snap.svg +18 -18
- package/tests/bug-reports/bug-report-20260831T133233Z/__snapshots__/bug-report-20260831T133233Z.snap.svg +85 -0
- package/tests/bug-reports/bug-report-20260831T133233Z/bug-report-20260831T133233Z.json +172 -0
- package/tests/bug-reports/bug-report-20260831T133233Z/bug-report-20260831T133233Z.test.ts +25 -0
- package/tests/repros/__snapshots__/repro-bq40z60-current-sense.snap.svg +94 -0
- package/tests/repros/__snapshots__/repro-pmp11282-isolated-dcdc.snap.svg +10 -10
- package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +87 -87
- package/tests/repros/__snapshots__/repro-tida-01389-hbridge.snap.svg +47 -153
- package/tests/repros/__snapshots__/repro-tida010076-page02.snap.svg +1625 -1625
- package/tests/repros/assets/repro-bq40z60-current-sense.input.json +158 -0
- package/tests/repros/assets/repro-tida-01389-hbridge.input.json +67 -657
- package/tests/repros/repro-bq40z60-current-sense.test.ts +18 -0
- package/tests/repros/repro-tida-01389-hbridge.test.ts +27 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
|
|
3
|
+
import type { InputProblem } from "lib/types/InputProblem"
|
|
4
|
+
import "tests/fixtures/matcher"
|
|
5
|
+
import inputProblem from "./assets/repro-bq40z60-current-sense.input.json"
|
|
6
|
+
|
|
7
|
+
// Minimal input derived from @tsci/tscircuit.ti's
|
|
8
|
+
// BatteryManagement_2to4Cell_BQ40Z60 subcircuit. It isolates the bottom-left
|
|
9
|
+
// R38/R43/R44 and C26/C36 current-sense section.
|
|
10
|
+
test("repro BQ40Z60 current-sense schematic traces", () => {
|
|
11
|
+
const solver = new SchematicTracePipelineSolver(
|
|
12
|
+
inputProblem as unknown as InputProblem,
|
|
13
|
+
{ hideRatsNet: true },
|
|
14
|
+
)
|
|
15
|
+
solver.solve()
|
|
16
|
+
|
|
17
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
18
|
+
})
|
|
@@ -4,12 +4,12 @@ import type { InputProblem } from "lib/types/InputProblem"
|
|
|
4
4
|
import "tests/fixtures/matcher"
|
|
5
5
|
import inputProblem from "./assets/repro-tida-01389-hbridge.input.json"
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
test("repro:
|
|
10
|
-
expect(inputProblem.chips).toHaveLength(
|
|
11
|
-
expect(inputProblem.directConnections).toHaveLength(
|
|
12
|
-
expect(inputProblem.netConnections).toHaveLength(
|
|
7
|
+
// Reduced from the TIDA-01389 H-bridge in tscircuit/ti#116. It retains only
|
|
8
|
+
// the four components on the enclosing loop and the two nested capacitors.
|
|
9
|
+
test("repro: enclosing rectangle collapses into two smaller loops", () => {
|
|
10
|
+
expect(inputProblem.chips).toHaveLength(6)
|
|
11
|
+
expect(inputProblem.directConnections).toHaveLength(8)
|
|
12
|
+
expect(inputProblem.netConnections).toHaveLength(0)
|
|
13
13
|
|
|
14
14
|
const solver = new SchematicTracePipelineSolver(
|
|
15
15
|
inputProblem as unknown as InputProblem,
|
|
@@ -18,6 +18,27 @@ test("repro: TIDA-01389 H-bridge traces float above MOSFET ports", () => {
|
|
|
18
18
|
|
|
19
19
|
solver.solve()
|
|
20
20
|
|
|
21
|
+
const pairKeys = new Set(
|
|
22
|
+
solver.mspConnectionPairSolver!.mspConnectionPairs.map((pair) =>
|
|
23
|
+
pair.pins
|
|
24
|
+
.map((pin) => pin.pinId)
|
|
25
|
+
.sort()
|
|
26
|
+
.join("::"),
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
expect(
|
|
30
|
+
pairKeys.has("schematic_port_q1a_drain::schematic_port_q1b_source"),
|
|
31
|
+
).toBe(false)
|
|
32
|
+
expect(
|
|
33
|
+
pairKeys.has("schematic_port_q2a_source::schematic_port_q2b_drain"),
|
|
34
|
+
).toBe(false)
|
|
35
|
+
expect(pairKeys.has("schematic_port_c18_1::schematic_port_q1a_drain")).toBe(
|
|
36
|
+
true,
|
|
37
|
+
)
|
|
38
|
+
expect(pairKeys.has("schematic_port_c18_2::schematic_port_q2b_drain")).toBe(
|
|
39
|
+
true,
|
|
40
|
+
)
|
|
41
|
+
|
|
21
42
|
expect(solver.solved).toBe(true)
|
|
22
43
|
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
23
44
|
})
|