Integrate post-solve hypergraph region optimizer - #2100
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Benchmark This PRRun benchmarks by commenting on this PR: Comment Everything after Use Any PR whose title contains |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsBoth revisions ran sequentially in one Blacksmith job on Dataset:
Outcome changes: 1 improved, 2 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster. Changed outcomes (3)
Workflow: View run |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsBoth revisions ran sequentially in one Blacksmith job on Dataset:
Outcome changes: 0 improved, 3 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster. Changed outcomes (3)
Workflow: View run |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsThe paired benchmark ended with cancelled before both reports were produced. Workflow: View run |
…el-region-optimizer # Conflicts: # package.json
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsThe paired benchmark ended with cancelled before both reports were produced. Workflow: View run |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsBoth revisions ran sequentially in one Blacksmith job on Dataset:
Outcome changes: 0 improved, 1 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster. Changed outcomes (1)
Workflow: View run |
|
/benchmark --dataset 18 --same-machine |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsBoth revisions ran sequentially in one Blacksmith job on Dataset:
Outcome changes: 0 improved, 2 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster. Changed outcomes (2)
Workflow: View run |
|
/usf |
📸 Update Snapshots (focused)❌ Snapshot update failed. Please inspect workflow logs. Focused test files:
Source failure run: https://github.com/tscircuit/tscircuit-autorouter/actions/runs/31830484294 Changed snapshots:
Environment: benchmark runner ( 🔗 Workflow: View run |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsBoth revisions ran sequentially in one Blacksmith job on Dataset:
Outcome changes: 1 improved, 1 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster. Changed outcomes (2)
Workflow: View run |
|
/usf |
📸 Update Snapshots (focused)❌ Snapshot update failed. Please inspect workflow logs. Focused test files:
Source failure run: https://github.com/tscircuit/tscircuit-autorouter/actions/runs/31835393537 Changed snapshots:
Environment: benchmark runner ( 🔗 Workflow: View run |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsBoth revisions ran sequentially in one Blacksmith job on Dataset:
Outcome changes: 2 improved, 0 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster. Changed outcomes (2)
Workflow: View run |
|
/benchmark --dataset 18 --same-machine |
Same Machine Benchmark ResultsBoth revisions ran sequentially in one Blacksmith job on Dataset:
Outcome changes: 2 improved, 0 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster. Changed outcomes (2)
Workflow: View run |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
This PR was closed because it has been inactive for 1 day since being marked as stale. |
Summary
8b4a28eand run its post-solve optimizer on every solved mutable graph1dfd623for exact physical-pad identity, tangent detours, via-aware doglegs, same-net via canonicalization, and faster candidate DRCNo benchmark-shaped control flow
There is no sample ID, dataset classifier, density activation threshold, route-count gate, target-reduction cutoff, alternate pipeline portfolio, or acceptance ratio. The optimizer always runs after a successful graph solve and its output is consumed directly. Fixed-vs-movable behavior depends only on supplied immutable copper.
The performance work preserves every candidate budget, portfolio phase, branch order, and exact-DRC acceptance rule. It accelerates the shared evaluator rather than skipping work.
Region-cost result
./benchmark.shin tiny-hypergraph#166:All 8 cases complete, preserve every route, and improve. Total wall time is 37.835s; average optimizer time is 2.541s.
Downstream engineering evidence
SRJ18 sample 2 isolated the dense-routing relationship the aggregate benchmark had hidden. Compared on the same local machine:
f822ca1The region optimizer lowers downstream routing failure probability by 4.46% on this sample and reduces the detailed router's actual iteration count. Profiling the earlier timeout showed that improved routes gave exact repair many useful candidates, while the evaluator rebuilt a string-keyed spatial grid for each one.
In high-density-repair03#71, numeric spatial columns, stable item IDs, typed generation marking, and immutable connectivity memoization remove that repeated allocation without changing candidate ordering or error semantics. Unprofiled exact repair falls from 51.009s to 29.164s (42.8%) with the same 80 candidate attempts and identical branch decisions/error identities.
SRJ18 sample 13 exposed the optimizer's own contention cost. Its 5.53M exact A* expansions performed 125.5M marginal chord lookups, and the old cache discarded scores after every route-removed state.
tiny-hypergraph@8b4a28euses region-cache object identity, compact region-local port indexes, and paged typed-array rows; owner-independent crossing counts persist across searches while same-net corrections remain exact.An immediate old/new pair on the same local machine produced:
Both runs performed 5,533,365 reroute iterations, accepted the same 21 mutations, produced the same region costs and downstream-risk reduction, ran 756,186 high-density iterations, and ended with the same exact-DRC counts. The new CPU profile puts the old intersection scanner below 1% of optimizer time.
The next profile found an independent quadratic handoff cost: Pipeline 7 requested one node probability at a time, and each request rematerialized every solved tiny-hypergraph node. On sample 6, one high-density constructor step spent 66 seconds doing that repeated reconstruction and advanced the real router by zero iterations. The solver now computes the unchanged per-node scores from one materialization and reuses them. This preserves preloaded-route filtering semantics and changes no search budget, branch, ordering, or acceptance rule.
With that cache, a 60-second sample 6 window advances from 0 iterations/0 routes to 434,200 iterations/976 routes. The full production benchmark case now completes locally in 284.4s instead of timing out at 360s, after 1,212,713 high-density iterations. Sample 13 improves again from 115.31s to 98.86s through exact DRC (-14.3%) with identical optimizer iterations/mutations, high-density iterations, and
156 -> 98exact DRC result.The final fresh same-machine GitHub comparison improves aggregate routing outcomes on one sequentially shared 8-vCPU worker:
f822ca157a3232That run has two improved outcomes and zero regressions: sample 2 changes from timeout to solved, and sample 9 changes from solved-with-DRC-errors to DRC-passing. Across the 12 samples completed by both revisions, the PR is faster on 8, lowers combined runtime by 3.1%, lowers relaxed-DRC errors from 146 to 116 (-20.5%), and lowers average vias from 181.83 to 178.25. The bot's all-completed average includes sample 2's 465 vias only on the PR because main timed out.
The production optimizer reports lower total region cost and lower downstream failure risk on all 13 completed PR samples; max region cost improves on 9 and is unchanged on 4, with no increase. Aggregate total region cost falls 291.81 -> 257.42 (-11.8%), and the median downstream-risk reduction is 3.02%. See workflow 31841758356.
SRJ18 sample 3 exposed a separate correctness issue. Point-pair preprocessing split rotated
pcb_smtpad_56into three axis-aligned fragments with the same physical ID; the candidate evaluator deduplicated those fragments before restoring the original shape and missed a real 0.0601 mm pad/trace clearance. Pipeline 7 now reconstructs one original physical obstacle by exact metadata identity, unions its processed connectivity aliases, and repairs the sample to zero relaxed DRC errors.Other profiled fixes remain dependency- and geometry-driven:
Validation
bunx tsc --noEmitgit diff --checkThe requested
/benchmark --dataset 18 --same-machinecompleted successfully on code head57a3232cin workflow 31841758356. The later commits only preserve preloaded-route score semantics and refresh snapshots; SRJ18 execution is unchanged.