Skip to content

fix: Keep congested-port duplicates on their shared boundary - #191

Open
AnasSarkiz wants to merge 1 commit into
mainfrom
fix/greedy-final-route-hard-constraints
Open

AnasSarkiz wants to merge 1 commit into
mainfrom
fix/greedy-final-route-hard-constraints

Conversation

@AnasSarkiz

@AnasSarkiz AnasSarkiz commented Sep 15, 2026

Copy link
Copy Markdown
Member

Status: not ready to merge

The geometry-only candidate has downstream regressions. Of five focused autorouter tests, preloaded duplication and Sample006 pass; pedometer low effort completes routing but fails its SVG snapshot (21.740% difference), bugreport77 completes routing but has 98 relaxed-DRC errors (requires fewer than 94), and pedometer high density fails. Current autorouter main with its existing tiny-hypergraph pin passes bugreport77 unchanged using the same installed dependencies, confirming that DRC failure is a regression. Existing assertions and snapshots have not been changed. Keep the current merged pin while this candidate is unresolved; additional diagnostics are stopped.

Problem and fix

An isolated port shared by two rectangular regions is duplicated using a perpendicular between their centers. When the centers are offset, that direction leaves the shared edge. Reversing the incident regions can also reverse the duplicate direction, and short edges can be overrun by the fixed offset span.

Place these duplicates along the actual shared rectangle edge with a direction independent of incident-region order. Preserve the source coordinate perpendicular to the edge, reverse at the positive endpoint, and bound the group's span so the duplicates remain distinct and within the edge. Existing nearest-port and generic-geometry behavior is preserved.

The PR changes only duplicate placement and its regression tests. lib/core.ts and its single-layer cost tests match main exactly. The existing greedy completion behavior is preserved.

Validation

  • All five new geometry cases fail against the original placement implementation and pass with this fix; all three original duplicate-port tests pass in both versions.
  • 30 focused tests across eight files pass, including preloaded-assignment and closed-route serialization coverage.
  • Typecheck, formatting, and build pass. Formatting reports two existing oversized-fixture warnings.
  • Based on current main 7745c91a426a64227eb9b4a3e2c093c24b9f9808, preserving the latest fix already pinned in autorouter main.

Geometry-only candidate: b0481ce866f581c2fd81d2a0ec24bfda1d31d538. Exact downstream validation is recorded in tscircuit/tscircuit-autorouter#2586. Benchmarks remain with the requester.

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tiny-hypergraph Ready Ready Preview Sep 15, 2026 5:58pm UTC

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.
Every command runs current main and the PR head sequentially on the same Blacksmith machine, then reports their results side by side.

Examples:

  • /benchmark -> all committed completed SRJ18 Pipeline7 cases, core solver
  • /benchmark --limit 4 -> first four committed Pipeline7 cases
  • /benchmark --dataset srj18 --concurrency auto -> srj18 samples with runner CPU-count concurrency
  • /benchmark --sample sample003 -> one committed SRJ18 Pipeline7 case
  • /benchmark --dataset hg07 --limit 20 --solver poly -> first 20 hg07 samples with the poly solver
  • /benchmark --dataset hg07 --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
AnasSarkiz force-pushed the fix/greedy-final-route-hard-constraints branch from ea8202e to 9b61d75 Compare September 15, 2026 16:09
@AnasSarkiz AnasSarkiz changed the title fix: Prevent illegal single-layer crossings in greedy final routing fix: Enforce greedy crossing constraints and keep isolated ports on shared edges Sep 15, 2026
@AnasSarkiz
AnasSarkiz force-pushed the fix/greedy-final-route-hard-constraints branch from 9b61d75 to b0481ce Compare September 15, 2026 17:57
@AnasSarkiz AnasSarkiz changed the title fix: Enforce greedy crossing constraints and keep isolated ports on shared edges fix: Keep congested-port duplicates on their shared boundary Sep 15, 2026
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