Skip to content

Run hypergraph-native region optimization after every solve - #2115

Closed
seveibar wants to merge 10 commits into
mainfrom
agent/integrate-hypergraph-region-optimizer
Closed

Run hypergraph-native region optimization after every solve#2115
seveibar wants to merge 10 commits into
mainfrom
agent/integrate-hypergraph-region-optimizer

Conversation

@seveibar

@seveibar seveibar commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pin tiny-hypergraph#166 at 8573307
  • run its post-solve region-cost optimizer after every shared tiny-hypergraph pathing solve
  • always consume the optimizer's solved hypergraph as the port-point pathing output
  • preserve serialized fixed routes using existing hypergraph connection metadata
  • use the dependency's final path-relinking pass to remove speculative mutations that are not needed to hold the optimized peak

There is no optimizer toggle, per-pipeline branch, dataset classifier, density gate, or target threshold.

Scope boundary

This is the focused replacement for #2100, which remains open only as an implementation and benchmark reference.

This PR intentionally does not:

  • pass SimpleRouteJson into hypergraph pathing
  • infer obstacle connectivity or reconstruct pad/obstacle geometry
  • add pipeline-specific optimizer behavior
  • change DRC evaluation, high-density repair, stitching, or trace simplification
  • add thresholds, sample/dataset checks, alternate portfolios, or conditional stage execution

Why these changes are necessary

The tiny-hypergraph section pipeline owns the post-solve stage, but the autorouter wrapper previously returned the preceding section solver's graph. This integration supplies only hypergraph-native options and selects the optimizer stage's output. An optimizer failure is surfaced as an error rather than hidden behind a fallback.

The dependency now follows single-route descent before opening pair ejection, preserving the full neighborhood while avoiding repeated quadratic work. It then reverse-relinks the accepted mutation history under the achieved peak as a hard constraint. This retains temporary plateau moves when they unlock a better peak, but removes unrelated lane displacement and superseded route replacements before detailed routing.

Pipeline7 evidence

  • Tiny-hypergraph ./benchmark.sh: all 8 committed Pipeline7 hypergraphs completed and improved; P50 maximum region cost reduced 59.1%, P95 reduced 51.8%.
  • Paired SRJ18 same-machine run: relaxed-DRC success increased from 43.8% to 50.0% (+6.2 pp) with 1 improved outcome and 0 regressions. Completion held at 81.3%, P80 time fell 22.3%, and average vias fell 1.5%.
  • In that paired run, dense sample 2 changed from solved with relaxed-DRC errors to a relaxed-DRC pass while falling from 349.4s to 271.4s.
  • SRJ18 sample 3: completes in 10.4s and passes relaxed DRC; the prior optimizer revision's unrelated same-net via regression is gone.
  • SRJ18 sample 13: keeps a 33.8% peak-cost reduction (4.277 to 2.831). Trace simplification finishes in 12.3s instead of remaining in same-net via merging past 60s, and the full sample completes in 79.2s rather than timing out. Its existing dense-layout DRC failures remain.

The paired benchmark used runtime commit 45cc81c; subsequent commits change SVG snapshots only.

Validation

  • tiny-hypergraph: 144 tests passed, 0 failed
  • tiny-hypergraph: bunx tsc --noEmit, format check, and git diff --check
  • tiny-hypergraph: ./benchmark.sh — P50 59.1%, P95 51.8%
  • autorouter universal-stage integration test: 1 passed, 0 failed
  • autorouter focused affected route/snapshot tests: 12 passed, 0 failed
  • autorouter CI: all 8 test shards, build, type-check, format-check, and added-code check passed
  • autorouter: git diff --check

The autorouter diff contains no new SimpleRouteJson, geometric-connectivity, DRC-repair, high-density-repair, threshold, or sample-specific plumbing.

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
capacity-node-autorouter Ready Ready Preview Aug 15, 2026 7:05am

Request Review

@tscircuitbot

Copy link
Copy Markdown
Contributor

Benchmark This PR

Run benchmarks by commenting on this PR:

/benchmark [benchmark.sh args...]
/benchmark-long [benchmark.sh args...]
/benchmark-all
/benchmark --same-machine
/benchmark-all --same-machine

