Skip to content

fix: propagate routing progress and cancellation through circuit wrappers - #3716

Open
seveibar wants to merge 2 commits into
mainfrom
fix/autorouter-progress-cancellation-20260907
Open

fix: propagate routing progress and cancellation through circuit wrappers#3716
seveibar wants to merge 2 commits into
mainfrom
fix/autorouter-progress-cancellation-20260907

Conversation

@seveibar

@seveibar seveibar commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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 lightweight preview() API; the full visualization is generated only at completion.

Add renderUntilSettled({ signal }) and cancelRendering(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 with isolatedSubcircuitPath, 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:

  • 60 autorouting utility tests passed, including async stop/restart, callback cancellation, progress, and failure regressions.
  • 69 root-circuit, subcircuit, and cancellation integration tests passed; one existing test skipped.
  • Separate sibling/nested isolated event-scope regression passed.
  • Existing fanout, single-layer, plane-termination, sequential-phase, remote-routing, and isolated-render regressions passed.
  • bunx tsc --noEmit, bun run build, formatting, and git diff --check passed.

CI note: the initial run's test (5) fails the existing repro-am62l-lpddr4-progressive-fanout.test.tsx DDR clearance assertion. The exact base commit d696a754932bb0c15fdcb42c4577d28afb175600 already 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.

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tscircuit-core-benchmarks Ready Ready Preview Sep 7, 2026 10:57pm UTC

Request Review

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant