Skip to content

feat: integrate overlap resolution solver with voltage-aware biasing#37

Open
769066112-ops wants to merge 1 commit intotscircuit:mainfrom
769066112-ops:fix/layout-overlap-resolution
Open

feat: integrate overlap resolution solver with voltage-aware biasing#37
769066112-ops wants to merge 1 commit intotscircuit:mainfrom
769066112-ops:fix/layout-overlap-resolution

Conversation

@769066112-ops
Copy link
Copy Markdown

Summary

Fixes #12 - Improves layout by integrating the existing OverlapResolutionSolver into the pipeline and enhancing it with voltage-aware biasing.

Changes

Pipeline Integration

  • Added OverlapResolutionSolver as a new pipeline phase after PartitionPackingSolver
  • Updated getOutputLayout() to prefer the overlap-resolved layout
  • Updated visualize() and preview() to show resolved layout

Overlap Resolution Improvements

  • Voltage-aware biasing: VCC-connected chips are biased upward, GND-connected chips biased downward, following conventional schematic conventions
  • Force damping: Progressive damping over iterations for stable convergence
  • Layout re-centering: After resolution, the layout is re-centered around the origin
  • Performance caching: Connected pairs and chip-net mappings are cached to avoid redundant computation

Tests

  • Added test verifying overlap resolution phase integrates into the pipeline and produces zero-overlap layouts
  • Added test verifying voltage biasing correctly positions VCC caps above GND caps

How It Works

The solver runs a force-directed algorithm:

  1. Repulsion: Overlapping chips are pushed apart along the axis of minimum overlap
  2. Attraction: Strongly connected chips are pulled together to keep the layout compact
  3. Voltage bias: Chips connected to positive voltage nets get a gentle upward force; ground-connected chips get a downward force
  4. Damping: Forces are progressively damped for convergence stability
  5. Re-centering: Final layout is centered at the origin

All existing tests continue to pass.

…scircuit#12)

- Integrate OverlapResolutionSolver as a new pipeline phase after PartitionPackingSolver
- Add voltage-aware biasing: VCC-connected chips biased upward, GND-connected downward
- Add force damping for stable convergence during overlap resolution
- Re-center layout after overlap resolution for clean output
- Cache connected pairs and chip-net mappings for performance
- Add tests for overlap resolution integration and voltage biasing
@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Propose/implement a solution to bad layout

1 participant