Skip to content

Add same-net trace segment alignment cleanup#406

Open
JorisViaudQuantAI wants to merge 2 commits into
tscircuit:mainfrom
JorisViaudQuantAI:same-net-trace-alignment-cleanup
Open

Add same-net trace segment alignment cleanup#406
JorisViaudQuantAI wants to merge 2 commits into
tscircuit:mainfrom
JorisViaudQuantAI:same-net-trace-alignment-cleanup

Conversation

@JorisViaudQuantAI
Copy link
Copy Markdown

/claim #29
/claim #34

Summary

  • Adds an aligning_same_net_segments phase after untangling and before turn minimization.
  • Aligns close interior same-net horizontal and vertical segments to the longer segment's fixed coordinate, then simplifies the moved path.
  • Leaves different nets and endpoint segments unchanged so pin attachments are preserved.

Tests

  • npx bun test tests\solvers\TraceCleanupSolver\align-nearby-same-net-trace-segments.test.ts
  • npx bun test tests\solvers\TraceCleanupSolver
  • npx biome check lib\solvers\TraceCleanupSolver\TraceCleanupSolver.ts lib\solvers\TraceCleanupSolver\alignNearbySameNetTraceSegments.ts tests\solvers\TraceCleanupSolver\align-nearby-same-net-trace-segments.test.ts
  • npm exec --package typescript@5.9.3 -- tsc --noEmit

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

Project Deployment Actions Updated (UTC)
schematic-trace-solver Ready Ready Preview, Comment May 22, 2026 8:47am

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddee3e61af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/solvers/TraceCleanupSolver/alignNearbySameNetTraceSegments.ts
@JorisViaudQuantAI
Copy link
Copy Markdown
Author

Follow-up b335495 addresses the review concern about moving traces into forbidden space: the alignment phase now rejects candidate moves that increase intersections with chip obstacles, other-net trace obstacles, or other-net label bounds. I also added a regression test for that guard and updated the two example snapshots where same-net alignment is the intended visual change.

Local validation after the fix:

  • npx --cache .npm-cache bun test -> 64 pass, 4 skip, 0 fail
  • npx --cache .npm-cache biome check ...
  • npm exec --cache .npm-cache --package typescript@5.9.3 -- tsc --noEmit

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.

1 participant