Skip to content

Repair fine-pitch BGA pad escapes with an incremental solver - #93

Open
seveibar wants to merge 10 commits into
mainfrom
fix/fine-pitch-pad-escape
Open

Repair fine-pitch BGA pad escapes with an incremental solver#93
seveibar wants to merge 10 commits into
mainfrom
fix/fine-pitch-pad-escape

Conversation

@seveibar

@seveibar seveibar commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Fine-pitch BGA escapes can remain blocked after ordinary bend and terminal repair. Export a shared incremental FinePitchPadEscapeSolver that searches local pad channels and, for remaining conflicts, bounded terminal-via escape candidates. Integration for both Pipeline7 and Pipeline9 is in tscircuit/tscircuit-autorouter#2389.

The consuming PR now routes the completely trace-free bugreport104 pedometer with 0 benchmark-relaxed DRC errors in both pipelines, compared with 45/36 on its previous revision and 32/31 on the independent main baseline. The consuming PR also aligns cleanup spacing objectives with the unchanged benchmark evaluator and corrects shared circular-pad taper sizing.

Solver behavior

  • Search nearby bend adjustments and open pad channels first.
  • For a remaining BGA conflict, try relocating the existing terminal-side via outside the pad. When another existing via bounds the adjoining span, also try alternate routing layers and bounded bridge geometries.
  • Do not add vias or move endpoints, marked intermediate ports, or fixed copper. Skip jumper/through-obstacle routes for terminal-via relocation. Check board-edge bounds and reject implicit via-in-pad placement, including same-net pads.
  • Accept candidates only if the caller's DRC evaluator reports fewer errors, or a lower clearance deficit at equal error count. The caller supplies the movable trace map and an evaluator that includes fixed copper.
  • Constructor performs no DRC/search work. The lazy search advances through _step() with at most one candidate/DRC evaluation per step; progress, statistics, visualization, and typed completed output follow the solver lifecycle. Pipelines call .step(), not .solve().

Pipeline7 runs this as a dedicated stage after exact repair. Pipeline9 steps it as an active child after terminal relocation and before regional repair. No pipeline-specific geometry code is required here.

Visual reproductions

Terminal-via escape: 3 errors → 0

This small four-layer BGA fixture shows why moving only intermediate bends is insufficient. The existing via moves closer to the terminal, shortening the outer-layer escape. Both endpoints and the unrelated inner-layer trace remain unchanged, and the via count stays at two. Red denotes top-layer copper, green inner1, yellow inner2, and blue circles vias; pads are drawn as circles.

Terminal-via escape before and after

bun test tests/terminal-via-escape.test.ts tests/terminal-via-escape-start.test.ts tests/terminal-via-escape-stepping.test.ts tests/terminal-via-escape-snapshot.test.ts --timeout 9999999

Original captured pad crossing: 1 error → 0

The matched close-up below uses the real pedometer capture. Blue is 0.10 mm trace copper, red is offending pad 34, green is terminal pad 33, and pale gray is the original 0.05 mm clearance envelope. White dots mark interior bends. This local-channel example does not move the via or terminal.

Pedometer BGA escape before and after repair

Only the display is cropped: DRC and repair use the entire captured route and all 21 pads. Run bun start and open the pedometer-bga-pad-escape Cosmos fixture for pan/zoom and step-by-step debugging.

Validation and dependency scope

  • 100 local tests pass, including both SVG reproductions, inert construction, one evaluation per step, failure propagation, reverse-direction escapes, and preservation of terminals, fixed routes, via count, and input data.
  • TypeScript checking passes; upstream CI's tests, typecheck, and formatcheck pass against current main as well.
  • The consuming autorouter's two complete trace-free pedometer solves reach zero under the standard benchmark-relaxed evaluator; their expensive tests remain test.skip when committed, with solved SVGs checked in.
  • The branch now incorporates the autorouter main branch's updated repair03 dependency (9d6da7d), retaining inclusive declared via-span checks and staged trace/via repair improvements. The exact consumed commit is 003e0391e70302b9c0dc83e49623ff8514ce1ee2.

@seveibar
seveibar requested a review from Abse2001 as a code owner September 5, 2026 03:23
@tscircuitbot

Copy link
Copy Markdown

Benchmark This PR

Run benchmarks by commenting on this PR:

/benchmark [benchmark.sh args...]
/benchmark [scenario-limit|all] --dataset <drc14|srj18> --concurrency <n> --effort <n> --max-iterations <n>

Everything after /benchmark is forwarded directly to ./benchmark.sh.

Examples:

  • /benchmark -> run default SRJ18 benchmark settings
  • /benchmark 10 -> run first 10 SRJ18 samples
  • /benchmark --dataset srj18 -> run all SRJ18 samples
  • /benchmark 1 --dataset srj18 -> run the first SRJ18 sample
  • /benchmark --dataset drc14 -> run all DRC14 samples
  • /benchmark all --concurrency 4 -> run all SRJ18 samples with 4 workers
  • /benchmark --scenario-limit all --effort 2 -> run all samples with effort 2
  • /benchmark --scenario-limit 20 --max-iterations 100 -> run 20 samples with a max iteration override

Any PR whose title contains [BENCHMARK TEST] will automatically run the benchmark workflow on PR updates.

@seveibar
seveibar force-pushed the fix/fine-pitch-pad-escape branch from 84f72d5 to b95b389 Compare September 5, 2026 03:36
@seveibar seveibar changed the title Repair fine-pitch BGA pad escapes with a shared repair pass Repair fine-pitch BGA pad escapes with an incremental solver Sep 5, 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.

2 participants