@tscircuit/capacity-autorouter 0.0.243 → 0.0.245

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
@@ -1850,6 +1850,7 @@ interface MultiSectionPortPointOptimizerParams {
1850
1850
  capacityMeshNodes: CapacityMeshNode[];
1851
1851
  capacityMeshEdges: CapacityMeshEdge[];
1852
1852
  colorMap?: Record<string, string>;
1853
+ SHUFFLE_SEEDS_PER_SECTION?: number | null;
1853
1854
  /** Results from the initial PortPointPathingSolver run */
1854
1855
  initialConnectionResults: ConnectionPathResult[];
1855
1856
  /** Assigned port points from initial run */
@@ -1940,6 +1941,7 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
1940
1941
  */
1941
1942
  FRACTION_TO_REPLACE: number;
1942
1943
  JUMPER_PF_FN_ENABLED: boolean;
1944
+ SHUFFLE_SEEDS_PER_SECTION: number | null | undefined;
1943
1945
  /**
1944
1946
  * If true, always rip connections that have same-layer intersections,
1945
1947
  * even if they would otherwise be kept due to FRACTION_TO_REPLACE.
@@ -2036,13 +2038,13 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
2036
2038
  visualize(): GraphicsObject;
2037
2039
  }
2038
2040
 
2039
- interface CapacityMeshSolverOptions$3 {
2041
+ interface CapacityMeshSolverOptions$4 {
2040
2042
  capacityDepth?: number;
2041
2043
  targetMinCapacity?: number;
2042
2044
  cacheProvider?: CacheProvider | null;
2043
2045
  effort?: number;
2044
2046
  }
2045
- type PipelineStep$3<T extends new (...args: any[]) => BaseSolver> = {
2047
+ type PipelineStep$4<T extends new (...args: any[]) => BaseSolver> = {
2046
2048
  solverName: string;
2047
2049
  solverClass: T;
2048
2050
  getConstructorParams: (instance: AutoroutingPipelineSolver2_PortPointPathing) => ConstructorParameters<T>;
@@ -2050,7 +2052,7 @@ type PipelineStep$3<T extends new (...args: any[]) => BaseSolver> = {
2050
2052
  };
2051
2053
  declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
2052
2054
  srj: SimpleRouteJson;
2053
- opts: CapacityMeshSolverOptions$3;
2055
+ opts: CapacityMeshSolverOptions$4;
2054
2056
  netToPointPairsSolver?: NetToPointPairsSolver;
2055
2057
  nodeSolver?: RectDiffPipeline;
2056
2058
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -2077,9 +2079,9 @@ declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
2077
2079
  capacityNodes: CapacityMeshNode[] | null;
2078
2080
  capacityEdges: CapacityMeshEdge[] | null;
2079
2081
  cacheProvider: CacheProvider | null;
2080
- pipelineDef: (PipelineStep$3<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$3<typeof RectDiffPipeline> | PipelineStep$3<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$3<typeof AvailableSegmentPointSolver> | PipelineStep$3<typeof HyperPortPointPathingSolver> | PipelineStep$3<typeof MultiSectionPortPointOptimizer> | PipelineStep$3<typeof HighDensitySolver> | PipelineStep$3<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$3<typeof TraceSimplificationSolver>)[];
2081
- constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$3);
2082
- getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$3];
2082
+ pipelineDef: (PipelineStep$4<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$4<typeof RectDiffPipeline> | PipelineStep$4<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$4<typeof AvailableSegmentPointSolver> | PipelineStep$4<typeof HyperPortPointPathingSolver> | PipelineStep$4<typeof MultiSectionPortPointOptimizer> | PipelineStep$4<typeof HighDensitySolver> | PipelineStep$4<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$4<typeof TraceSimplificationSolver>)[];
2083
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$4);
2084
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$4];
2083
2085
  currentPipelineStepIndex: number;
2084
2086
  _step(): void;
2085
2087
  solveUntilPhase(phase: string): void;
@@ -2895,12 +2897,12 @@ declare class CapacityPathingMultiSectionSolver extends BaseSolver {
2895
2897
  visualize(): graphics_debug.GraphicsObject;
2896
2898
  }
2897
2899
 
2898
- interface CapacityMeshSolverOptions$2 {
2900
+ interface CapacityMeshSolverOptions$3 {
2899
2901
  capacityDepth?: number;
2900
2902
  targetMinCapacity?: number;
2901
2903
  cacheProvider?: CacheProvider | null;
2902
2904
  }
2903
- type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
2905
+ type PipelineStep$3<T extends new (...args: any[]) => BaseSolver> = {
2904
2906
  solverName: string;
2905
2907
  solverClass: T;
2906
2908
  getConstructorParams: (instance: AutoroutingPipeline1_OriginalUnravel) => ConstructorParameters<T>;
@@ -2908,7 +2910,7 @@ type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
2908
2910
  };
2909
2911
  declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
2910
2912
  srj: SimpleRouteJson;
2911
- opts: CapacityMeshSolverOptions$2;
2913
+ opts: CapacityMeshSolverOptions$3;
2912
2914
  netToPointPairsSolver?: NetToPointPairsSolver;
2913
2915
  nodeSolver?: RectDiffPipeline;
2914
2916
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -2937,9 +2939,9 @@ declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
2937
2939
  capacityNodes: CapacityMeshNode[] | null;
2938
2940
  capacityEdges: CapacityMeshEdge[] | null;
2939
2941
  cacheProvider: CacheProvider | null;
2940
- pipelineDef: (PipelineStep$2<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$2<typeof RectDiffPipeline> | PipelineStep$2<typeof StrawSolver> | PipelineStep$2<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$2<typeof DeadEndSolver> | PipelineStep$2<typeof CapacityPathingGreedySolver> | PipelineStep$2<typeof CapacityPathingMultiSectionSolver> | PipelineStep$2<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$2<typeof CapacitySegmentToPointSolver> | PipelineStep$2<typeof UnravelMultiSectionSolver> | PipelineStep$2<typeof HighDensitySolver> | PipelineStep$2<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$2<typeof TraceSimplificationSolver>)[];
2941
- constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$2);
2942
- getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$2];
2942
+ pipelineDef: (PipelineStep$3<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$3<typeof RectDiffPipeline> | PipelineStep$3<typeof StrawSolver> | PipelineStep$3<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$3<typeof DeadEndSolver> | PipelineStep$3<typeof CapacityPathingGreedySolver> | PipelineStep$3<typeof CapacityPathingMultiSectionSolver> | PipelineStep$3<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$3<typeof CapacitySegmentToPointSolver> | PipelineStep$3<typeof UnravelMultiSectionSolver> | PipelineStep$3<typeof HighDensitySolver> | PipelineStep$3<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$3<typeof TraceSimplificationSolver>)[];
2943
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$3);
2944
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$3];
2943
2945
  currentPipelineStepIndex: number;
2944
2946
  _step(): void;
2945
2947
  solveUntilPhase(phase: string): void;
@@ -3037,7 +3039,7 @@ declare class SimpleHighDensitySolver extends BaseSolver {
3037
3039
  visualize(): GraphicsObject;
3038
3040
  }
3039
3041
 
3040
- type HyperGraphPatternType = "single_1206x4" | "1x2_1206x4" | "2x2_1206x4";
3042
+ type HyperGraphPatternType = "single_1206x4" | "1x2_1206x4" | "2x2_1206x4" | "3x1_1206x4" | "3x2_1206x4" | "3x3_1206x4" | "4x4_1206x4" | "6x4_1206x4";
3041
3043
  interface JumperPrepatternSolver2HyperParameters {
3042
3044
  /** Pattern type for jumper placement - "single_1206x4" (~8x8mm) or "2x2_1206x4" (~14x14mm) */
3043
3045
  PATTERN_TYPE?: HyperGraphPatternType;
@@ -3650,13 +3652,13 @@ declare class RelateNodesToOffBoardConnectionsSolver extends BaseSolver {
3650
3652
  visualize(): GraphicsObject;
3651
3653
  }
3652
3654
 
3653
- interface CapacityMeshSolverOptions$1 {
3655
+ interface CapacityMeshSolverOptions$2 {
3654
3656
  capacityDepth?: number;
3655
3657
  targetMinCapacity?: number;
3656
3658
  cacheProvider?: CacheProvider | null;
3657
3659
  effort?: number;
3658
3660
  }
3659
- type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
3661
+ type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
3660
3662
  solverName: string;
3661
3663
  solverClass: T;
3662
3664
  getConstructorParams: (instance: AssignableAutoroutingPipeline2) => ConstructorParameters<T>;
@@ -3664,7 +3666,7 @@ type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
3664
3666
  };
3665
3667
  declare class AssignableAutoroutingPipeline2 extends BaseSolver {
3666
3668
  srj: SimpleRouteJson;
3667
- opts: CapacityMeshSolverOptions$1;
3669
+ opts: CapacityMeshSolverOptions$2;
3668
3670
  netToPointPairsSolver?: NetToPointPairsSolver;
3669
3671
  nodeSolver?: RectDiffPipeline;
3670
3672
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -3698,7 +3700,144 @@ declare class AssignableAutoroutingPipeline2 extends BaseSolver {
3698
3700
  capacityNodes: CapacityMeshNode[] | null;
3699
3701
  capacityEdges: CapacityMeshEdge[] | null;
3700
3702
  cacheProvider: CacheProvider | null;
3701
- 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>)[];
3703
+ pipelineDef: (PipelineStep$2<typeof NetToPointPairsSolver> | PipelineStep$2<typeof RectDiffPipeline> | PipelineStep$2<typeof RelateNodesToOffBoardConnectionsSolver> | PipelineStep$2<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$2<typeof AvailableSegmentPointSolver> | PipelineStep$2<typeof HyperPortPointPathingSolver> | PipelineStep$2<typeof MultiSectionPortPointOptimizer> | PipelineStep$2<typeof SimpleHighDensitySolver> | PipelineStep$2<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$2<typeof TraceSimplificationSolver> | PipelineStep$2<typeof TraceKeepoutSolver> | PipelineStep$2<typeof TraceWidthSolver>)[];
3704
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$2);
3705
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$2];
3706
+ currentPipelineStepIndex: number;
3707
+ _step(): void;
3708
+ solveUntilPhase(phase: string): void;
3709
+ getCurrentPhase(): string;
3710
+ visualize(): GraphicsObject;
3711
+ /**
3712
+ * A lightweight version of the visualize method that can be used to stream
3713
+ * progress
3714
+ *
3715
+ * We return the most relevant graphic for the stage:
3716
+ * 1. netToPointPairs output
3717
+ * 2. Capacity Planning Output
3718
+ * 3. High Density Route Solver Output, max 200 lines
3719
+ */
3720
+ preview(): GraphicsObject;
3721
+ _getOutputHdRoutes(): HighDensityRoute$1[];
3722
+ getConnectedOffboardObstacles(): Record<ObstacleId, RootConnectionName>;
3723
+ /**
3724
+ * Returns the SimpleRouteJson with routes converted to SimplifiedPcbTraces
3725
+ */
3726
+ getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces;
3727
+ getOutputSimpleRouteJson(): SimpleRouteJson;
3728
+ }
3729
+
3730
+ type UnsolvedRouteWithOrder = {
3731
+ connectionName: string;
3732
+ hdRoutes: HighDensityIntraNodeRoute$1[];
3733
+ /** Node IDs in order from start to end */
3734
+ nodeOrder: string[];
3735
+ start: {
3736
+ x: number;
3737
+ y: number;
3738
+ z: number;
3739
+ };
3740
+ end: {
3741
+ x: number;
3742
+ y: number;
3743
+ z: number;
3744
+ };
3745
+ };
3746
+ /**
3747
+ * MultipleHighDensityRouteStitchSolver2 uses path ordering information from
3748
+ * the port point pathing solver to correctly stitch routes that may reuse
3749
+ * the same node multiple times.
3750
+ *
3751
+ * Unlike the original solver that uses connectivity maps to find endpoints,
3752
+ * this version uses the node traversal order from the pathing solver.
3753
+ */
3754
+ declare class MultipleHighDensityRouteStitchSolver2 extends BaseSolver {
3755
+ unsolvedRoutes: UnsolvedRouteWithOrder[];
3756
+ mergedHdRoutes: HighDensityIntraNodeRoute$1[];
3757
+ colorMap: Record<string, string>;
3758
+ defaultTraceThickness: number;
3759
+ defaultViaDiameter: number;
3760
+ constructor(params: {
3761
+ connections: SimpleRouteConnection[];
3762
+ hdRoutes: HighDensityIntraNodeRoute$1[];
3763
+ /** Connection path results from port point pathing solver */
3764
+ connectionPathResults: ConnectionPathResult[];
3765
+ colorMap?: Record<string, string>;
3766
+ layerCount: number;
3767
+ defaultViaDiameter?: number;
3768
+ });
3769
+ _step(): void;
3770
+ /**
3771
+ * Stitch routes together using the node order from pathing results.
3772
+ *
3773
+ * The key insight is that each HD route corresponds to a segment within a
3774
+ * capacity node. The nodeOrder tells us which nodes we visit in sequence.
3775
+ * We use this to order the routes correctly, even when a node is visited
3776
+ * multiple times.
3777
+ */
3778
+ private stitchOrderedRoutes;
3779
+ /**
3780
+ * Order routes based on the node traversal path.
3781
+ * Each node in nodeOrder may have one or more routes.
3782
+ * Returns routes in the order they should be stitched.
3783
+ */
3784
+ private orderRoutesByNodePath;
3785
+ /**
3786
+ * Fallback: order routes by proximity, starting from the start point.
3787
+ */
3788
+ private orderRoutesByProximity;
3789
+ visualize(): GraphicsObject;
3790
+ }
3791
+
3792
+ interface CapacityMeshSolverOptions$1 {
3793
+ capacityDepth?: number;
3794
+ targetMinCapacity?: number;
3795
+ cacheProvider?: CacheProvider | null;
3796
+ effort?: number;
3797
+ }
3798
+ type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
3799
+ solverName: string;
3800
+ solverClass: T;
3801
+ getConstructorParams: (instance: AssignableAutoroutingPipeline3) => ConstructorParameters<T>;
3802
+ onSolved?: (instance: AssignableAutoroutingPipeline3) => void;
3803
+ };
3804
+ declare class AssignableAutoroutingPipeline3 extends BaseSolver {
3805
+ srj: SimpleRouteJson;
3806
+ opts: CapacityMeshSolverOptions$1;
3807
+ netToPointPairsSolver?: NetToPointPairsSolver;
3808
+ nodeSolver?: RectDiffPipeline;
3809
+ nodeTargetMerger?: CapacityNodeTargetMerger;
3810
+ edgeSolver?: CapacityMeshEdgeSolver;
3811
+ relateNodesToOffBoardConnections?: RelateNodesToOffBoardConnectionsSolver;
3812
+ colorMap: Record<string, string>;
3813
+ highDensityRouteSolver?: HighDensitySolver;
3814
+ /** @deprecated Use highDensitySolver instead */
3815
+ simpleHighDensityRouteSolver?: SimpleHighDensitySolver;
3816
+ highDensitySolver?: JumperHighDensitySolver;
3817
+ highDensityStitchSolver?: MultipleHighDensityRouteStitchSolver2;
3818
+ singleLayerNodeMerger?: SingleLayerNodeMergerSolver;
3819
+ offboardPathFragmentSolver?: PortPointOffboardPathFragmentSolver;
3820
+ strawSolver?: StrawSolver;
3821
+ deadEndSolver?: DeadEndSolver;
3822
+ traceSimplificationSolver?: TraceSimplificationSolver;
3823
+ traceKeepoutSolver?: TraceKeepoutSolver;
3824
+ traceWidthSolver?: TraceWidthSolver;
3825
+ availableSegmentPointSolver?: AvailableSegmentPointSolver;
3826
+ portPointPathingSolver?: PortPointPathingSolver;
3827
+ multiSectionPortPointOptimizer?: MultiSectionPortPointOptimizer;
3828
+ viaDiameter: number;
3829
+ minTraceWidth: number;
3830
+ effort: number;
3831
+ startTimeOfPhase: Record<string, number>;
3832
+ endTimeOfPhase: Record<string, number>;
3833
+ timeSpentOnPhase: Record<string, number>;
3834
+ activeSubSolver?: BaseSolver | null;
3835
+ connMap: ConnectivityMap;
3836
+ srjWithPointPairs?: SimpleRouteJson;
3837
+ capacityNodes: CapacityMeshNode[] | null;
3838
+ capacityEdges: CapacityMeshEdge[] | null;
3839
+ cacheProvider: CacheProvider | null;
3840
+ 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 JumperHighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver2> | PipelineStep$1<typeof TraceKeepoutSolver> | PipelineStep$1<typeof TraceWidthSolver>)[];
3702
3841
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
3703
3842
  getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$1];
