feat: specialized linear layout for decoupling capacitor partitions#60
Open
LuSrodri wants to merge 1 commit intotscircuit:mainfrom
Open
feat: specialized linear layout for decoupling capacitor partitions#60LuSrodri wants to merge 1 commit intotscircuit:mainfrom
LuSrodri wants to merge 1 commit intotscircuit:mainfrom
Conversation
When partitionType is 'decoupling_caps', bypass PackSolver2 and place capacitors in a centered horizontal row with configurable gap spacing (decouplingCapsGap ?? chipGap), sorted by chipId for determinism. This produces the clean layout shown in issue tscircuit#15 instead of the messy scattered arrangement from the generic packing algorithm. Adds 5 unit tests covering: row alignment, gap spacing, centering, single-cap edge case, and non-decoupling partitions unchanged.
|
@LuSrodri is attempting to deploy a commit to the tscircuit Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #15 — decoupling capacitors were being laid out by the generic
PackSolver2, which produces a messy scattered arrangement. This PR adds a specialized fast-path that places them in a clean centered horizontal row.Changes
lib/solvers/PackInnerPartitionsSolver/SingleInnerPartitionPackingSolver.ts_step()whenpartitionType === "decoupling_caps"createDecouplingCapsLinearLayout()private method:chipId(deterministic ordering)x=0, y=0decouplingCapsGap ?? chipGapy=0withccwRotationDegrees=0tests/PackInnerPartitionsSolver/DecouplingCapsLayout.test.ts5 new tests:
y=0decouplingCapsGapPackSolver2Test results
No regressions introduced.
/claim #15