fix: propagate routing progress and cancellation through circuit wrappers - #3716
Open
seveibar wants to merge 2 commits into
Open
fix: propagate routing progress and cancellation through circuit wrappers#3716seveibar wants to merge 2 commits into
seveibar wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
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.
Fanout routing used a blocking
solve()call, while a stopped capacity router could resume an outstanding async step and publish stale progress or completion. Fanout now advances in bounded slices; both wrappers guard their run lifecycle, yield to the event loop, and report actual step progress. Intermediate fanout graphics use the lightweightpreview()API; the full visualization is generated only at completion.Add
renderUntilSettled({ signal })andcancelRendering(reason)so cancellation reaches local routing phases, remote requests/polling, and isolated subcircuits. Aborted phases cannot publish results or start subsequent phases. Isolated circuits forward routing/solver events withisolatedSubcircuitPath, preserving local Circuit JSON IDs while distinguishing concurrent render contexts.Cancellation is cooperative between solver steps. A canceled Circuit is terminal; callers create a new Circuit to restart. Remote cancellation stops client requests and polling, without deleting an already submitted server job. The README documents the API and event scope.
Companion CLI integration: tscircuit/cli#4632 forwards routing timeouts to the new API and tracks concurrent isolated progress separately.
Validation:
bunx tsc --noEmit,bun run build, formatting, andgit diff --checkpassed.CI note: the initial run's
test (5)fails the existingrepro-am62l-lpddr4-progressive-fanout.test.tsxDDR clearance assertion. The exact base commitd696a754932bb0c15fdcb42c4577d28afb175600already has the same failing CI job. Its emitted DRC error diff matches this PR's failure exactly (1,721 compared diff lines after removing timestamps). Independent local runs of both the baseline and final lightweight-preview implementation reproduced the same 93 trace-clearance errors, with identical 1,595-line error arrays. This PR does not alter that board geometry issue.