3704
3843
  currentPipelineStepIndex: number;
@@ -3722,6 +3861,13 @@ declare class AssignableAutoroutingPipeline2 extends BaseSolver {
3722
3861
  * Returns the SimpleRouteJson with routes converted to SimplifiedPcbTraces
3723
3862
  */
3724
3863
  getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces;
3864
+ /**
3865
+ * Collects ALL jumpers from the highDensitySolver and converts them to SRJ Jumper format.
3866
+ * This returns all jumpers placed in the jumper grid (from baseGraph.jumperLocations),
3867
+ * not just the ones used by routes. These will be used as obstacles for the keepout
3868
+ * solver and added to the final SRJ output.
3869
+ */
3870
+ getOutputJumpers(): Jumper$1[];
3725
3871
  getOutputSimpleRouteJson(): SimpleRouteJson;
3726
3872
  }
3727
3873
 
@@ -4894,4 +5040,4 @@ declare class IntraNodeSolverWithJumpers extends BaseSolver {
4894
5040
  visualize(): GraphicsObject;
4895
5041
  }
4896
5042
 
4897
- export { AssignableAutoroutingPipeline1Solver, AssignableAutoroutingPipeline2, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver2_PortPointPathing as AutoroutingPipelineSolver, type AutoroutingPipelineSolverOptions, type CachableSolver, type CacheProvider, CapacityMeshSolver, type HighDensityIntraNodeRouteWithJumpers, JumperHighDensitySolver as HighDensitySolver, InMemoryCache, IntraNodeSolverWithJumpers, type Jumper, LocalStorageCache, SingleHighDensityRouteWithJumpersSolver, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };
5043
+ export { AssignableAutoroutingPipeline1Solver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver2_PortPointPathing as AutoroutingPipelineSolver, type AutoroutingPipelineSolverOptions, type CachableSolver, type CacheProvider, CapacityMeshSolver, type HighDensityIntraNodeRouteWithJumpers, JumperHighDensitySolver as HighDensitySolver, InMemoryCache, IntraNodeSolverWithJumpers, type Jumper, LocalStorageCache, SingleHighDensityRouteWithJumpersSolver, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };