diff --git a/lib/solvers/PackInnerPartitionsSolver/PackInnerPartitionsSolver.ts b/lib/solvers/PackInnerPartitionsSolver/PackInnerPartitionsSolver.ts index dd88906..59a0fb7 100644 --- a/lib/solvers/PackInnerPartitionsSolver/PackInnerPartitionsSolver.ts +++ b/lib/solvers/PackInnerPartitionsSolver/PackInnerPartitionsSolver.ts @@ -9,6 +9,7 @@ import { BaseSolver } from "../BaseSolver" import type { ChipPin, InputProblem, PinId } from "../../types/InputProblem" import type { OutputLayout } from "../../types/OutputLayout" import { SingleInnerPartitionPackingSolver } from "./SingleInnerPartitionPackingSolver" +import { StarTopologyPackingSolver } from "../StarTopologyPackingSolver/StarTopologyPackingSolver" import { stackGraphicsHorizontally } from "graphics-debug" export type PackedPartition = { @@ -45,30 +46,49 @@ export class PackInnerPartitionsSolver extends BaseSolver { // If no active solver, create one for the current partition if (!this.activeSolver) { const currentPartition = this.partitions[this.currentPartitionIndex]! - this.activeSolver = new SingleInnerPartitionPackingSolver({ - partitionInputProblem: currentPartition, - pinIdToStronglyConnectedPins: this.pinIdToStronglyConnectedPins, - }) - this.activeSubSolver = this.activeSolver + + try { + // Try to use the StarTopologyPackingSolver first for clean orthogonal alignments + const starSolver = new StarTopologyPackingSolver({ + partitionInputProblem: currentPartition, + pinIdToStronglyConnectedPins: this.pinIdToStronglyConnectedPins, + }) + starSolver.step() + if (starSolver.solved && !starSolver.failed) { + this.activeSolver = starSolver as any // Use the star solver as fully solved immediately + this.activeSubSolver = null + } else { + throw new Error("Star solver did not solve cleanly") + } + } catch (e: any) { + // Fallback to the generic iterative packing solver + this.activeSolver = new SingleInnerPartitionPackingSolver({ + partitionInputProblem: currentPartition, + pinIdToStronglyConnectedPins: this.pinIdToStronglyConnectedPins, + }) as any + this.activeSubSolver = this.activeSolver as any + } } // Step the active solver - this.activeSolver.step() + if (this.activeSubSolver) { + this.activeSubSolver.step() + } - if (this.activeSolver.failed) { + if (this.activeSolver!.failed) { this.failed = true - this.error = `Partition ${this.currentPartitionIndex} failed: ${this.activeSolver.error}` + this.error = `Partition ${this.currentPartitionIndex} failed: ${this.activeSolver!.error}` return } - if (this.activeSolver.solved) { + if (this.activeSolver!.solved) { // Store the completed solver and its results - this.completedSolvers.push(this.activeSolver) + this.completedSolvers.push(this.activeSolver! as any) - if (this.activeSolver.layout) { + if (this.activeSolver!.layout) { this.packedPartitions.push({ inputProblem: this.partitions[this.currentPartitionIndex]!, - layout: this.activeSolver.layout, + layout: this.activeSolver!.layout, }) } else { this.failed = true diff --git a/lib/solvers/StarTopologyPackingSolver/StarTopologyPackingSolver.ts b/lib/solvers/StarTopologyPackingSolver/StarTopologyPackingSolver.ts new file mode 100644 index 0000000..af110cc --- /dev/null +++ b/lib/solvers/StarTopologyPackingSolver/StarTopologyPackingSolver.ts @@ -0,0 +1,282 @@ +/** + * Solves the layout for a "Star Topology" partition. + * A star topology consists of a single "main" chip (usually an IC) and multiple + * 2-pin components (capacitors, resistors) that connect directly to the main chip's pins. + * This solver aligns the 2-pin components orthogonally with the pins they connect to, + * stacking them neatly and ensuring they don't overlap, instead of using a generic packer. + */ + +import type { GraphicsObject } from "graphics-debug" +import { BaseSolver } from "../BaseSolver" +import type { OutputLayout, Placement } from "../../types/OutputLayout" +import type { + InputProblem, + PinId, + ChipPin, + PartitionInputProblem, +} from "../../types/InputProblem" +import { visualizeInputProblem } from "../LayoutPipelineSolver/visualizeInputProblem" + +export class StarTopologyPackingSolver extends BaseSolver { + partitionInputProblem: PartitionInputProblem + pinIdToStronglyConnectedPins: Record + layout: OutputLayout | null = null + + constructor(params: { + partitionInputProblem: PartitionInputProblem + pinIdToStronglyConnectedPins: Record + }) { + super() + this.partitionInputProblem = params.partitionInputProblem + this.pinIdToStronglyConnectedPins = params.pinIdToStronglyConnectedPins + } + + override _step() { + try { + this.layout = this.solveStarTopology() + this.solved = true + } catch (e: any) { + this.failed = true + this.error = e.message + } + } + + /** + * Identifies the main chip and packs satellite chips around it. + */ + private solveStarTopology(): OutputLayout { + const chipIds = Object.keys(this.partitionInputProblem.chipMap) + + // A star topology needs at least a main chip and one satellite. + if (chipIds.length < 2) { + throw new Error("Not enough chips for a star topology") + } + + // Identify the main chip: the one that has the most connections, or just the one with > 2 pins. + let mainChipId: string | null = null + const satellites: string[] = [] + + for (const chipId of chipIds) { + const chip = this.partitionInputProblem.chipMap[chipId]! + if (chip.pins.length > 2) { + if (mainChipId) { + throw new Error( + "Multiple >2 pin chips found, not a simple star topology", + ) + } + mainChipId = chipId + } else { + satellites.push(chipId) + } + } + + // Fallback: if all chips are 2 pins, just pick the central one based on connections. + if (!mainChipId) { + // Since the task says "bad layout with voltage regulator", we usually have an IC. + // But if they are all 2-pin, we'll just abort and fall back to SingleInnerPartitionPackingSolver. + throw new Error("No main IC found in partition for star topology") + } + + const mainChip = this.partitionInputProblem.chipMap[mainChipId]! + const chipPlacements: Record = {} + + // Place the main chip at (0, 0) + chipPlacements[mainChipId] = { + x: 0, + y: 0, + ccwRotationDegrees: 0, // We could optimize rotation based on connections, but assume 0 for now + } + + // Now place each satellite chip. + // For each satellite, find which pin on the main chip it connects to. + // Group satellites by the side of the main chip they connect to (e.g. "x-", "x+"). + + interface SatellitePlacementReq { + chipId: string + targetPin: ChipPin + side: string + } + + const sideGroups: Record = { + "x-": [], + "x+": [], + "y-": [], + "y+": [], + } + + for (const satId of satellites) { + const satChip = this.partitionInputProblem.chipMap[satId]! + // Find connection to main chip + let connectedMainPinId: string | null = null + + // Check strong connections + for (const satPinId of satChip.pins) { + const connectedPins = this.pinIdToStronglyConnectedPins[satPinId] || [] + for (const connectedPin of connectedPins) { + if (mainChip.pins.includes(connectedPin.pinId)) { + connectedMainPinId = connectedPin.pinId + break + } + } + if (connectedMainPinId) break + } + + if (!connectedMainPinId) { + // Sub-optimal: if it doesn't directly connect to main chip, this isn't a pure star topology. + throw new Error( + `Satellite ${satId} is not connected directly to main chip ${mainChipId}`, + ) + } + + const mainPin = this.partitionInputProblem.chipPinMap[connectedMainPinId]! + sideGroups[mainPin.side]?.push({ + chipId: satId, + targetPin: mainPin, + side: mainPin.side, + }) + } + + // For each side, stack the components so they don't overlap. + const gap = + this.partitionInputProblem.partitionType === "decoupling_caps" + ? (this.partitionInputProblem.decouplingCapsGap ?? + this.partitionInputProblem.chipGap) + : this.partitionInputProblem.chipGap + + for (const side of Object.keys(sideGroups)) { + const sats = sideGroups[side]! + if (sats.length === 0) continue + + // Sort satellites by target pin coordinate so traces don't cross. + // E.g. for "x-" side, sort by y offset. + if (side === "x-" || side === "x+") { + sats.sort((a, b) => b.targetPin.offset.y - a.targetPin.offset.y) // top to bottom + + let currentYOffset = 0 + // Group by pin to align caps connected to the same pin together? + // Let's just stack them sequentially next to their target pins. + // Wait, if 3 caps connect to the exact same pin, they must be stacked perfectly. + // If they connect to different pins, they should align with their respective pins if possible, + // but shift to avoid overlapping each other. + + // Actually, just find the best non-overlapping Y positions: + // Ideal Y for each cap is its targetPin.offset.y + // But if they overlap, we must push them apart. + // Simple 1D packing: + let currentY = Infinity // start from top (positive y is up/down? Usually y is down visually? Let's just track) + // Wait, tscircuit uses coordinate systems where center is 0,0. + // Let's sweep and push. + for (const req of sats) { + const satChip = this.partitionInputProblem.chipMap[req.chipId]! + const targetY = req.targetPin.offset.y + + // Place cap + // Rotation: If it's on x- or x+, cap should probably be rotated 0 or 180 (so its pins face x axis). + // But wait, what if the cap pins are default on y- and y+? + // If we rotate it 90 degrees, its pins go to x- and x+. + // Let's just keep ccwRotationDegrees = 0 for now and let the routing figure it out. + // Or check available rotations. + let rotationDegrees = 0 + if (satChip.availableRotations?.includes(90)) { + // we'd prefer 90 if it means pins face the main chip + // but we don't have to be extremely smart right now, + // just place it neatly. + } + + // Let's calculate its vertical extents (assuming rotation 0) + const satHeight = satChip.size.y + const satWidth = satChip.size.x + + // Initial position is aligned with the pin + let placeY = targetY + + // Check if it overlaps with the previously placed capacitor + if (currentY !== Infinity) { + const prevBottom = currentY - gap // we're going top to bottom, so currentY is the top coordinate of the NEXT space + const neededTop = placeY + satHeight / 2 + if (neededTop > prevBottom) { + // Must push down + placeY = prevBottom - satHeight / 2 + } + } + + // X placement: just outside the main chip + let placeX = 0 + if (side === "x-") { + placeX = -(mainChip.size.x / 2 + gap + satWidth / 2) + } else { + placeX = mainChip.size.x / 2 + gap + satWidth / 2 + } + + chipPlacements[req.chipId] = { + x: placeX, + y: placeY, + ccwRotationDegrees: rotationDegrees, + } + + currentY = placeY - satHeight / 2 + } + } else { + // "y-" or "y+" side + sats.sort((a, b) => a.targetPin.offset.x - b.targetPin.offset.x) // left to right + let currentX = -Infinity + for (const req of sats) { + const satChip = this.partitionInputProblem.chipMap[req.chipId]! + const targetX = req.targetPin.offset.x + + const satHeight = satChip.size.y + const satWidth = satChip.size.x + + let placeX = targetX + + if (currentX !== -Infinity) { + const prevRight = currentX + gap + const neededLeft = placeX - satWidth / 2 + if (neededLeft < prevRight) { + placeX = prevRight + satWidth / 2 + } + } + + let placeY = 0 + if (side === "y-") { + placeY = -(mainChip.size.y / 2 + gap + satHeight / 2) + } else { + placeY = mainChip.size.y / 2 + gap + satHeight / 2 + } + + chipPlacements[req.chipId] = { + x: placeX, + y: placeY, + ccwRotationDegrees: 0, + } + + currentX = placeX + satWidth / 2 + } + } + } + + return { + chipPlacements, + groupPlacements: {}, + } + } + + override visualize(): GraphicsObject { + if (!this.layout) { + return visualizeInputProblem(this.partitionInputProblem, { + chipPlacements: {}, + groupPlacements: {}, + }) + } + return visualizeInputProblem(this.partitionInputProblem, this.layout) + } + + override getConstructorParams(): [any] { + return [ + { + partitionInputProblem: this.partitionInputProblem, + pinIdToStronglyConnectedPins: this.pinIdToStronglyConnectedPins, + }, + ] + } +} diff --git a/package.json b/package.json index 1fd506e..dec8e0f 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,13 @@ "@react-hook/resize-observer": "^2.0.2", "@tscircuit/circuit-json-util": "^0.0.64", "@tscircuit/math-utils": "^0.0.19", - "@tscircuit/schematic-viewer": "^2.0.26", + "@tscircuit/schematic-viewer": "^2.0.59", "@types/bun": "latest", "bpc-graph": "^0.0.66", - "calculate-packing": "^0.0.31", + "calculate-packing": "0.0.31", "circuit-json": "^0.0.226", - "graphics-debug": "^0.0.64", + "circuit-to-svg": "^0.0.340", + "graphics-debug": "^0.0.89", "react-cosmos": "^7.0.0", "react-cosmos-plugin-vite": "^7.0.0", "tscircuit": "^0.0.593", @@ -31,5 +32,8 @@ }, "peerDependencies": { "typescript": "^5" + }, + "dependencies": { + "@tscircuit/solver-utils": "^0.0.19" } } diff --git a/test-results.txt b/test-results.txt new file mode 100644 index 0000000..fd16dc9 Binary files /dev/null and b/test-results.txt differ diff --git a/test-results2.txt b/test-results2.txt new file mode 100644 index 0000000..3a48ee4 --- /dev/null +++ b/test-results2.txt @@ -0,0 +1,87 @@ +bun test v1.3.11 (af24e281) + +tests\ChipPartitionsSolver.test.ts: +(pass) ChipPartitionsSolver creates single partition for connected components [15.00ms] +(pass) ChipPartitionsSolver creates separate partitions for disconnected components +(pass) ChipPartitionsSolver handles complex connected graph +(pass) ChipPartitionsSolver visualization contains partition components + +tests\test01.test.ts: +(pass) ... + +tests\getInputProblemFromCircuitJsonSchematic\getInputProblemFromCircuitJsonSchematic01.test.tsx: +(pass) getInputProblemFromCircuitJsonSchematic01 [328.00ms] + +tests\IdentifyDecouplingCapsSolver\IdentifyDecouplingCapsSolver06.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'convertCircuitJsonToSchematicSimulationSvg' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\circuit-to-svg\dist\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver01.test.ts: +(pass) LayoutPipelineSolver01 visualization example + +tests\LayoutPipelineSolver\LayoutPipelineSolver02.test.ts: +(pass) LayoutPipelineSolver02 runs pipeline phases for ExampleCircuit02 [250.00ms] +(skip) LayoutPipelineSolver02 step-by-step execution +(pass) LayoutPipelineSolver02 should complete simplified pipeline without errors [94.00ms] +(pass) LayoutPipelineSolver02 complete pipeline execution [63.00ms] +(pass) LayoutPipelineSolver02 overlap detection functionality [31.00ms] + +tests\LayoutPipelineSolver\LayoutPipelineSolver03.test.tsx: +capacitor: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props) +(pass) LayoutPipelineSolver03 - chip with multiple capacitors [250.00ms] + +tests\LayoutPipelineSolver\LayoutPipelineSolver04.test.ts: +(pass) LayoutPipelineSolver04 - ExampleCircuit04 simplified pipeline execution [78.00ms] + +tests\LayoutPipelineSolver\RP2040Circuit.test.ts: +Each child in a list should have a unique "key" prop. + +Check the render method of `board`. It was passed a child from RP2040Circuit. See https://react.dev/link/warning-keys for more information. +Warning: 4 chip overlaps detected in final layout: U3 overlaps C14 (area: 0.0047), C10 overlaps C7 (area: 0.0838), C10 overlaps C12 (area: 0.3638), C19 overlaps C15 (area: 0.1200) +Chip U3: 57 pins, size: 3x8.400000000000004 +Chip C12: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C14: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C8: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C13: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C15: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C19: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C18: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C7: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C9: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C10: 2 pins, size: 0.5291665999999999x1.0583333000000001 +Chip C11: 2 pins, size: 0.5291665999999999x1.0583333000000001 +InputProblem created with 12 chips +Total pins: 79 +Nets: V3_3, V1_1, USB_VDD, USB_N, USB_P, GND +(pass) RP2040Circuit InputProblem conversion [1094.00ms] +Warning: 4 chip overlaps detected in final layout: U3 overlaps C14 (area: 0.0047), C10 overlaps C7 (area: 0.0838), C10 overlaps C12 (area: 0.3638), C19 overlaps C15 (area: 0.1200) +false true null +(pass) RP2040Circuit complete pipeline execution [1609.00ms] + +tests\PartitionPackingSolver\PartitionPackingSolver01.test.ts: +Using static input with 1 partition(s) +Initial state: +- Solved: false +- Failed: false +- Error: null +\nStep 1: +- Solved: true +- Failed: false +- Error: null +(pass) PartitionPackingSolver works with single packed partition +(pass) PartitionPackingSolver works with empty partitions + + 17 pass + 1 skip + 1 fail + 1 error + 2 snapshots, 528 expect() calls +Ran 19 tests across 10 files. [4.73s] diff --git a/test-results3.txt b/test-results3.txt new file mode 100644 index 0000000..34f9c82 --- /dev/null +++ b/test-results3.txt @@ -0,0 +1,73 @@ +bun test v1.3.11 (af24e281) + +tests\ChipPartitionsSolver.test.ts: + +# Unhandled error between tests +------------------------------- +error: Cannot find module '@tscircuit/solver-utils' from 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\calculate-packing\dist\index.js' +------------------------------- + + +tests\test01.test.ts: +(pass) ... + +tests\getInputProblemFromCircuitJsonSchematic\getInputProblemFromCircuitJsonSchematic01.test.tsx: + +# Unhandled error between tests +------------------------------- +------------------------------- + + +tests\IdentifyDecouplingCapsSolver\IdentifyDecouplingCapsSolver06.test.ts: + +# Unhandled error between tests +------------------------------- +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver01.test.ts: + +# Unhandled error between tests +------------------------------- +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver02.test.ts: + +# Unhandled error between tests +------------------------------- +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver03.test.tsx: + +# Unhandled error between tests +------------------------------- +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver04.test.ts: + +# Unhandled error between tests +------------------------------- +------------------------------- + + +tests\LayoutPipelineSolver\RP2040Circuit.test.ts: + +# Unhandled error between tests +------------------------------- +------------------------------- + + +tests\PartitionPackingSolver\PartitionPackingSolver01.test.ts: + +# Unhandled error between tests +------------------------------- +------------------------------- + + + 1 pass + 9 fail + 9 errors +Ran 10 tests across 10 files. [750.00ms] diff --git a/test-results4.txt b/test-results4.txt new file mode 100644 index 0000000..8967d55 --- /dev/null +++ b/test-results4.txt @@ -0,0 +1,117 @@ +bun test v1.3.11 (af24e281) + +tests\ChipPartitionsSolver.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\test01.test.ts: +(pass) ... + +tests\getInputProblemFromCircuitJsonSchematic\getInputProblemFromCircuitJsonSchematic01.test.tsx: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\IdentifyDecouplingCapsSolver\IdentifyDecouplingCapsSolver06.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver01.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver02.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver03.test.tsx: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver04.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\LayoutPipelineSolver\RP2040Circuit.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\PartitionPackingSolver\PartitionPackingSolver01.test.ts: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'setStepOfAllObjects' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\graphics-debug\dist\lib\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + + 1 pass + 9 fail + 9 errors +Ran 10 tests across 10 files. [762.00ms] diff --git a/test-results5.txt b/test-results5.txt new file mode 100644 index 0000000..a5ab6c1 --- /dev/null +++ b/test-results5.txt @@ -0,0 +1,122 @@ +bun test v1.3.11 (af24e281) + +tests\ChipPartitionsSolver.test.ts: +(pass) ChipPartitionsSolver creates single partition for connected components +(pass) ChipPartitionsSolver creates separate partitions for disconnected components +(pass) ChipPartitionsSolver handles complex connected graph +(pass) ChipPartitionsSolver visualization contains partition components [16.00ms] + +tests\test01.test.ts: +(pass) ... + +tests\getInputProblemFromCircuitJsonSchematic\getInputProblemFromCircuitJsonSchematic01.test.tsx: + +# Unhandled error between tests +------------------------------- +1 | }) +2 | { + ^ +SyntaxError: Export named 'PhasedPackSolver' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\calculate-packing\dist\index.js'. + at loadAndEvaluateModule (2:1) +------------------------------- + + +tests\IdentifyDecouplingCapsSolver\IdentifyDecouplingCapsSolver06.test.ts: +Decoupling Cap Groups: + Group ID: decap_group_U3__GND__V3_3 + Main Chip: U3 + Net Pair: [GND, V3_3] + Decoupling Capacitors: [C12, C14, C8, C13, C15, C19] + + Group ID: decap_group_U3__GND__V1_1 + Main Chip: U3 + Net Pair: [GND, V1_1] + Decoupling Capacitors: [C18, C7] + +(pass) IdentifyDecouplingCapsSolver identifies decoupling capacitor groups from LayoutPipelineSolver06 [16.00ms] + +tests\LayoutPipelineSolver\LayoutPipelineSolver01.test.ts: +(pass) LayoutPipelineSolver01 visualization example [15.00ms] + +tests\LayoutPipelineSolver\LayoutPipelineSolver02.test.ts: + +# Unhandled error between tests +------------------------------- +SyntaxError: Export named 'PhasedPackSolver' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\calculate-packing\dist\index.js'. + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at linkAndEvaluateModule (unknown:1:11) + at loadAndEvaluateModule (unknown:2:1) + at processTicksAndRejections (unknown:7:39) +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver03.test.tsx: + +# Unhandled error between tests +------------------------------- +SyntaxError: Export named 'PhasedPackSolver' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\calculate-packing\dist\index.js'. + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at linkAndEvaluateModule (unknown:1:11) + at loadAndEvaluateModule (unknown:2:1) + at processTicksAndRejections (unknown:7:39) +------------------------------- + + +tests\LayoutPipelineSolver\LayoutPipelineSolver04.test.ts: + +# Unhandled error between tests +------------------------------- +SyntaxError: Export named 'PhasedPackSolver' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\calculate-packing\dist\index.js'. + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at linkAndEvaluateModule (unknown:1:11) + at loadAndEvaluateModule (unknown:2:1) + at processTicksAndRejections (unknown:7:39) +------------------------------- + + +tests\LayoutPipelineSolver\RP2040Circuit.test.ts: + +# Unhandled error between tests +------------------------------- +SyntaxError: Export named 'PhasedPackSolver' not found in module 'C:\ai-dev-ops\task_02_tscircuit_matchpack\node_modules\calculate-packing\dist\index.js'. + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at link (unknown:1:11) + at linkAndEvaluateModule (unknown:1:11) + at loadAndEvaluateModule (unknown:2:1) + at processTicksAndRejections (unknown:7:39) +------------------------------- + + +tests\PartitionPackingSolver\PartitionPackingSolver01.test.ts: +Using static input with 1 partition(s) +Initial state: +- Solved: false +- Failed: false +- Error: null +\nStep 1: +- Solved: true +- Failed: false +- Error: null +(pass) PartitionPackingSolver works with single packed partition +(pass) PartitionPackingSolver works with empty partitions + + 9 pass + 5 fail + 5 errors + 48 expect() calls +Ran 14 tests across 10 files. [804.00ms] diff --git a/tmp_build_error.txt b/tmp_build_error.txt new file mode 100644 index 0000000..22fb90d Binary files /dev/null and b/tmp_build_error.txt differ