Skip to content

Reduce vias with multiobjective hypergraph routing#128

Draft
AnasSarkiz wants to merge 3 commits into
tscircuit:mainfrom
AnasSarkiz:reduce-vias-multiobjective-routing
Draft

Reduce vias with multiobjective hypergraph routing#128
AnasSarkiz wants to merge 3 commits into
tscircuit:mainfrom
AnasSarkiz:reduce-vias-multiobjective-routing

Conversation

@AnasSarkiz

@AnasSarkiz AnasSarkiz commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • track estimated vias, routing risk, and path length separately on routing labels
  • keep one strict risk-first A* label per directed hop while preserving via/length data for goal and completed-solution comparison
  • support multiple legal start/end ports and preserve the selected endpoint layer through reachability, replay, serialization, and section optimization
  • compare completed and section-optimized solutions using via count with max/total region-risk constraints

Why

Endpoint layer choices and layer changes were previously collapsed into the existing region-cost scalar. That forced multi-layer endpoints onto one configured port and discarded lower-via completed solutions.

The first implementation also maintained a live Pareto archive that active search did not consume. CPU profiling showed that archive and intermediate candidate copying dominated the routing hot path. This PR now keeps the multiobjective data used by goal and completed-solution selection without maintaining the unused frontier.

Validation

  • bun test: 98 passed, 0 failed
  • bun run typecheck: passed
  • bun run build: passed
  • srj18 sample009 port pathing: 31.54s -> 14.47s with the same 1,686,408 iterations
  • srj18 sample001: 28.1s -> 17.7s, 174 vias, completed, relaxed DRC passed
  • downstream Dataset01 first 20 scenarios before the hot-path-only optimization:
    • completion: 100% -> 100%
    • relaxed DRC: 95% -> 100%
    • paired vias: 285 -> 268
    • 7 improved, 2 regressed, 11 unchanged
    • no new solver failures or timeouts

Follow-up

The companion autorouter PR remains draft while CI reruns the full benchmark matrix. The hot-path optimization does not change search iterations or the validated sample001 via result.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tiny-hypergraph Ready Ready Preview, Comment Jul 15, 2026 11:29pm

Request Review

@tscircuitbot

Copy link
Copy Markdown

Benchmark This PR

Run benchmarks by commenting on this PR:

/benchmark [benchmark.sh args...]
/benchmark --dataset <hg07|srj18> --limit <n> --solver <core|poly> --families <default|default+deep|all> --concurrency <n|auto>

Everything after /benchmark is forwarded directly to ./benchmark.sh.
The result comment shows the matching dataset from the latest stored main-branch benchmark artifact beside the PR run; main is not rerun for each PR benchmark request.

Examples:

  • /benchmark -> hg07, all samples, core solver
  • /benchmark --dataset srj18 --limit 20 -> first 20 srj18 samples
  • /benchmark --dataset srj18 --concurrency auto -> srj18 samples with runner CPU-count concurrency
  • /benchmark --sample sample002 -> one hg07 sample
  • /benchmark --limit 20 --solver poly -> first 20 hg07 samples with the poly solver
  • /benchmark --limit 40 --families default+deep -> first 40 hg07 samples with deeper candidate families

Any PR whose title contains [BENCHMARK TEST] will automatically run the benchmark workflow on PR updates.

@AnasSarkiz

Copy link
Copy Markdown
Member Author

/benchmark --dataset srj18

@AnasSarkiz AnasSarkiz marked this pull request as draft July 15, 2026 22:12
@AnasSarkiz

Copy link
Copy Markdown
Member Author

/benchmark

@AnasSarkiz

Copy link
Copy Markdown
Member Author

/benchmark --dataset srj18

@tscircuit tscircuit deleted a comment from tscircuitbot Jul 15, 2026
@tscircuit tscircuit deleted a comment from tscircuitbot Jul 15, 2026
@tscircuitbot

tscircuitbot commented Jul 15, 2026

Copy link
Copy Markdown

