Skip to content

Reroute component-to-component traces around avoidable label-trace crossings - #1013

Merged
MustafaMulla29 merged 11 commits into
mainfrom
fix/post-label-cross-net-crossings
Sep 2, 2026
Merged

Reroute component-to-component traces around avoidable label-trace crossings#1013
MustafaMulla29 merged 11 commits into
mainfrom
fix/post-label-cross-net-crossings

Conversation

@MustafaMulla29

@MustafaMulla29 MustafaMulla29 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Root cause

Component-to-component traces are routed before generated net-label connectors are added to the pipeline. A later connector can therefore cross an already-routed component trace even when that component trace has an equally short clean corridor.

Crossings between two generated label connectors are valid and remain unchanged.

Solution

  • track generated connector IDs explicitly instead of matching trace ID strings
  • retain provenance for traces produced by the original component-routing pass
  • after connectors exist, inspect only crossings between a fixed generated connector and an eligible component trace
  • reuse the existing generatePerpendicularTraceDetours routing primitive, extended with optional bounds so an attached label and its connector form one obstacle
  • accept only candidates that are no longer than the original route, preserve the turn budget, and avoid components, text, foreign labels, coincident traces, and all foreign-trace intersections

The previous standalone 331-line candidate generator has been removed. The cleanup now uses a compact coordinator around the existing routing primitive.

Result

  • the wireless-mouse component trace takes the available collision-free corridor
  • generated connectors never move
  • label-to-label crossings remain allowed
  • routes without an equally short safe alternative remain unchanged
  • exactly one visual snapshot changes

Verification

  • focused coverage for a clean component route, an allowed label-to-label crossing, and rejection of a longer detour
  • wireless-mouse and TI power-output repro snapshots
  • bun test --timeout 20000 — 297 passed, 4 skipped, 0 failed
  • bunx tsc --noEmit
  • bun run format
  • git diff --check

@vercel

vercel Bot commented Sep 1, 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 2, 2026 5:24am UTC

Request Review

@MustafaMulla29 MustafaMulla29 changed the title Fix generated net-label connector crossings Route generated net-label crossings through clean corridors Sep 1, 2026

@imrishabh18 imrishabh18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use string matching hack's

Comment thread lib/solvers/TraceCleanupSolver/rerouteGeneratedNetLabelConnectorCrossings.ts Outdated
@MustafaMulla29
MustafaMulla29 force-pushed the fix/post-label-cross-net-crossings branch from 2a966c0 to 1844666 Compare September 1, 2026 14:45
@MustafaMulla29 MustafaMulla29 changed the title Route generated net-label crossings through clean corridors Reroute component-to-component traces around avoidable label-trace crossings Sep 1, 2026
…net-crossings

# Conflicts:
#	lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts
#	lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts
@MustafaMulla29
MustafaMulla29 merged commit 76078e6 into main Sep 2, 2026
5 checks passed
@MustafaMulla29
MustafaMulla29 deleted the fix/post-label-cross-net-crossings branch September 2, 2026 05:25
@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