Skip to content

feat: Specialized linear layout for decoupling capacitors#36

Open
769066112-ops wants to merge 1 commit intotscircuit:mainfrom
769066112-ops:feat/decoupling-caps-linear-layout
Open

feat: Specialized linear layout for decoupling capacitors#36
769066112-ops wants to merge 1 commit intotscircuit:mainfrom
769066112-ops:feat/decoupling-caps-linear-layout

Conversation

@769066112-ops
Copy link
Copy Markdown

Summary

Implements a specialized layout algorithm for decoupling capacitor partitions as described in #15.

When SingleInnerPartitionPackingSolver encounters a partition with partitionType === "decoupling_caps", it bypasses the generic PackSolver2 packing algorithm and arranges the capacitors in a clean horizontal row instead.

Changes

lib/solvers/PackInnerPartitionsSolver/SingleInnerPartitionPackingSolver.ts

  • Early return in _step() for decoupling cap partitions
  • New createLinearDecouplingCapLayout() method:
    • Sorts caps by chipId for deterministic ordering
    • Spaces evenly using decouplingCapsGap (falls back to chipGap)
    • Centers the row at origin
    • All caps placed with 0° rotation

tests/DecouplingCapsLinearLayout.test.ts (new)

  • 3 tests: linear row layout correctness, custom decouplingCapsGap support, non-decoupling partition fallback to PackSolver2

Impact

Zero impact on non-decoupling partitions — the early return only triggers when partitionType === "decoupling_caps".

/claim #15

I have read the CLA Document and I hereby sign the CLA

…scircuit#15)

When SingleInnerPartitionPackingSolver encounters a partition with
partitionType === 'decoupling_caps', it bypasses PackSolver2 and
arranges caps in a clean horizontal row instead.

- Caps sorted by chipId for deterministic ordering
- Evenly spaced using decouplingCapsGap (falls back to chipGap)
- Centered at origin
- Zero impact on non-decoupling partitions

Adds 3 tests covering linear layout, custom gap, and non-decoupling fallback.
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 27, 2026

@769066112-ops is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

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