Tiny Hypergraph Benchmark Results

Run Dataset Solver Families Success P50 P95
Main srj18 core default 31.3% 2.389s 10.653s
PR srj18 core default 31.3% 5.111s 34.661s
Main Branch Details
Metric Value
Dataset srj18
Solver core
Families default
Samples 16
Success rate 31.3%
Improved rate 60.0%
Zero final max region cost rate 0.0%
Avg baseline max region cost 0.565
Avg final max region cost 0.499
Avg max region delta 0.066
Avg candidate count 5.200
Avg duration 3.034s
P50 duration 2.389s
P95 duration 10.653s
Sample Status Baseline Final Delta Attempts Duration Error
sample001 success 0.670 0.579 0.090 4 3.193s
sample002 success 0.391 0.358 0.033 6 1.694s
sample003 success 0.429 0.429 0.000 5 0.796s
sample004 failed n/a n/a n/a 0 0.029s Error: Static reachability precheck failed: 2 route(s) have no legal path under the current reservation and start-reg...
sample005 success 0.423 0.423 0.000 7 1.309s
sample006 failed n/a n/a n/a 0 0.346s Error: Static reachability precheck failed: 9 route(s) have no legal path under the current reservation and start-reg...
sample007 failed n/a n/a n/a 0 10.653s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample008 failed n/a n/a n/a 0 2.389s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample009 failed n/a n/a n/a 0 0.272s Error: Static reachability precheck failed: 2 route(s) have no legal path under the current reservation and start-reg...
sample010 failed n/a n/a n/a 0 4.343s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample011 failed n/a n/a n/a 0 5.092s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample012 failed n/a n/a n/a 0 7.087s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample013 failed n/a n/a n/a 0 0.330s Error: Static reachability precheck failed: 11 route(s) have no legal path under the current reservation and start-re...
sample014 failed n/a n/a n/a 0 3.402s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample015 failed n/a n/a n/a 0 5.069s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample016 success 0.912 0.707 0.205 4 2.547s
PR Details
Metric Value
Dataset srj18
Solver core
Families default
Samples 16
Success rate 31.3%
Improved rate 60.0%
Zero final max region cost rate 0.0%
Avg baseline max region cost 0.555
Avg final max region cost 0.489
Avg max region delta 0.066
Avg candidate count 5.000
Avg duration 9.577s
P50 duration 5.111s
P95 duration 34.661s
Sample Status Baseline Final Delta Attempts Duration Error
sample001 success 0.670 0.579 0.090 4 7.411s
sample002 success 0.391 0.358 0.033 6 2.279s
sample003 success 0.378 0.378 0.000 4 1.271s
sample004 failed n/a n/a n/a 0 0.053s Error: Static reachability precheck failed: 2 route(s) have no legal path under the current reservation and start-reg...
sample005 success 0.423 0.423 0.000 7 2.142s
sample006 failed n/a n/a n/a 0 0.470s Error: Static reachability precheck failed: 9 route(s) have no legal path under the current reservation and start-reg...
sample007 failed n/a n/a n/a 0 34.661s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample008 failed n/a n/a n/a 0 7.410s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample009 failed n/a n/a n/a 0 0.234s Error: Static reachability precheck failed: 2 route(s) have no legal path under the current reservation and start-reg...
sample010 failed n/a n/a n/a 0 14.697s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample011 failed n/a n/a n/a 0 18.102s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample012 failed n/a n/a n/a 0 32.795s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample013 failed n/a n/a n/a 0 0.241s Error: Static reachability precheck failed: 11 route(s) have no legal path under the current reservation and start-re...
sample014 failed n/a n/a n/a 0 11.393s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample015 failed n/a n/a n/a 0 14.967s Error: TinyHyperGraphSectionPipelineSolver ran out of iterations
sample016 success 0.912 0.707 0.205 4 5.111s

Workflow: View run
Artifact: https://github.com/tscircuit/tiny-hypergraph/actions/runs/29456844290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants