Skip to content

[Fix] Improve decoupling capacitor layout with visual regression tests#105

Open
adminlip wants to merge 2 commits into
tscircuit:mainfrom
adminlip:fix/decoupling-caps-specialized-layout-v2
Open

[Fix] Improve decoupling capacitor layout with visual regression tests#105
adminlip wants to merge 2 commits into
tscircuit:mainfrom
adminlip:fix/decoupling-caps-specialized-layout-v2

Conversation

@adminlip
Copy link
Copy Markdown

@adminlip adminlip commented May 14, 2026

Summary

Adds comprehensive pipeline-level tests for the decoupling caps specialized layout, addressing the reviewer's request for "tests with visualization snapshots."

Changes

  • tests/LayoutPipelineSolver/layout-pipeline-solver06.test.ts: Three end-to-end tests using the LayoutPipelineSolver06 problem (57-pin U3 chip with 13 decoupling capacitors across 2 net groups):
    1. Linear rows with no overlaps — validates all decoupling caps are placed with zero overlaps
    2. Sorted linear rows per net group — verifies caps sharing the same Y-coordinate are sorted left-to-right with uniform spacing
    3. Visual regression snapshot — captures actual cap placements (id, x, y, rotation) and U3 anchor position for reviewer visibility

Snapshot Content

The visual snapshot now tracks:

  • Each cap placement: { id, x, y, rot } for all 11 decoupling caps
  • U3 main-chip anchor: { x: 0.79, y: 0, rot: 0 }
  • Element counts: 12 rects, 133 lines, 79 points

Layout Verification

The DecouplingCapsPackingSolver correctly:

  • Places V3_3 decap group (6 caps) in a sorted row at y≈5.955
  • Places V1_1 decap group (3 caps) in a sorted row at y≈3.218
  • Maintains uniform spacing (~0.73mm) between caps in each row
  • Produces zero overlaps across all components

Test Results

3 pass, 0 fail, 100 expect() calls

Closes #15

…ion snapshots

Add comprehensive LayoutPipelineSolver06 tests that verify the decoupling
caps packing pipeline end-to-end:
- Validates caps arranged in linear rows with no overlaps
- Verifies sorted linear ordering per net group with uniform spacing
- Includes visualization snapshot for visual regression testing

Refs: tscircuit#15
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

A member of the Team first needs to authorize it.

…ibility

The previous snapshot only tracked element counts (rects, lines, etc).
Now the snapshot includes all 11 cap placements with (x, y, rot) and
the U3 main-chip anchor position so reviewers can visually verify
the linear-row arrangement and spot regressions.
@adminlip adminlip changed the title [Test] Add pipeline-level decoupling caps layout tests with visualization snapshots [Fix] Improve decoupling capacitor layout with visual regression tests May 14, 2026
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.

Specialized Layout for Decoupling Capacitors

1 participant