Skip to content

Add specialized linear layout for decoupling capacitor partitions (#15)#31

Open
AouIssa wants to merge 1 commit intotscircuit:mainfrom
AouIssa:linear-decoupling-cap-layout
Open

Add specialized linear layout for decoupling capacitor partitions (#15)#31
AouIssa wants to merge 1 commit intotscircuit:mainfrom
AouIssa:linear-decoupling-cap-layout

Conversation

@AouIssa
Copy link

@AouIssa AouIssa commented Feb 7, 2026

Problem

PackSolver2 scatters decoupling capacitors in messy irregular patterns instead of arranging them in clean horizontal rows like professional schematics.

Solution

Early-return in SingleInnerPartitionPackingSolver._step() when partitionType === "decoupling_caps" — bypasses PackSolver2 and arranges caps in a horizontal row via createLinearDecouplingCapLayout().

Zero impact on non-decoupling partitions.

Results

Two separate partitions arranged by voltage rail:

Partition 1 (V3_3 + GND): C12, C13, C14, C15, C19, C8 — all Y=-5.956, gaps exactly 0.2mm
Partition 2 (V1_1 + GND): C18, C7 — all Y=-1.953, gap exactly 0.2mm

Visual Proof

SVG snapshot tests included using bun-match-svg:

  • Full pipeline layout snapshot (all components)
  • Partition-only snapshot (just the decoupling cap row)

Demo video attached below.

Tests

  • 19 pass (17 existing + 2 new), 0 regressions
  • bun run format:check clean
  • tsc --noEmit clean

Addresses feedback from PRs #27 and #28 regarding visual snapshot testing.

/claim #15

decoupling-caps-demo.mp4

@vercel
Copy link

vercel bot commented Feb 7, 2026

@AouIssa is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

@AouIssa
Copy link
Author

AouIssa commented Feb 7, 2026

Before vs After

Partition comparison (PackSolver2 → Linear Row)

image

Full pipeline — Before (main branch)

image

Full pipeline — After (this PR)

image

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