Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emit JSON-serializable
pcbTracePathson localautorouting:endevents so CLI and browser consumers can save routes without walking live components, reading private placement methods, or diffing accumulated SRJ traces. Each array contains the current stage's copper and can be passed to the corresponding<autoroutingphase pcbTracePaths={savedPaths} />with the same phase options and placement.Core resolves port selectors and local coordinates, orders multi-terminal routes, and validates the complete array through the saved-path importer. Export and import share the placement transform. Unrepresentable output emits
pcbTracePathsUnavailableReasoninstead of partial paths or a routing error. Cached and precomputed results are covered. This is separate from the event-index correction in #4163.Performance
Generation is always on. On Apple M3 Pro / Bun 1.3.2, 100 iterations after 10 warmups measured:
The dense routing stage took ~3,744 ms; median export cost is ~0.034% of that duration. The exported JSON is 46,753 bytes. These small absolute costs support generating paths for every completed local stage. Measurements are warmed microbenchmarks, not a whole-render A/B test; worker transport and much larger boards may warrant further profiling. The synthetic case uses a simple custom router, so its routing duration is not used as a performance baseline.
Reproduce with
BENCHMARK_PCB_TRACE_PATHS=1 bun test tests/benchmarks/autorouting-phase-pcb-trace-paths.test.tsx. Details and limitations are indocs/autorouting-event-pcb-trace-paths.md.Replay parity
The dense RP2040 + flash + USB-C fixture routes 18 connections across crowded pads, obstacles, layers, and vias. A fresh circuit replays the JSON-serialized event paths without running the autorouter. Observed raster parity: 100% overall and 100% foreground, with zero differing pixels.
The test requires >=99.99% full-image and >=99.9% foreground parity, verifies trace/via counts, and removes a trace as a negative control. It includes this checked-in side-by-side SVG:
Fanout exports preserve saved escapes; the follow-up autorouter can choose different geometry for unsaved copper. The fanout test checks parity of the exported copper specifically. Jumper/through-obstacle segments and non-port junctions that cannot be represented by the saved-path API are reported explicitly.
Validation: 23 phase/cache tests pass (including the new parity, transforms on both layers, fanout, cache, and unsupported-output tests), benchmark passes, TypeScript checking passes, build passes, and changed-file formatting passes.
CI note: test shard 10 reports the same two existing routing DRC failures as #4163:
usb-c-breakout-net-pairandrepro-am62l-direct-decoupling-fanout. Both were reproduced on unchanged base commitf3adb5e, including AM62L's expected 48 / actual 51 trace errors. These baseline failures are not changed by this PR. Formatting, typecheck, smoke test, and the other completed shards pass.