Skip to content

Shorten same-side rails to outward net-label columns - #1215

Merged
mohan-bee merged 7 commits into
tscircuit:mainfrom
hrithik18k:fix/generalize-shared-net-rail-routing
Sep 19, 2026
Merged

mohan-bee merged 7 commits into
tscircuit:mainfrom
hrithik18k:fix/generalize-shared-net-rail-routing

Conversation

@hrithik18k

@hrithik18k hrithik18k commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Motivation

Prefer the shortest valid shared-net route so generated schematics stay compact, clear, and easy to follow.

Issue

A same-side pin pair can be routed through a long U-shaped loop even when an existing outward net-label column provides a shorter valid vertical path. This creates unnecessary wire length and makes the connection harder to read.

Fix

  • detect the internal return rail in same-side orthogonal routes of any length when an outward vertical net label is present
  • move the shared vertical rail onto the nearby label column when doing so shortens the route
  • limit the adjustment to a small local shift and preserve unrelated routes
  • keep perpendicular crossings as crossings without creating junctions
  • update the existing repro snapshot to show the before/after routing difference

Testing

  • bun test --timeout 30000 (407 pass, 4 skip, 0 fail)
  • bunx tsc --noEmit --pretty false
  • git diff --check

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
schematic-trace-solver Ready Ready Preview Sep 18, 2026 6:01am UTC

Request Review

@hrithik18k hrithik18k changed the title Generalize vertical rail placement for same-side pin pairs Shorten same-side rails to nearby net-label columns Sep 17, 2026
@hrithik18k hrithik18k changed the title Shorten same-side rails to nearby net-label columns Shorten same-side rails to outward net-label columns Sep 17, 2026
Comment thread lib/solvers/SameNetJunctionAlignmentSolver/shortenSameSideRailToLabelAnchor.ts Outdated
@mohan-bee
mohan-bee merged commit da8796a into tscircuit:main Sep 19, 2026
5 checks passed
@hrithik18k
hrithik18k deleted the fix/generalize-shared-net-rail-routing branch September 19, 2026 09:39
@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

4 participants