Skip to content

fix: keep SI7021 shared-terminal branches together - #262

Open
YS-OH-CORE wants to merge 1 commit into
tscircuit:mainfrom
YS-OH-CORE:fix/si7021-shared-terminal-branches
Open

YS-OH-CORE wants to merge 1 commit into
tscircuit:mainfrom
YS-OH-CORE:fix/si7021-shared-terminal-branches

Conversation

@YS-OH-CORE

Copy link
Copy Markdown

Summary

Related to #12. Reflows two separate two-pin branches connected to distinct pins of a shared three-pin terminal as one coordinated group. It only applies after the generic inner-partition packer; unsupported topology or unsafe geometry retains the existing result.

This is an alternative to #260's single-component refinement, not a copy of that patch: the focus is preserving the paired branch structure and moving both branches with the shared terminal.

Original SI7021 fixture, unchanged input

Measured on main 32dad82 with Bun 1.4.2:

  • Total Manhattan distance of the five actual strong pin-to-pin edges: 5.9 → 3.9 (33.9% reduction).
  • Proper strong-edge crossings: 1 → 0.
  • U1 remains at (0, 0), rotation 0; C2 remains at (-2.03, 0), rotation 90.
  • R1/R2 become parallel at x=2, y=±0.45; SJ1 is centered at (3.3, 0).
  • Three fresh runs returned identical placements.

These are placement/straight-preview metrics, not a claim about final routed-wire correctness. Weak net connections and rail routing are outside this refinement.

Guards

  • Detects topology from pin connections, not reference names or added component-type flags.
  • Preserves fixed components and allowed rotations; uses the declared anchor pin side and actual rotation.
  • Checks component/pin envelopes including the requested gap; a zero gap never permits overlapping envelopes.
  • Rejects new strong-edge crossing pairs and new strong-edge/third-component body obstructions.
  • Keeps the anchor, unrelated components and input objects unchanged.

Validation

  • Untouched baseline: 110 passed, 1 skipped.
  • With this patch and 16 new regression checks: 126 passed, 1 skipped, 0 failed across 71 test files.
  • bunx tsc --noEmit: passed.
  • bun run build: passed.
  • Formatting of all three changed files: passed. The full local format command also flags the Windows CRLF checkout of untouched files; those unrelated files are not changed here.
  • Includes renamed components, reciprocal/false edges, four fixed-anchor rotations, restricted/fixed branches, blockers, an unrelated wire that would be covered by reflow, a tall-anchor pin-side case, and zero-gap clearance.

AI-assisted implementation and review, with local execution and visual inspection. Maintainer review and any bounty eligibility/payment remain unconfirmed.

Recognize the two-branch shared-terminal topology and retain the packed layout when clearance, fixed placement, allowed rotation, or strong-edge geometry would regress. Add 16 regression checks including SI7021 and obstruction guards.

AI-assisted implementation and validation.
@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
matchpack Ready Ready Preview Sep 11, 2026 4:24am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — c66d2579 Deployed Sep 11, 2026 by vercel[bot]
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.

1 participant