Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export default () => {
{solver.solver?.activeSolver?.unsolvedConnections?.length}
</td>
<td style={{ fontVariantNumeric: "tabular-nums" }}>
{/* @ts-ignore */}
{solver.solver.solvedRoutes?.length}
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export default () => {
{solver.solver?.unsolvedConnections?.length}
</td>
<td style={{ fontVariantNumeric: "tabular-nums" }}>
{/* @ts-ignore */}
{solver.solver.solvedRoutes?.length}
</td>
<td>
Expand Down
51 changes: 48 additions & 3 deletions lib/solvers/HyperHighDensitySolver/HyperSingleIntraNodeSolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import { SingleTransitionCrossingRouteSolver } from "../HighDensitySolver/TwoRou
import { SingleTransitionIntraNodeSolver } from "../HighDensitySolver/SingleTransitionIntraNodeSolver"
import { MultiHeadPolyLineIntraNodeSolver2 } from "../HighDensitySolver/MultiHeadPolyLineIntraNodeSolver/MultiHeadPolyLineIntraNodeSolver2_Optimized"
import { MultiHeadPolyLineIntraNodeSolver3 } from "../HighDensitySolver/MultiHeadPolyLineIntraNodeSolver/MultiHeadPolyLineIntraNodeSolver3_ViaPossibilitiesSolverIntegration"
import { HighDensitySolverA01 } from "@tscircuit/high-density-a01"
import {
HighDensitySolverA01,
HighDensitySolverA02 as HighDensityA02Solver,
} from "@tscircuit/high-density-a01"
import { FixedTopologyHighDensityIntraNodeSolver } from "../FixedTopologyHighDensityIntraNodeSolver"

export class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<
Expand All @@ -23,6 +26,7 @@ export class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<
| SingleTransitionCrossingRouteSolver
| SingleTransitionIntraNodeSolver
| FixedTopologyHighDensityIntraNodeSolver
| HighDensityA02Solver
> {
override getSolverName(): string {
return "HyperSingleIntraNodeSolver"
Expand Down Expand Up @@ -59,6 +63,7 @@ export class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<
["closedFormSingleTrace"],
// ["closedFormTwoTrace"],
["highDensityA01"],
["highDensityA02"],
["fixedTopologyHighDensityIntraNodeSolver"],
]
}
Expand Down Expand Up @@ -198,11 +203,22 @@ export class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<
},
],
},
{
name: "highDensityA02",
possibleValues: [
{
HIGH_DENSITY_A02: true,
},
],
},
]
}

computeG(solver: IntraNodeRouteSolver) {
if ((solver as any) instanceof HighDensitySolverA01) {
if (
(solver as any) instanceof HighDensitySolverA01 ||
(solver as any) instanceof HighDensityA02Solver
) {
return (solver as any).iterations / 1_000_000
}
if (solver?.hyperParameters?.MULTI_HEAD_POLYLINE_SOLVER) {
Expand Down Expand Up @@ -238,6 +254,32 @@ export class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<
solver.MAX_ITERATIONS = 10_000_000
return solver as any
}
if (hyperParameters.HIGH_DENSITY_A02) {
const solver = new HighDensityA02Solver({
nodeWithPortPoints: this.nodeWithPortPoints,
outerGridCellSize: 0.1,
outerGridCellThickness: 2,
innerGridCellSize: 0.4,
viaDiameter: this.constructorParams.viaDiameter ?? 0.3,
viaMinDistFromBorder: 0.15,
traceMargin: 0.15,
enableDeferredConflictRepair: true,
maxDeferredRepairPasses: 48,
edgePenaltyStrength: 0.2,
// This likely needs to be corrected to use the actual trace width-
// but using anything but 0.1 for traceThickness is causing issues
// needs more debugging- repro01 in the high-density-a01 repo
// has a good reproduction
traceThickness: 0.1, // this.constructorParams.traceWidth ?? 0.15,
hyperParameters: {
greedyMultiplier: 1.2,
shuffleSeed: hyperParameters.SHUFFLE_SEED ?? 0,
ripCost: 1,
},
})
solver.MAX_ITERATIONS = 20_000_000 * this.effort
return solver as any
}
if (hyperParameters.CLOSED_FORM_TWO_TRACE_SAME_LAYER) {
return new TwoCrossingRoutesHighDensitySolver({
nodeWithPortPoints: this.nodeWithPortPoints,
Expand Down Expand Up @@ -282,7 +324,10 @@ export class HyperSingleIntraNodeSolver extends HyperParameterSupervisorSolver<

onSolve(solver: SupervisedSolver<IntraNodeRouteSolver>) {
let routes: HighDensityIntraNodeRoute[]
if ((solver.solver as any) instanceof HighDensitySolverA01) {
if (
(solver.solver as any) instanceof HighDensitySolverA01 ||
(solver.solver as any) instanceof HighDensityA02Solver
) {
routes = (solver.solver as any).getOutput()
} else {
routes = solver.solver.solvedRoutes
Expand Down
1 change: 1 addition & 0 deletions lib/testing/HyperHighDensityDebugger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export const HyperHighDensityDebugger = ({
{supervisedSolver.solver?.unsolvedConnections?.length}
</td>
<td style={{ fontVariantNumeric: "tabular-nums" }}>
{/* @ts-ignore */}
{supervisedSolver.solver.solvedRoutes?.length}
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"bun-match-svg": "^0.0.14"
},
"dependencies": {
"@tscircuit/high-density-a01": "^0.0.10",
"@tscircuit/high-density-a01": "^0.0.17",
"fast-json-stable-stringify": "^2.1.0",
"object-hash": "^3.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/e2e3-jumpers.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading