@tscircuit/core 0.0.1910 → 0.0.1911
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 +122 -40
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -29210,6 +29210,7 @@ var BoundaryTerminalCopper = class {
|
|
|
29210
29210
|
import {
|
|
29211
29211
|
PortfolioSingleIntraNodeSolver
|
|
29212
29212
|
} from "@tscircuit/capacity-autorouter";
|
|
29213
|
+
import { BaseSolver } from "@tscircuit/solver-utils";
|
|
29213
29214
|
|
|
29214
29215
|
// node_modules/@tscircuit/fanout-solver/lib/cache-via-occupant-neighborhoods.ts
|
|
29215
29216
|
function cacheViaOccupantNeighborhoods(router) {
|
|
@@ -29465,6 +29466,57 @@ function attachSourceOriginTransitSearch(router, requiresTransit, topZ, minimumV
|
|
|
29465
29466
|
function getBusTargetLayer(params, busId) {
|
|
29466
29467
|
return params.targetLayerByBusId?.get(busId) ?? params.targetLayer;
|
|
29467
29468
|
}
|
|
29469
|
+
var BatchedReservedViaRoutingSolver = class extends BaseSolver {
|
|
29470
|
+
constructor(options) {
|
|
29471
|
+
super();
|
|
29472
|
+
this.options = options;
|
|
29473
|
+
this.activeSubSolver = options.router;
|
|
29474
|
+
this.MAX_ITERATIONS = Math.ceil(options.router.MAX_ITERATIONS / 5e3) + 1;
|
|
29475
|
+
}
|
|
29476
|
+
options;
|
|
29477
|
+
partialCandidates = [];
|
|
29478
|
+
partialSignatures = /* @__PURE__ */ new Set();
|
|
29479
|
+
_step() {
|
|
29480
|
+
const { router } = this.options;
|
|
29481
|
+
for (let batch = 0; batch < 5e3 && !router.solved && !router.failed; batch++)
|
|
29482
|
+
router.step();
|
|
29483
|
+
this.collectPartialCandidate();
|
|
29484
|
+
this.stats = {
|
|
29485
|
+
iterations: router.iterations,
|
|
29486
|
+
routedConnectionCount: router.getSolvedRouteCount(),
|
|
29487
|
+
connectionCount: this.options.connectionCount
|
|
29488
|
+
};
|
|
29489
|
+
if (router.solved || router.failed) {
|
|
29490
|
+
this.activeSubSolver = null;
|
|
29491
|
+
this.solved = true;
|
|
29492
|
+
}
|
|
29493
|
+
}
|
|
29494
|
+
collectPartialCandidate() {
|
|
29495
|
+
const { router, connectionCount, sourceOrigin, maximumPartialCandidates } = this.options;
|
|
29496
|
+
if (maximumPartialCandidates === 0 || connectionCount < (sourceOrigin ? 2 : 3) || router.getSolvedRouteCount() !== connectionCount - 1)
|
|
29497
|
+
return;
|
|
29498
|
+
const output = router.getOutput();
|
|
29499
|
+
const signature = output.map((route) => {
|
|
29500
|
+
const middle = route.route[Math.floor(route.route.length / 2)];
|
|
29501
|
+
return `${route.connectionName}:${route.route.length}:${middle.x},${middle.y}`;
|
|
29502
|
+
}).sort().join(";");
|
|
29503
|
+
if (this.partialSignatures.has(signature) || sourceOrigin && this.partialCandidates.length >= maximumPartialCandidates)
|
|
29504
|
+
return;
|
|
29505
|
+
this.partialSignatures.add(signature);
|
|
29506
|
+
this.partialCandidates.push(output);
|
|
29507
|
+
if (this.partialCandidates.length > maximumPartialCandidates)
|
|
29508
|
+
this.partialCandidates.shift();
|
|
29509
|
+
}
|
|
29510
|
+
computeProgress() {
|
|
29511
|
+
return this.options.router.iterations / this.options.router.MAX_ITERATIONS;
|
|
29512
|
+
}
|
|
29513
|
+
getConstructorParams() {
|
|
29514
|
+
return [this.options];
|
|
29515
|
+
}
|
|
29516
|
+
visualize() {
|
|
29517
|
+
return this.activeSubSolver?.visualize() ?? this.options.router.visualize();
|
|
29518
|
+
}
|
|
29519
|
+
};
|
|
29468
29520
|
var CopperIndex = class _CopperIndex {
|
|
29469
29521
|
constructor(cellSize, margin) {
|
|
29470
29522
|
this.cellSize = cellSize;
|
|
@@ -30288,32 +30340,30 @@ function* routeReservedViaBusesWorker(params, validatedTerminalSplices) {
|
|
|
30288
30340
|
if (sourceOrigin && !isVia && layer === "top" && router._moveCost >= 0 && (!transitSearch || transitSearch.beforeFirstVia()))
|
|
30289
30341
|
router._moveCost += baseCost * (sourceTravelCost - 1);
|
|
30290
30342
|
};
|
|
30291
|
-
const partialCandidates = [];
|
|
30292
|
-
const partialSignatures = /* @__PURE__ */ new Set();
|
|
30293
30343
|
const maximumPartialCandidates = sourceOrigin ? maximumSourceOriginRepairAttempts : maximumLocalRepairAttempts;
|
|
30294
|
-
|
|
30295
|
-
|
|
30296
|
-
|
|
30297
|
-
|
|
30298
|
-
|
|
30299
|
-
|
|
30300
|
-
|
|
30301
|
-
|
|
30302
|
-
|
|
30303
|
-
|
|
30304
|
-
|
|
30305
|
-
|
|
30306
|
-
|
|
30307
|
-
|
|
30308
|
-
|
|
30309
|
-
|
|
30310
|
-
}
|
|
30344
|
+
router.setup();
|
|
30345
|
+
const routingSolver = new BatchedReservedViaRoutingSolver({
|
|
30346
|
+
router,
|
|
30347
|
+
connectionCount: connections.length,
|
|
30348
|
+
sourceOrigin,
|
|
30349
|
+
maximumPartialCandidates
|
|
30350
|
+
});
|
|
30351
|
+
yield {
|
|
30352
|
+
type: "subsolver",
|
|
30353
|
+
solver: routingSolver,
|
|
30354
|
+
iterations: router.iterations,
|
|
30355
|
+
routedConnectionCount: router.getSolvedRouteCount(),
|
|
30356
|
+
connectionCount: connections.length
|
|
30357
|
+
};
|
|
30358
|
+
while (!routingSolver.solved && !routingSolver.failed) {
|
|
30359
|
+
routingSolver.step();
|
|
30311
30360
|
yield {
|
|
30312
30361
|
iterations: router.iterations,
|
|
30313
|
-
routedConnectionCount,
|
|
30362
|
+
routedConnectionCount: router.getSolvedRouteCount(),
|
|
30314
30363
|
connectionCount: connections.length
|
|
30315
30364
|
};
|
|
30316
30365
|
}
|
|
30366
|
+
const { partialCandidates } = routingSolver;
|
|
30317
30367
|
const makePrefixes = (routed) => allBuses.flatMap(
|
|
30318
30368
|
(bus) => bus.connections.filter((connection) => !routed.has(connection.connectionIndex)).map((connection) => {
|
|
30319
30369
|
const viaPoint = params.fixedViaPointsByConnectionIndex.get(
|
|
@@ -32699,6 +32749,12 @@ function* rerouteSourceOriginLengthsSteps(params) {
|
|
|
32699
32749
|
return null;
|
|
32700
32750
|
}
|
|
32701
32751
|
|
|
32752
|
+
// node_modules/@tscircuit/fanout-solver/lib/subsolver-request.ts
|
|
32753
|
+
import { BaseSolver as BaseSolver2 } from "@tscircuit/solver-utils";
|
|
32754
|
+
function isSubsolverRequest(request) {
|
|
32755
|
+
return typeof request === "object" && request !== null && "type" in request && request.type === "subsolver" && "solver" in request && request.solver instanceof BaseSolver2;
|
|
32756
|
+
}
|
|
32757
|
+
|
|
32702
32758
|
// node_modules/@tscircuit/fanout-solver/lib/route-peripheral-buses.ts
|
|
32703
32759
|
function* routePeripheralBusesSteps(params) {
|
|
32704
32760
|
const { srj, buses, layerNames } = params;
|
|
@@ -32755,6 +32811,11 @@ function* routePeripheralBusesSteps(params) {
|
|
|
32755
32811
|
});
|
|
32756
32812
|
let step = routing.next();
|
|
32757
32813
|
while (!step.done) {
|
|
32814
|
+
if (isSubsolverRequest(step.value)) {
|
|
32815
|
+
const output = yield step.value;
|
|
32816
|
+
step = routing.next(output);
|
|
32817
|
+
continue;
|
|
32818
|
+
}
|
|
32758
32819
|
yield {
|
|
32759
32820
|
phase: "route-layer",
|
|
32760
32821
|
iterations: step.value.iterations,
|
|
@@ -32879,7 +32940,7 @@ function* routePeripheralBusesSteps(params) {
|
|
|
32879
32940
|
}
|
|
32880
32941
|
|
|
32881
32942
|
// node_modules/@tscircuit/fanout-solver/lib/fanout-solver.ts
|
|
32882
|
-
import { BaseSolver } from "@tscircuit/solver-utils";
|
|
32943
|
+
import { BaseSolver as BaseSolver3 } from "@tscircuit/solver-utils";
|
|
32883
32944
|
|
|
32884
32945
|
// node_modules/@tscircuit/fanout-solver/lib/select-compatible-candidates.ts
|
|
32885
32946
|
function selectCompatibleCandidates(params) {
|
|
@@ -39901,6 +39962,11 @@ function* routeLayerReservedAttemptSteps(params, attemptState, attemptedWideSour
|
|
|
39901
39962
|
})();
|
|
39902
39963
|
let next = steps.next();
|
|
39903
39964
|
while (!next.done) {
|
|
39965
|
+
if (isSubsolverRequest(next.value)) {
|
|
39966
|
+
const output = yield next.value;
|
|
39967
|
+
next = steps.next(output);
|
|
39968
|
+
continue;
|
|
39969
|
+
}
|
|
39904
39970
|
yield {
|
|
39905
39971
|
phase: "route-layer",
|
|
39906
39972
|
layer,
|
|
@@ -40109,6 +40175,11 @@ function* routeLayerReservedAttemptSteps(params, attemptState, attemptedWideSour
|
|
|
40109
40175
|
});
|
|
40110
40176
|
let replacement = replacementSteps.next();
|
|
40111
40177
|
while (!replacement.done) {
|
|
40178
|
+
if (isSubsolverRequest(replacement.value)) {
|
|
40179
|
+
const output = yield replacement.value;
|
|
40180
|
+
replacement = replacementSteps.next(output);
|
|
40181
|
+
continue;
|
|
40182
|
+
}
|
|
40112
40183
|
yield {
|
|
40113
40184
|
phase: "repair-lengths",
|
|
40114
40185
|
layer,
|
|
@@ -43422,7 +43493,7 @@ function visualizeSimpleRouteJson(srj) {
|
|
|
43422
43493
|
|
|
43423
43494
|
// node_modules/@tscircuit/fanout-solver/lib/fanout-solver.ts
|
|
43424
43495
|
var process = getRuntimeProcess(globalThis);
|
|
43425
|
-
var FanoutWorkSolver = class extends
|
|
43496
|
+
var FanoutWorkSolver = class extends BaseSolver3 {
|
|
43426
43497
|
constructor(solverName, generator, getVisualization, getStats, getProgress) {
|
|
43427
43498
|
super();
|
|
43428
43499
|
this.solverName = solverName;
|
|
@@ -43472,10 +43543,8 @@ var FanoutWorkSolver = class extends BaseSolver {
|
|
|
43472
43543
|
this.solved = true;
|
|
43473
43544
|
return;
|
|
43474
43545
|
}
|
|
43475
|
-
|
|
43476
|
-
|
|
43477
|
-
this.activeSubSolver = yielded.solver;
|
|
43478
|
-
}
|
|
43546
|
+
if (isSubsolverRequest(result.value))
|
|
43547
|
+
this.activeSubSolver = result.value.solver;
|
|
43479
43548
|
}
|
|
43480
43549
|
computeProgress() {
|
|
43481
43550
|
return this.getProgress();
|
|
@@ -43979,7 +44048,7 @@ function getCandidateEscapeLayersForBus(params) {
|
|
|
43979
44048
|
const candidateLayers = individuallyRoutableLayers.length > 0 ? individuallyRoutableLayers : allowedEscapeLayers;
|
|
43980
44049
|
return candidateLayers;
|
|
43981
44050
|
}
|
|
43982
|
-
var FanoutSolver = class extends
|
|
44051
|
+
var FanoutSolver = class extends BaseSolver3 {
|
|
43983
44052
|
constructor(inputSrj, options = {}) {
|
|
43984
44053
|
super();
|
|
43985
44054
|
this.inputSrj = inputSrj;
|
|
@@ -44131,6 +44200,19 @@ var FanoutSolver = class extends BaseSolver {
|
|
|
44131
44200
|
const steps = peripheralRouting ? routePeripheralBusesSteps(params) : routeLayerReservedBusesSteps(params);
|
|
44132
44201
|
let next = steps.next();
|
|
44133
44202
|
while (!next.done) {
|
|
44203
|
+
if (isSubsolverRequest(next.value)) {
|
|
44204
|
+
this.stats = {
|
|
44205
|
+
...this.stats,
|
|
44206
|
+
phase: "layer-reserved-route-layer",
|
|
44207
|
+
workUnit: next.value.routedConnectionCount,
|
|
44208
|
+
workUnitCount: this.inputSrj.connections.length,
|
|
44209
|
+
routedConnections: `${next.value.routedConnectionCount}/${this.inputSrj.connections.length}`,
|
|
44210
|
+
routingIterations: next.value.iterations
|
|
44211
|
+
};
|
|
44212
|
+
const output = yield next.value;
|
|
44213
|
+
next = steps.next(output);
|
|
44214
|
+
continue;
|
|
44215
|
+
}
|
|
44134
44216
|
this.stats = {
|
|
44135
44217
|
...this.stats,
|
|
44136
44218
|
phase: `layer-reserved-${next.value.phase}`,
|
|
@@ -49211,7 +49293,7 @@ import { CreateFdmEnclosureSolver } from "@tscircuit/create-fdm-enclosure";
|
|
|
49211
49293
|
// node_modules/@tscircuit/implicit-copper-pour-solver/lib/implicit-copper-pour-pipeline-solver.ts
|
|
49212
49294
|
import {
|
|
49213
49295
|
BasePipelineSolver,
|
|
49214
|
-
BaseSolver as
|
|
49296
|
+
BaseSolver as BaseSolver4,
|
|
49215
49297
|
definePipelineStep
|
|
49216
49298
|
} from "@tscircuit/solver-utils";
|
|
49217
49299
|
|
|
@@ -50851,7 +50933,7 @@ var mergeSolverGraphics = (source, overlay) => {
|
|
|
50851
50933
|
};
|
|
50852
50934
|
|
|
50853
50935
|
// node_modules/@tscircuit/implicit-copper-pour-solver/lib/implicit-copper-pour-pipeline-solver.ts
|
|
50854
|
-
var PrepareCircuitJsonSolver = class extends
|
|
50936
|
+
var PrepareCircuitJsonSolver = class extends BaseSolver4 {
|
|
50855
50937
|
constructor(input) {
|
|
50856
50938
|
super();
|
|
50857
50939
|
this.input = input;
|
|
@@ -50867,7 +50949,7 @@ var PrepareCircuitJsonSolver = class extends BaseSolver2 {
|
|
|
50867
50949
|
return this.output;
|
|
50868
50950
|
}
|
|
50869
50951
|
};
|
|
50870
|
-
var AssignGridCellsSolver = class extends
|
|
50952
|
+
var AssignGridCellsSolver = class extends BaseSolver4 {
|
|
50871
50953
|
constructor(input) {
|
|
50872
50954
|
super();
|
|
50873
50955
|
this.input = input;
|
|
@@ -50890,7 +50972,7 @@ var AssignGridCellsSolver = class extends BaseSolver2 {
|
|
|
50890
50972
|
return this.output;
|
|
50891
50973
|
}
|
|
50892
50974
|
};
|
|
50893
|
-
var TracePowerPolygonsSolver = class extends
|
|
50975
|
+
var TracePowerPolygonsSolver = class extends BaseSolver4 {
|
|
50894
50976
|
constructor(input) {
|
|
50895
50977
|
super();
|
|
50896
50978
|
this.input = input;
|
|
@@ -50926,7 +51008,7 @@ var TracePowerPolygonsSolver = class extends BaseSolver2 {
|
|
|
50926
51008
|
};
|
|
50927
51009
|
}
|
|
50928
51010
|
};
|
|
50929
|
-
var SimplifyPolygonEdgesSolver = class extends
|
|
51011
|
+
var SimplifyPolygonEdgesSolver = class extends BaseSolver4 {
|
|
50930
51012
|
constructor(input) {
|
|
50931
51013
|
super();
|
|
50932
51014
|
this.input = input;
|
|
@@ -51064,7 +51146,7 @@ import { LayoutPipelineSolver } from "@tscircuit/matchpack";
|
|
|
51064
51146
|
import { SchematicTracePipelineSolver } from "@tscircuit/schematic-trace-solver";
|
|
51065
51147
|
|
|
51066
51148
|
// node_modules/@tscircuit/via-stitch-solver/lib/solvers/ViaStitchSolver.ts
|
|
51067
|
-
import { BaseSolver as
|
|
51149
|
+
import { BaseSolver as BaseSolver5 } from "@tscircuit/solver-utils";
|
|
51068
51150
|
|
|
51069
51151
|
// node_modules/@tscircuit/via-stitch-solver/lib/geometry/brep-point-containment.ts
|
|
51070
51152
|
var POINT_EPSILON = 1e-8;
|
|
@@ -51391,7 +51473,7 @@ var getGridCoordinates = ({
|
|
|
51391
51473
|
}
|
|
51392
51474
|
return coordinates;
|
|
51393
51475
|
};
|
|
51394
|
-
var ViaStitchSolver = class extends
|
|
51476
|
+
var ViaStitchSolver = class extends BaseSolver5 {
|
|
51395
51477
|
constructor(input) {
|
|
51396
51478
|
super();
|
|
51397
51479
|
this.input = input;
|
|
@@ -62028,7 +62110,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
62028
62110
|
var package_default = {
|
|
62029
62111
|
name: "@tscircuit/core",
|
|
62030
62112
|
type: "module",
|
|
62031
|
-
version: "0.0.
|
|
62113
|
+
version: "0.0.1910",
|
|
62032
62114
|
types: "dist/index.d.ts",
|
|
62033
62115
|
main: "dist/index.js",
|
|
62034
62116
|
module: "dist/index.js",
|
|
@@ -62068,7 +62150,7 @@ var package_default = {
|
|
|
62068
62150
|
"@tscircuit/common": "^0.0.20",
|
|
62069
62151
|
"@tscircuit/copper-pour-solver": "^0.0.54",
|
|
62070
62152
|
"@tscircuit/create-fdm-enclosure": "0.0.4",
|
|
62071
|
-
"@tscircuit/fanout-solver": "0.0.
|
|
62153
|
+
"@tscircuit/fanout-solver": "0.0.78",
|
|
62072
62154
|
"@tscircuit/footprinter": "^0.0.426",
|
|
62073
62155
|
"@tscircuit/image-utils": "^0.0.8",
|
|
62074
62156
|
"@tscircuit/implicit-copper-pour-solver": "github:tscircuit/implicit-copper-pour-solver#a5cbbda0cd65fd4707c5c1af25779837c25aba92",
|
|
@@ -71946,7 +72028,7 @@ var validateWindingBreakoutInput = (input) => {
|
|
|
71946
72028
|
};
|
|
71947
72029
|
|
|
71948
72030
|
// node_modules/@tscircuit/winding-breakout-point-solver/lib/solvers/GatePlacementSolver.ts
|
|
71949
|
-
import { BaseSolver as
|
|
72031
|
+
import { BaseSolver as BaseSolver6 } from "@tscircuit/solver-utils";
|
|
71950
72032
|
|
|
71951
72033
|
// node_modules/@tscircuit/winding-breakout-point-solver/lib/gate-placement/place-breakout-gates.ts
|
|
71952
72034
|
var GEOMETRY_EPSILON = 1e-9;
|
|
@@ -72476,7 +72558,7 @@ var getSharedGateSlotCount = (points) => new Set(
|
|
|
72476
72558
|
(point6) => `${point6.regionId}:${point6.x.toFixed(9)}:${point6.y.toFixed(9)}`
|
|
72477
72559
|
)
|
|
72478
72560
|
).size;
|
|
72479
|
-
var GatePlacementSolver = class extends
|
|
72561
|
+
var GatePlacementSolver = class extends BaseSolver6 {
|
|
72480
72562
|
constructor(params) {
|
|
72481
72563
|
super();
|
|
72482
72564
|
this.params = params;
|
|
@@ -72615,7 +72697,7 @@ var GatePlacementSolver = class extends BaseSolver4 {
|
|
|
72615
72697
|
};
|
|
72616
72698
|
|
|
72617
72699
|
// node_modules/@tscircuit/winding-breakout-point-solver/lib/solvers/ReferenceOrderingSolver.ts
|
|
72618
|
-
import { BaseSolver as
|
|
72700
|
+
import { BaseSolver as BaseSolver7 } from "@tscircuit/solver-utils";
|
|
72619
72701
|
|
|
72620
72702
|
// node_modules/@tscircuit/winding-breakout-point-solver/lib/ordering/get-natural-winding-order.ts
|
|
72621
72703
|
var getNaturalWindingOrder = (region, connections) => connections.map((connection) => {
|
|
@@ -72682,7 +72764,7 @@ var getReferenceWindingOrder = (naturalOrder, atomicGroups, buses) => {
|
|
|
72682
72764
|
};
|
|
72683
72765
|
|
|
72684
72766
|
// node_modules/@tscircuit/winding-breakout-point-solver/lib/solvers/ReferenceOrderingSolver.ts
|
|
72685
|
-
var ReferenceOrderingSolver = class extends
|
|
72767
|
+
var ReferenceOrderingSolver = class extends BaseSolver7 {
|
|
72686
72768
|
constructor(params) {
|
|
72687
72769
|
super();
|
|
72688
72770
|
this.params = params;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1911",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@tscircuit/common": "^0.0.20",
|
|
42
42
|
"@tscircuit/copper-pour-solver": "^0.0.54",
|
|
43
43
|
"@tscircuit/create-fdm-enclosure": "0.0.4",
|
|
44
|
-
"@tscircuit/fanout-solver": "0.0.
|
|
44
|
+
"@tscircuit/fanout-solver": "0.0.78",
|
|
45
45
|
"@tscircuit/footprinter": "^0.0.426",
|
|
46
46
|
"@tscircuit/image-utils": "^0.0.8",
|
|
47
47
|
"@tscircuit/implicit-copper-pour-solver": "github:tscircuit/implicit-copper-pour-solver#a5cbbda0cd65fd4707c5c1af25779837c25aba92",
|