Comment /benchmark to run the default dataset, or append any arguments accepted by ./benchmark.sh.
Comment /benchmark-long for an 8-vCPU run that defaults to 8 workers and has an eight-hour timeout.
Comment exactly /benchmark-all to start separate workflow runs and result comments for the default dataset plus srj18, srj19, srj20, srj21, and srj23.
Append --same-machine to /benchmark or /benchmark-all to compare current main and the PR head sequentially on the same 8-vCPU Blacksmith runner.

Everything after /benchmark or /benchmark-long is safely forwarded to ./benchmark.sh, except --profile-solvers, which enables profile comparison tables, and --same-machine, which enables the paired runner.
Examples: /benchmark --dataset 18 --sample-timeout 2000s, /benchmark --pipeline 7 --scenario-limit 20, /benchmark all 20 --concurrency 8, /benchmark --same-machine, /benchmark-all --same-machine, and /benchmark-long --dataset 18.

Use /update-snapshots (or /us) to run BUN_UPDATE_SNAPSHOTS=1 bun test --timeout 120_000 on the PR branch and auto-commit snapshot updates.
Use /usf to read recent failed test files, update and verify their exact CI test shards, and auto-commit only their snapshots. It uses the configured fast benchmark runner by default; use /usf --ubuntu-latest for GitHub-hosted x64 CI parity.

Any PR whose title contains [BENCHMARK TEST] will automatically run one default-dataset benchmark on PR updates; it does not post a PR result comment.

@seveibar

Copy link
Copy Markdown
Contributor Author

/benchmark --same-machine --dataset 18

@tscircuitbot

tscircuitbot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Same Machine Benchmark Results

Both revisions ran sequentially in one Blacksmith job on blacksmith-01m019et9y79cs6m3kdqdvfnbc-8vcpu.

Dataset: srj18 · Scenarios: 16
Main: 35f0116 · PR: 1627a35

Solver Metric Main PR Delta
Pipeline7 Completion 81.3% (🕒18.8%) 75.0% (🕒25.0%) -6.3 pp
Pipeline7 Relaxed DRC pass 43.8% (🕒18.8%) 37.5% (🕒25.0%) -6.3 pp
Pipeline7 Timeouts 3 4 +1
Pipeline7 P50 time 142.4s 151.9s +6.7%
Pipeline7 P60 time 204.8s 216.0s +5.5%
Pipeline7 P70 time 240.5s 269.9s +12.2%
Pipeline7 P80 time 352.9s 360.0s +2.0%
Pipeline7 P90 time 360.0s 360.0s 0.0%
Pipeline7 P95 time 360.0s 360.0s 0.0%
Pipeline7 Average vias 210.15 205.83 -2.1%

Outcome changes: 1 improved, 3 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster.

Changed outcomes (4)
Solver Sample Main PR Main time PR time Delta
Pipeline7 2 Solved (DRC failed) DRC passed 352.9s 259.6s Improved
Pipeline7 3 DRC passed Solved (DRC failed) 40.8s 37.3s Regressed
Pipeline7 5 DRC passed Solved (DRC failed) 33.1s 36.1s Regressed
Pipeline7 13 Solved (DRC failed) Timeout 239.4s 360.0s Regressed

Workflow: View run
Artifact: Download raw reports

@seveibar seveibar changed the title Enable hypergraph-native region optimization in Pipeline 7 Run hypergraph-native region optimization after every solve Aug 15, 2026
@seveibar

Copy link
Copy Markdown
Contributor Author

/benchmark --dataset 18 --same-machine

@tscircuitbot

tscircuitbot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Same Machine Benchmark Results

Both revisions ran sequentially in one Blacksmith job on blacksmith-01m01djnsvb2a815a1ye9npz9b-8vcpu.

Dataset: srj18 · Scenarios: 16
Main: 35f0116 · PR: 74c2905

