Skip to content

gdsii follow-ups: balanced union tree, 2D layer union, import examples#394

Merged
ecto merged 3 commits into
mainfrom
claude/gdsii-union
Jul 3, 2026
Merged

gdsii follow-ups: balanced union tree, 2D layer union, import examples#394
ecto merged 3 commits into
mainfrom
claude/gdsii-union

Conversation

@ecto

@ecto ecto commented Jul 3, 2026

Copy link
Copy Markdown
Owner

#387's squash landed at the as_chunks commit and missed the last three commits on the branch. This recovers them, cherry-picked onto main:

  • Balanced union tree in the IR bridge (was a left-nested chain — 38k deep on a real die's li1 layer, overflowing recursive consumers' stacks) + 1000-instance depth regression test.
  • 2D layer union before extrusion (geo BooleanOps, optional dep behind the default vcad-ir feature): each layer becomes one solid per connected island, holes via Difference, islands disjoint by construction. Merged-geometry semantics tests included. Die-scale union ≈ 4.5 s; document shrinks 183 → 105 MB.
  • sky130_import / flat_import examples — the harnesses used to validate against a real librelane die (104,663 polygons, 17 layers), with a µm window-crop mode for detail renders.

41 → 43 tests, clippy -D warnings clean on stable and nightly.

🤖 Generated with Claude Code

ecto and others added 3 commits July 3, 2026 11:32
A real librelane-produced sky130 die (104k polygons) exposed that the
bridge folded each layer's extrudes into a left-nested Union chain —
tens of thousands deep, which overflows the stack of any recursive
document consumer (vcad-render aborted). Union pairwise into a balanced
tree instead (depth ~log2 n) and add a 1000-instance depth regression
test. Also add the sky130_import example used to validate against real
foundry GDS.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Each layer's raw polygons (tens of thousands of abutting rects on a
real die) are now merged with pure-Rust geo BooleanOps before any
extrusion: one sketch+extrude per connected island, interior holes as
a Difference per island, islands unioned via the cheap disjoint path.
The layer parts become topologically true solids — abutting cell
geometry is genuinely one face — instead of 88k stacked prisms, and
the 3D boolean pipeline only ever sees hole subtraction. Die-scale 2D
union costs ~4.5 s at import; the document shrinks 183 MB → 105 MB.

Adds merge-semantics tests: overlapping rects yield one extrude and
zero unions; an abutting picture-frame ring yields exactly two
extrudes and one Difference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WINDOW="x0,y0,x1,y1" (µm) crops to a die region, clamping crossing
polygons to the window edge (cleaved-die look) — how you get a usable
detail render out of a 100k-polygon die.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vcad-mcp Building Building Preview, Comment Jul 3, 2026 4:32pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
mecheval Ignored Ignored Jul 3, 2026 4:32pm
vcad Ignored Ignored Jul 3, 2026 4:32pm
vcad-docs Ignored Ignored Jul 3, 2026 4:32pm

Request Review

@ecto ecto merged commit 1b21171 into main Jul 3, 2026
12 checks passed
@chojiai

chojiai Bot commented Jul 3, 2026

Copy link
Copy Markdown

What shipped

This is a purely internal change with no user-visible effect. It improves how chip layout files are processed behind the scenes — merging overlapping shapes before building the 3D model, fixing a crash risk on large designs, and adding developer tooling for validation — but does not change any feature, output, or behavior that users interact with directly.


Plain-English summary generated by Choji from this pull request.

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.

1 participant