Skip to content

fix: reject disconnected via route transitions - #232

Open
seveibar wants to merge 1 commit into
mainfrom
fix/reject-disconnected-via-transitions
Open

fix: reject disconnected via route transitions#232
seveibar wants to merge 1 commit into
mainfrom
fix/reject-disconnected-via-transitions

Conversation

@seveibar

@seveibar seveibar commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require every pcb_trace via route point to be immediately bracketed by wire points
  • keep the existing coordinate-alignment check and apply it to every valid via transition
  • verify that adjacent wires lie within the via's inclusive physical layer span, including inner-layer taps on full-stack through vias

Why

checkTracesAreContiguous previously inspected a via only when both neighboring route points were already wires. A malformed route such as wire -> via -> via -> wire therefore skipped validation entirely, even though no copper segment connects the two vias. The same blind spot allowed edge vias and layer-mismatched transitions through the shared routing checks.

This was reproduced while auditing the manufacturing output in tscircuit/quick-configure: an initially prepared USB-C fan-in path contained consecutive vias and would have exported without the intended bottom-layer copper.

The layer check treats from_layer / to_layer as the physical plated span. For example, a top-to-bottom via may legitimately connect adjacent top and inner1 wire points.

Validation

  • bun test — 184 pass, 0 fail
  • bunx tsc --noEmit
  • bun run build
  • focused regression coverage for valid reversed spans, inner-layer taps on through vias, consecutive vias, and wires outside a via's physical span

Comment thread tests/lib/check-traces-are-contiguous-via-transitions.test.ts Outdated
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