@tscircuit/core 0.0.1910 → 0.0.1912

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 CHANGED
@@ -5363,6 +5363,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
5363
5363
  defaultTraceWidth: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
5364
5364
  pcbRouteCache: z.ZodOptional<z.ZodType<_tscircuit_props.PcbRouteCache, z.ZodTypeDef, _tscircuit_props.PcbRouteCache>>;
5365
5365
  autorouter: z.ZodOptional<z.ZodType<_tscircuit_props.AutorouterProp, z.ZodTypeDef, _tscircuit_props.AutorouterProp>>;
5366
+ preflightRoutingCheckPolicy: z.ZodOptional<z.ZodEnum<["none", "basic", "conservative"]>>;
5366
5367
  autorouterEffortLevel: z.ZodOptional<z.ZodEnum<["1x", "2x", "5x", "10x", "100x"]>>;
5367
5368
  autorouterVersion: z.ZodOptional<z.ZodEffects<z.ZodType<_tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>, z.ZodTypeDef, _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>>, "beta_pipeline1" | "beta_pipeline3" | "beta_pipeline4" | "beta_pipeline5" | "beta_pipeline7" | "beta_pipeline9" | "latest", _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>>>;
5368
5369
  circuitJson: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
@@ -5421,6 +5422,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
5421
5422
  material: z.ZodDefault<z.ZodEnum<["fr4", "fr1", "flex"]>>;
5422
5423
  layers: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<4>, z.ZodLiteral<6>, z.ZodLiteral<8>, z.ZodLiteral<10>]>>;
5423
5424
  allowBlindAndBuriedVias: z.ZodDefault<z.ZodBoolean>;
5425
+ routeRemaining: z.ZodOptional<z.ZodBoolean>;
5424
5426
  defaultViaTenting: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["both_sides", "top_and_bottom_tented", "top_tented", "bottom_tented", "exposed"]>]>, "top_and_bottom_tented" | "top_tented" | "bottom_tented" | "exposed", boolean | "both_sides" | "top_and_bottom_tented" | "top_tented" | "bottom_tented" | "exposed">>;
5425
5427
  borderRadius: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
5426
5428
  thickness: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -5753,6 +5755,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
5753
5755
  defaultTraceWidth?: number | undefined;
5754
5756
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
5755
5757
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
5758
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
5756
5759
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
5757
5760
  autorouterVersion?: "beta_pipeline1" | "beta_pipeline3" | "beta_pipeline4" | "beta_pipeline5" | "beta_pipeline7" | "beta_pipeline9" | "latest" | undefined;
5758
5761
  circuitJson?: any[] | undefined;
@@ -5816,6 +5819,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
5816
5819
  schMatchAdapt?: boolean | undefined;
5817
5820
  title?: string | undefined;
5818
5821
  fabricatorPreset?: "jlcpcb_economy" | "jlcpcb_standard" | "jlcpcb_economy_20260912" | "jlcpcb_standard_20260912" | undefined;
5822
+ routeRemaining?: boolean | undefined;
5819
5823
  defaultViaTenting?: "top_and_bottom_tented" | "top_tented" | "bottom_tented" | "exposed" | undefined;
5820
5824
  borderRadius?: number | undefined;
5821
5825
  boardAnchorPosition?: {
@@ -6100,6 +6104,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
6100
6104
  defaultTraceWidth?: string | number | undefined;
6101
6105
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
6102
6106
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
6107
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
6103
6108
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
6104
6109
  autorouterVersion?: _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion> | undefined;
6105
6110
  circuitJson?: any[] | undefined;
@@ -6165,6 +6170,7 @@ declare class Board extends Group<typeof boardProps> implements BoardI, Subcircu
6165
6170
  fabricatorPreset?: "jlcpcb_economy" | "jlcpcb_standard" | "jlcpcb_economy_20260912" | "jlcpcb_standard_20260912" | undefined;
6166
6171
  material?: "flex" | "fr4" | "fr1" | undefined;
6167
6172
  allowBlindAndBuriedVias?: boolean | undefined;
6173
+ routeRemaining?: boolean | undefined;
6168
6174
  defaultViaTenting?: boolean | "both_sides" | "top_and_bottom_tented" | "top_tented" | "bottom_tented" | "exposed" | undefined;
6169
6175
  borderRadius?: string | number | undefined;
6170
6176
  boardAnchorPosition?: {
@@ -6831,6 +6837,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
6831
6837
  _subcircuitCachingEnabled: zod.ZodOptional<zod.ZodBoolean>;
6832
6838
  pcbRouteCache: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbRouteCache, zod.ZodTypeDef, _tscircuit_props.PcbRouteCache>>;
6833
6839
  autorouter: zod.ZodOptional<zod.ZodType<_tscircuit_props.AutorouterProp, zod.ZodTypeDef, _tscircuit_props.AutorouterProp>>;
6840
+ preflightRoutingCheckPolicy: zod.ZodOptional<zod.ZodEnum<["none", "basic", "conservative"]>>;
6834
6841
  autorouterEffortLevel: zod.ZodOptional<zod.ZodEnum<["1x", "2x", "5x", "10x", "100x"]>>;
6835
6842
  autorouterVersion: zod.ZodOptional<zod.ZodEffects<zod.ZodType<_tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>, zod.ZodTypeDef, _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>>, "beta_pipeline1" | "beta_pipeline3" | "beta_pipeline4" | "beta_pipeline5" | "beta_pipeline7" | "beta_pipeline9" | "latest", _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>>>;
6836
6843
  square: zod.ZodOptional<zod.ZodBoolean>;
@@ -7442,6 +7449,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
7442
7449
  defaultTraceWidth?: number | undefined;
7443
7450
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
7444
7451
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
7452
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
7445
7453
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
7446
7454
  autorouterVersion?: "beta_pipeline1" | "beta_pipeline3" | "beta_pipeline4" | "beta_pipeline5" | "beta_pipeline7" | "beta_pipeline9" | "latest" | undefined;
7447
7455
  circuitJson?: any[] | undefined;
@@ -7804,6 +7812,7 @@ declare class MountedBoard extends Subcircuit implements BoardI {
7804
7812
  defaultTraceWidth?: string | number | undefined;
7805
7813
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
7806
7814
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
7815
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
7807
7816
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
7808
7817
  autorouterVersion?: _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion> | undefined;
7809
7818
  circuitJson?: any[] | undefined;
@@ -94338,6 +94347,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
94338
94347
  key: zod.ZodOptional<zod.ZodAny>;
94339
94348
  name: zod.ZodOptional<zod.ZodString>;
94340
94349
  autorouter: zod.ZodOptional<zod.ZodType<_tscircuit_props.AutorouterProp, zod.ZodTypeDef, _tscircuit_props.AutorouterProp>>;
94350
+ preflightRoutingCheckPolicy: zod.ZodOptional<zod.ZodEnum<["none", "basic", "conservative"]>>;
94341
94351
  phaseIndex: zod.ZodOptional<zod.ZodNumber>;
94342
94352
  pcbTracePaths: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
94343
94353
  connection: zod.ZodString;
@@ -94503,6 +94513,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
94503
94513
  minViaHoleDiameter?: number | undefined;
94504
94514
  minViaPadDiameter?: number | undefined;
94505
94515
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
94516
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
94506
94517
  connection?: string | undefined;
94507
94518
  busFanoutDirections?: Record<string, "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top" | {
94508
94519
  direction: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top";
@@ -94556,6 +94567,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
94556
94567
  minViaHoleDiameter?: string | number | undefined;
94557
94568
  minViaPadDiameter?: string | number | undefined;
94558
94569
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
94570
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
94559
94571
  connection?: string | undefined;
94560
94572
  busFanoutDirections?: Record<string, "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top" | {
94561
94573
  direction: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top";
@@ -94619,6 +94631,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
94619
94631
  minViaHoleDiameter?: number | undefined;
94620
94632
  minViaPadDiameter?: number | undefined;
94621
94633
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
94634
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
94622
94635
  connection?: string | undefined;
94623
94636
  busFanoutDirections?: Record<string, "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top" | {
94624
94637
  direction: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top";
@@ -94672,6 +94685,7 @@ declare class AutoroutingPhase extends PrimitiveComponent<typeof autoroutingPhas
94672
94685
  minViaHoleDiameter?: string | number | undefined;
94673
94686
  minViaPadDiameter?: string | number | undefined;
94674
94687
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
94688
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
94675
94689
  connection?: string | undefined;
94676
94690
  busFanoutDirections?: Record<string, "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top" | {
94677
94691
  direction: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | "topside_left" | "topside_center" | "topside_right" | "rightside_top" | "rightside_center" | "rightside_bottom" | "bottomside_right" | "bottomside_center" | "bottomside_left" | "leftside_bottom" | "leftside_center" | "leftside_top";
@@ -96942,6 +96956,7 @@ declare class Breakout extends Group<typeof breakoutProps> {
96942
96956
  partsEngine: zod.ZodOptional<zod.ZodType<_tscircuit_props.PartsEngine, zod.ZodTypeDef, _tscircuit_props.PartsEngine>>;
96943
96957
  _subcircuitCachingEnabled: zod.ZodOptional<zod.ZodBoolean>;
96944
96958
  pcbRouteCache: zod.ZodOptional<zod.ZodType<_tscircuit_props.PcbRouteCache, zod.ZodTypeDef, _tscircuit_props.PcbRouteCache>>;
96959
+ preflightRoutingCheckPolicy: zod.ZodOptional<zod.ZodEnum<["none", "basic", "conservative"]>>;
96945
96960
  autorouterEffortLevel: zod.ZodOptional<zod.ZodEnum<["1x", "2x", "5x", "10x", "100x"]>>;
96946
96961
  autorouterVersion: zod.ZodOptional<zod.ZodEffects<zod.ZodType<_tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>, zod.ZodTypeDef, _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>>, "beta_pipeline1" | "beta_pipeline3" | "beta_pipeline4" | "beta_pipeline5" | "beta_pipeline7" | "beta_pipeline9" | "latest", _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion>>>;
96947
96962
  square: zod.ZodOptional<zod.ZodBoolean>;
@@ -97607,6 +97622,7 @@ declare class Breakout extends Group<typeof breakoutProps> {
97607
97622
  bomDisabled?: boolean | undefined;
97608
97623
  defaultTraceWidth?: number | undefined;
97609
97624
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
97625
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
97610
97626
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
97611
97627
  autorouterVersion?: "beta_pipeline1" | "beta_pipeline3" | "beta_pipeline4" | "beta_pipeline5" | "beta_pipeline7" | "beta_pipeline9" | "latest" | undefined;
97612
97628
  circuitJson?: any[] | undefined;
@@ -97960,6 +97976,7 @@ declare class Breakout extends Group<typeof breakoutProps> {
97960
97976
  defaultTraceWidth?: string | number | undefined;
97961
97977
  pcbRouteCache?: _tscircuit_props.PcbRouteCache | undefined;
97962
97978
  autorouter?: _tscircuit_props.AutorouterProp | undefined;
97979
+ preflightRoutingCheckPolicy?: "none" | "basic" | "conservative" | undefined;
97963
97980
  autorouterEffortLevel?: "2x" | "1x" | "5x" | "10x" | "100x" | undefined;
97964
97981
  autorouterVersion?: _tscircuit_props.AutocompleteString<_tscircuit_props.AutorouterVersion> | undefined;
97965
97982
  circuitJson?: any[] | undefined;
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
- while (!router.solved && !router.failed) {
30295
- for (let batch = 0; batch < 5e3 && !router.solved && !router.failed; batch++)
30296
- router.step();
30297
- const routedConnectionCount = router.getSolvedRouteCount();
30298
- if (maximumPartialCandidates > 0 && connections.length >= (sourceOrigin ? 2 : 3) && routedConnectionCount === connections.length - 1) {
30299
- const output = router.getOutput();
30300
- const signature = output.map((route) => {
30301
- const middle = route.route[Math.floor(route.route.length / 2)];
30302
- return `${route.connectionName}:${route.route.length}:${middle.x},${middle.y}`;
30303
- }).sort().join(";");
30304
- if (!partialSignatures.has(signature) && (!sourceOrigin || partialCandidates.length < maximumPartialCandidates)) {
30305
- partialSignatures.add(signature);
30306
- partialCandidates.push(output);
30307
- if (partialCandidates.length > maximumPartialCandidates)
30308
- partialCandidates.shift();
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 BaseSolver {
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
- const yielded = result.value;
43476
- if (yielded?.type === "subsolver" && yielded.solver instanceof BaseSolver) {
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 BaseSolver {
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 BaseSolver2,
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 BaseSolver2 {
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 BaseSolver2 {
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 BaseSolver2 {
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 BaseSolver2 {
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 BaseSolver3 } from "@tscircuit/solver-utils";
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 BaseSolver3 {
51476
+ var ViaStitchSolver = class extends BaseSolver5 {
51395
51477
  constructor(input) {
51396
51478
  super();
51397
51479
  this.input = input;
@@ -61827,6 +61909,9 @@ function Group_getRoutingPhasePlans(group) {
61827
61909
  const autoroutersByPhaseIndex = getAutoroutersByPhaseIndex(group);
61828
61910
  const phasePropsByPhaseIndex = getAutoroutingPhasePropsByPhaseIndex(group);
61829
61911
  const groupFanoutProps = group._parsedProps;
61912
+ const routeRemaining = group.getInheritedProperty("routeRemaining") !== false;
61913
+ const defaultPhaseProps = phasePropsByPhaseIndex.get(null);
61914
+ const includeUnassignedConnections = routeRemaining || defaultPhaseProps !== void 0 && !defaultPhaseProps.reroute && getConnectionSelectorsFromAutoroutingPhaseProps(defaultPhaseProps).length === 0;
61830
61915
  const hasDirectRoutingTargets = traces.length > 0 || nets.length > 0;
61831
61916
  const hasReroutePhase = Array.from(phasePropsByPhaseIndex.values()).some(
61832
61917
  (phaseProps) => phaseProps.reroute
@@ -61841,6 +61926,7 @@ function Group_getRoutingPhasePlans(group) {
61841
61926
  for (const net of nets) {
61842
61927
  if (breakoutByNet.has(net)) continue;
61843
61928
  const routingPhaseIndex = getNetRoutingPhaseIndex(net);
61929
+ if (routingPhaseIndex === null && !includeUnassignedConnections) continue;
61844
61930
  getOrCreateRoutingPhasePlan(plansByPhaseIndex, routingPhaseIndex).nets.push(
61845
61931
  net
61846
61932
  );
@@ -61848,6 +61934,7 @@ function Group_getRoutingPhasePlans(group) {
61848
61934
  for (const trace of traces) {
61849
61935
  if (breakoutByTrace.has(trace)) continue;
61850
61936
  const routingPhaseIndex = getTraceRoutingPhaseIndex(trace, buses);
61937
+ if (routingPhaseIndex === null && !includeUnassignedConnections) continue;
61851
61938
  getOrCreateRoutingPhasePlan(
61852
61939
  plansByPhaseIndex,
61853
61940
  routingPhaseIndex
@@ -62008,8 +62095,7 @@ function Group_getRoutingPhasePlans(group) {
62008
62095
  });
62009
62096
  }
62010
62097
  }
62011
- const defaultPhaseProps = phasePropsByPhaseIndex.get(null);
62012
- if (hasDirectRoutingTargets && phasePropsByPhaseIndex.size === 1 && defaultPhaseProps?.reroute && plans.length === 1 && plans[0]?.routingPhaseIndex === null) {
62098
+ if (routeRemaining && hasDirectRoutingTargets && phasePropsByPhaseIndex.size === 1 && defaultPhaseProps?.reroute && plans.length === 1 && plans[0]?.routingPhaseIndex === null) {
62013
62099
  const reroutePlan = plans[0];
62014
62100
  return [
62015
62101
  ...breakoutPlans,
@@ -62028,7 +62114,7 @@ function Group_getRoutingPhasePlans(group) {
62028
62114
  var package_default = {
62029
62115
  name: "@tscircuit/core",
62030
62116
  type: "module",
62031
- version: "0.0.1909",
62117
+ version: "0.0.1911",
62032
62118
  types: "dist/index.d.ts",
62033
62119
  main: "dist/index.js",
62034
62120
  module: "dist/index.js",
@@ -62068,7 +62154,7 @@ var package_default = {
62068
62154
  "@tscircuit/common": "^0.0.20",
62069
62155
  "@tscircuit/copper-pour-solver": "^0.0.54",
62070
62156
  "@tscircuit/create-fdm-enclosure": "0.0.4",
62071
- "@tscircuit/fanout-solver": "0.0.76",
62157
+ "@tscircuit/fanout-solver": "0.0.78",
62072
62158
  "@tscircuit/footprinter": "^0.0.426",
62073
62159
  "@tscircuit/image-utils": "^0.0.8",
62074
62160
  "@tscircuit/implicit-copper-pour-solver": "github:tscircuit/implicit-copper-pour-solver#a5cbbda0cd65fd4707c5c1af25779837c25aba92",
@@ -62081,7 +62167,7 @@ var package_default = {
62081
62167
  "@tscircuit/math-utils": "^0.0.36",
62082
62168
  "@tscircuit/miniflex": "^0.0.4",
62083
62169
  "@tscircuit/ngspice-spice-engine": "^0.0.20",
62084
- "@tscircuit/props": "^0.0.657",
62170
+ "@tscircuit/props": "^0.0.660",
62085
62171
  "@tscircuit/schematic-match-adapt": "^0.0.18",
62086
62172
  "@tscircuit/schematic-trace-solver": "^0.0.196",
62087
62173
  "@tscircuit/solver-utils": "^0.0.16",
@@ -62160,7 +62246,7 @@ var package_default = {
62160
62246
  },
62161
62247
  overrides: {
62162
62248
  "@tscircuit/circuit-json-util": "^0.0.113",
62163
- "@tscircuit/props": "^0.0.657",
62249
+ "@tscircuit/props": "^0.0.660",
62164
62250
  "circuit-json": "^0.0.489"
62165
62251
  }
62166
62252
  };
@@ -63852,7 +63938,7 @@ var Group5 = class extends NormalComponent3 {
63852
63938
  props.defaultTraceWidth ?? props.nominalTraceWidth ?? minTraceWidth
63853
63939
  );
63854
63940
  const routingPhasePlans = this._getRoutingPhasePlans();
63855
- const hasPhasedAutorouting = Group_hasPhasedAutorouting(routingPhasePlans);
63941
+ const hasPhasedAutorouting = this.getInheritedProperty("routeRemaining") === false || Group_hasPhasedAutorouting(routingPhasePlans);
63856
63942
  const shouldEmitRoutingPhaseDebugObjects = routingPhasePlans.length > 1;
63857
63943
  const routingPhaseDisplayIndexes = new Map(
63858
63944
  routingPhasePlans.map((plan, index) => [plan, index])
@@ -71946,7 +72032,7 @@ var validateWindingBreakoutInput = (input) => {
71946
72032
  };
71947
72033
 
71948
72034
  // node_modules/@tscircuit/winding-breakout-point-solver/lib/solvers/GatePlacementSolver.ts
71949
- import { BaseSolver as BaseSolver4 } from "@tscircuit/solver-utils";
72035
+ import { BaseSolver as BaseSolver6 } from "@tscircuit/solver-utils";
71950
72036
 
71951
72037
  // node_modules/@tscircuit/winding-breakout-point-solver/lib/gate-placement/place-breakout-gates.ts
71952
72038
  var GEOMETRY_EPSILON = 1e-9;
@@ -72476,7 +72562,7 @@ var getSharedGateSlotCount = (points) => new Set(
72476
72562
  (point6) => `${point6.regionId}:${point6.x.toFixed(9)}:${point6.y.toFixed(9)}`
72477
72563
  )
72478
72564
  ).size;
72479
- var GatePlacementSolver = class extends BaseSolver4 {
72565
+ var GatePlacementSolver = class extends BaseSolver6 {
72480
72566
  constructor(params) {
72481
72567
  super();
72482
72568
  this.params = params;
@@ -72615,7 +72701,7 @@ var GatePlacementSolver = class extends BaseSolver4 {
72615
72701
  };
72616
72702
 
72617
72703
  // node_modules/@tscircuit/winding-breakout-point-solver/lib/solvers/ReferenceOrderingSolver.ts
72618
- import { BaseSolver as BaseSolver5 } from "@tscircuit/solver-utils";
72704
+ import { BaseSolver as BaseSolver7 } from "@tscircuit/solver-utils";
72619
72705
 
72620
72706
  // node_modules/@tscircuit/winding-breakout-point-solver/lib/ordering/get-natural-winding-order.ts
72621
72707
  var getNaturalWindingOrder = (region, connections) => connections.map((connection) => {
@@ -72682,7 +72768,7 @@ var getReferenceWindingOrder = (naturalOrder, atomicGroups, buses) => {
72682
72768
  };
72683
72769
 
72684
72770
  // node_modules/@tscircuit/winding-breakout-point-solver/lib/solvers/ReferenceOrderingSolver.ts
72685
- var ReferenceOrderingSolver = class extends BaseSolver5 {
72771
+ var ReferenceOrderingSolver = class extends BaseSolver7 {
72686
72772
  constructor(params) {
72687
72773
  super();
72688
72774
  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.1910",
4
+ "version": "0.0.1912",
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.76",
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",
@@ -54,7 +54,7 @@
54
54
  "@tscircuit/math-utils": "^0.0.36",
55
55
  "@tscircuit/miniflex": "^0.0.4",
56
56
  "@tscircuit/ngspice-spice-engine": "^0.0.20",
57
- "@tscircuit/props": "^0.0.657",
57
+ "@tscircuit/props": "^0.0.660",
58
58
  "@tscircuit/schematic-match-adapt": "^0.0.18",
59
59
  "@tscircuit/schematic-trace-solver": "^0.0.196",
60
60
  "@tscircuit/solver-utils": "^0.0.16",
@@ -133,7 +133,7 @@
133
133
  },
134
134
  "overrides": {
135
135
  "@tscircuit/circuit-json-util": "^0.0.113",
136
- "@tscircuit/props": "^0.0.657",
136
+ "@tscircuit/props": "^0.0.660",
137
137
  "circuit-json": "^0.0.489"
138
138
  }
139
139
  }