@tscircuit/capacity-autorouter 0.0.221 → 0.0.223

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
@@ -188,6 +188,7 @@ declare class CapacityMeshEdgeSolver extends BaseSolver {
188
188
  type PortPoint = {
189
189
  connectionName: string;
190
190
  rootConnectionName?: string;
191
+ portPointId?: string;
191
192
  x: number;
192
193
  y: number;
193
194
  z: number;
@@ -1404,7 +1405,7 @@ declare class PortPointPathingSolver extends BaseSolver {
1404
1405
  offBoardNodes: InputNodeWithPortPoints[];
1405
1406
  /** Cache of base node cost (cost of node in current committed state) */
1406
1407
  private baseNodeCostCache;
1407
- constructor({ simpleRouteJson, inputNodes, capacityMeshNodes, colorMap, nodeMemoryPfMap, hyperParameters, precomputedInitialParams, }: {
1408
+ constructor({ simpleRouteJson, inputNodes, capacityMeshNodes, colorMap, nodeMemoryPfMap, hyperParameters, precomputedInitialParams, fixedRoutes, }: {
1408
1409
  simpleRouteJson: SimpleRouteJson;
1409
1410
  capacityMeshNodes: CapacityMeshNode[];
1410
1411
  inputNodes: InputNodeWithPortPoints[];
@@ -1412,6 +1413,8 @@ declare class PortPointPathingSolver extends BaseSolver {
1412
1413
  nodeMemoryPfMap?: Map<CapacityMeshNodeId, number>;
1413
1414
  hyperParameters?: Partial<PortPointPathingHyperParameters>;
1414
1415
  precomputedInitialParams?: PrecomputedInitialParams;
1416
+ /** Pre-routed connections that should not be re-routed but should appear in results */
1417
+ fixedRoutes?: ConnectionPathResult[];
1415
1418
  });
1416
1419
  private clearCostCaches;
1417
1420
  private clampPf;
@@ -1533,6 +1536,10 @@ interface HyperPortPointPathingSolverParams {
1533
1536
  numShuffleSeeds?: number;
1534
1537
  minAllowedBoardScore?: number;
1535
1538
  hyperParameters?: Partial<PortPointPathingHyperParameters>;
1539
+ /** Pre-routed connections that should not be re-routed but should appear in results */
1540
+ fixedRoutes?: ConnectionPathResult[];
1541
+ /** Custom precomputed params (if provided, skips internal precomputation) */
1542
+ precomputedInitialParams?: PrecomputedInitialParams;
1536
1543
  }
1537
1544
  declare class HyperPortPointPathingSolver extends HyperParameterSupervisorSolver<PortPointPathingSolver> {
1538
1545
  private params;
@@ -1611,6 +1618,7 @@ interface SectionPath {
1611
1618
  y: number;
1612
1619
  z: number;
1613
1620
  nodeId: CapacityMeshNodeId;
1621
+ portPointId?: string;
1614
1622
  }>;
1615
1623
  /** Index in original path where this segment starts */
1616
1624
  originalStartIndex: number;
@@ -1668,6 +1676,16 @@ interface MultiSectionPortPointOptimizerParams {
1668
1676
  /** Node assigned port points from initial run */
1669
1677
  initialNodeAssignedPortPoints: Map<CapacityMeshNodeId, PortPoint[]>;
1670
1678
  effort?: number;
1679
+ /**
1680
+ * Fraction of connections in a section to rip/replace (0-1).
1681
+ * Default 1 means rip all connections. Values less than 1 keep some traces.
1682
+ */
1683
+ FRACTION_TO_REPLACE?: number;
1684
+ /**
1685
+ * If true, always rip connections that have same-layer intersections,
1686
+ * even if they would otherwise be kept due to FRACTION_TO_REPLACE.
1687
+ */
1688
+ ALWAYS_RIP_INTERSECTIONS?: boolean;
1671
1689
  }
1672
1690
  /**
1673
1691
  * MultiSectionPortPointOptimizer runs local optimization on sections of the
@@ -1717,6 +1735,20 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
1717
1735
  MAX_SECTION_ATTEMPTS: number;
1718
1736
  /** Acceptable probability of failure threshold */
1719
1737
  ACCEPTABLE_PF: number;
1738
+ /**
1739
+ * Fraction of connections in a section to rip/replace (0-1).
1740
+ * Default 1 means rip all connections. Values less than 1 keep some traces.
1741
+ */
1742
+ FRACTION_TO_REPLACE: number;
1743
+ /**
1744
+ * If true, always rip connections that have same-layer intersections,
1745
+ * even if they would otherwise be kept due to FRACTION_TO_REPLACE.
1746
+ *
1747
+ * Uses a greedy vertex cover approach: for each intersection, only one
1748
+ * connection is ripped (chosen based on the shuffle seed), rather than
1749
+ * ripping all connections involved in intersections.
1750
+ */
1751
+ ALWAYS_RIP_INTERSECTIONS: boolean;
1720
1752
  effort: number;
1721
1753
  constructor(params: MultiSectionPortPointOptimizerParams);
1722
1754
  /**
@@ -1756,10 +1788,22 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
1756
1788
  sectionPath: SectionPath;
1757
1789
  originalConnectionResult: ConnectionPathResult;
1758
1790
  }>;
1791
+ /** Port points from connections that are being kept (not ripped) in the current section */
1792
+ currentSectionKeptPortPoints: Map<CapacityMeshNodeId, PortPoint[]>;
1793
+ /** Connection results for connections being kept (not ripped) - used for visualization */
1794
+ currentSectionFixedRoutes: ConnectionPathResult[];
1795
+ /**
1796
+ * Determine which connections to rip based on FRACTION_TO_REPLACE and ALWAYS_RIP_INTERSECTIONS.
1797
+ * Returns a set of connection names that should be ripped (re-routed).
1798
+ */
1799
+ determineConnectionsToRip(section: PortPointSection, allConnectionNames: string[]): Set<string>;
1759
1800
  /**
1760
1801
  * Create a SimpleRouteJson for just the section's connections.
1761
1802
  * Includes both fully contained connections AND cut paths (partial connections
1762
1803
  * that pass through the section).
1804
+ *
1805
+ * Respects FRACTION_TO_REPLACE and ALWAYS_RIP_INTERSECTIONS to determine which
1806
+ * connections to include for re-routing.
1763
1807
  */
1764
1808
  createSectionSimpleRouteJson(section: PortPointSection): SimpleRouteJson;
1765
1809
  /**
@@ -3209,7 +3253,7 @@ declare class AssignableAutoroutingPipeline2 extends BaseSolver {
3209
3253
  capacityNodes: CapacityMeshNode[] | null;
3210
3254
  capacityEdges: CapacityMeshEdge[] | null;
3211
3255
  cacheProvider: CacheProvider | null;
3212
- pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof RelateNodesToOffBoardConnectionsSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof AvailableSegmentPointSolver> | PipelineStep$1<typeof HyperPortPointPathingSolver> | PipelineStep$1<typeof SimpleHighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof TraceSimplificationSolver> | PipelineStep$1<typeof TraceKeepoutSolver> | PipelineStep$1<typeof TraceWidthSolver>)[];
3256
+ pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof RelateNodesToOffBoardConnectionsSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof AvailableSegmentPointSolver> | PipelineStep$1<typeof HyperPortPointPathingSolver> | PipelineStep$1<typeof MultiSectionPortPointOptimizer> | PipelineStep$1<typeof SimpleHighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof TraceSimplificationSolver> | PipelineStep$1<typeof TraceKeepoutSolver> | PipelineStep$1<typeof TraceWidthSolver>)[];
3213
3257
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
3214
3258
  getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$1];
3215
3259
  currentPipelineStepIndex: number;