Skip to content

Fix congested-port duplication to count distinct nets - #151

Draft
ShiboSoftwareDev wants to merge 1 commit into
mainfrom
agent/fix-duplicate-ports-by-distinct-net
Draft

Fix congested-port duplication to count distinct nets#151
ShiboSoftwareDev wants to merge 1 commit into
mainfrom
agent/fix-duplicate-ports-by-distinct-net

Conversation

@ShiboSoftwareDev

Copy link
Copy Markdown
Contributor

Summary

  • count distinct electrical nets, rather than route segments, when measuring shared-port demand
  • avoid cloning ports for multiple MST segments that already share the same net ownership
  • retain one duplicate for each additional distinct net that needs the physical gateway

Root cause

TinyHyperGraphSolver assigns port ownership by NetId, so routes on the same net may legally share a port. DuplicateCongestedPortSolver instead incremented its use count once per independently solved route. On BGA fanouts, multiple MST segments of one net could therefore manufacture unnecessary duplicate ports and inflate topology size.

The regression uses two routes through the same choke. It fails before this change with portUseCounts["shared-choke"] === 2 and an extra port; with the fix, both routes map to one net owner and no duplicate is created. The existing two-distinct-net case still produces exactly one duplicate.

Verification

  • bun test --timeout 9999999 tests/solver/duplicate-congested-port-solver.test.ts

Full typechecking could not be reproduced in the linked checkout because the repository's Git-based benchmark datasets did not finish installing; the focused test compiles and passes.

@vercel

vercel Bot commented Aug 4, 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 Aug 4, 2026 11:31am

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.

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