Skip to content

Recover net labels that don't fit at their configured size - #807

Open
Priyanshubhartistm wants to merge 2 commits into
tscircuit:mainfrom
Priyanshubhartistm:fix-dropped-gnd-netlabel-atmega328p
Open

Recover net labels that don't fit at their configured size#807
Priyanshubhartistm wants to merge 2 commits into
tscircuit:mainfrom
Priyanshubhartistm:fix-dropped-gnd-netlabel-atmega328p

Conversation

@Priyanshubhartistm

Copy link
Copy Markdown

Summary

  • NetLabelPlacementSolver was silently dropping a net label group when a caller-specified netLabelWidth/netLabelHeight didn't fit anywhere near a cramped pin bracket (found via repro-atmega328p-missing-gnd-netlabel, where a netLabelHeight: 0.42 GND label had nowhere to go near U_MCU.3/U_MCU.5).
  • Added a size fallback tier: retry at the default label size, first at the caller's declared orientation, then any orientation only if that's still too tight.
  • Same silent-drop bug was already hiding in 7 other fixtures - this fix recovers all of them except one already-unrelated RP2040 case.
  • Replaced the atmega328p repro's snapshot-only test with a real assertion that the GND label exists.

Validation

  • bun run format:check
  • bunx tsc --noEmit
  • bun test (180 pass, 4 pre-existing skips, 0 fail)
  • Compared failedGroups/netLabelPlacements counts before vs. after across all 8 affected fixtures to confirm the change only turns failures into successes, never touches an existing placement

…r fit

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
…overed labels

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
schematic-trace-solver Ready Ready Preview Aug 12, 2026 7:28pm

Request Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regression !

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the trace looks bad here

@mohan-bee mohan-bee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see some bad regression

@Priyanshubhartistm

Copy link
Copy Markdown
Author

@mohan-bee right - recovering the GND label pushes VCC_3V3 into a spot that overlaps another label. Root cause is that label placement never checks against other already-placed labels, just chips/traces/text. Real fix for that touches ~21 other snapshots, so it's too big for this PR - will handle it separately.

@mohan-bee

Copy link
Copy Markdown
Contributor

@mohan-bee right - recovering the GND label pushes VCC_3V3 into a spot that overlaps another label. Root cause is that label placement never checks against other already-placed labels, just chips/traces/text. Real fix for that touches ~21 other snapshots, so it's too big for this PR - will handle it separately.

tbh that regression is so bad

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.

3 participants