Solver Metric Main PR Delta
Pipeline7 Completion 75.0% (🕒25.0%) 75.0% (🕒25.0%) 0.0 pp
Pipeline7 Relaxed DRC pass 43.8% (🕒25.0%) 43.8% (🕒25.0%) 0.0 pp
Pipeline7 Timeouts 4 4 0
Pipeline7 P50 time 147.5s 154.0s +4.4%
Pipeline7 P60 time 208.2s 208.1s -0.1%
Pipeline7 P70 time 241.9s 268.7s +11.1%
Pipeline7 P80 time 360.0s 360.0s 0.0%
Pipeline7 P90 time 360.0s 360.0s 0.0%
Pipeline7 P95 time 360.0s 360.0s 0.0%
Pipeline7 Average vias 181.83 205.67 +13.1%

Outcome changes: 1 improved, 2 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster.

Changed outcomes (3)
Solver Sample Main PR Main time PR time Delta
Pipeline7 2 Timeout DRC passed 360.0s 265.5s Improved
Pipeline7 3 DRC passed Solved (DRC failed) 45.0s 38.6s Regressed
Pipeline7 13 Solved (DRC failed) Timeout 234.2s 360.0s Regressed

Workflow: View run
Artifact: Download raw reports

@seveibar

Copy link
Copy Markdown
Contributor Author

/benchmark --dataset 18 --same-machine

@tscircuitbot

tscircuitbot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Same Machine Benchmark Results

Both revisions ran sequentially in one Blacksmith job on blacksmith-01m020zsvt0byrhptv6w65x9f5-8vcpu.

Dataset: srj18 · Scenarios: 16
Main: 35f0116 · PR: 45cc81c

Solver Metric Main PR Delta
Pipeline7 Completion 81.3% (🕒18.8%) 81.3% (🕒18.8%) 0.0 pp
Pipeline7 Relaxed DRC pass 43.8% (🕒18.8%) 50.0% (🕒18.8%) +6.2 pp
Pipeline7 Timeouts 3 3 0
Pipeline7 P50 time 140.2s 150.1s +7.1%
Pipeline7 P60 time 199.0s 202.2s +1.6%
Pipeline7 P70 time 242.6s 241.5s -0.5%
Pipeline7 P80 time 349.4s 271.4s -22.3%
Pipeline7 P90 time 360.0s 360.0s 0.0%
Pipeline7 P95 time 360.0s 360.0s 0.0%
Pipeline7 Average vias 210.15 206.92 -1.5%

Outcome changes: 1 improved, 0 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster.

Changed outcomes (1)
Solver Sample Main PR Main time PR time Delta
Pipeline7 2 Solved (DRC failed) DRC passed 349.4s 271.4s Improved

Workflow: View run
Artifact: Download raw reports

@seveibar
seveibar marked this pull request as ready for review August 15, 2026 07:15
@seveibar

Copy link
Copy Markdown
Contributor Author

/benchmark --dataset 18 --same-machine

@tscircuitbot

tscircuitbot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Same Machine Benchmark Results

Both revisions ran sequentially in one Blacksmith job on blacksmith-01m02xd0yjrdpqxa5m60amg9he-8vcpu.

Dataset: srj18 · Scenarios: 16
Main: 35f0116 · PR: efe68be

Solver Metric Main PR Delta
Pipeline7 Completion 81.3% (🕒18.8%) 81.3% (🕒18.8%) 0.0 pp
Pipeline7 Relaxed DRC pass 43.8% (🕒18.8%) 50.0% (🕒18.8%) +6.2 pp
Pipeline7 Timeouts 3 3 0
Pipeline7 P50 time 137.1s 152.7s +11.3%
Pipeline7 P60 time 199.6s 204.6s +2.5%
Pipeline7 P70 time 231.9s 251.4s +8.4%
Pipeline7 P80 time 346.3s 274.8s -20.6%
Pipeline7 P90 time 360.0s 360.0s 0.0%
Pipeline7 P95 time 360.0s 360.0s 0.0%
Pipeline7 Average vias 210.15 206.92 -1.5%

Outcome changes: 1 improved, 0 regressed. Timing percentiles include solved and timed-out samples; negative timing deltas are faster.

Changed outcomes (1)
Solver Sample Main PR Main time PR time Delta
Pipeline7 2 Solved (DRC failed) DRC passed 346.3s 271.1s Improved

Workflow: View run
Artifact: Download raw reports

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@github-actions

Copy link
Copy Markdown

This PR was closed because it has been inactive for 1 day since being marked as stale.

@github-actions github-actions Bot closed this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants