Skip to content

Support async v5 solver steps in TscircuitAutorouter loop#2104

Closed
seveibar wants to merge 1 commit intomainfrom
codex/fix-pipeline5-iteration-limit-bug-nwtnwl
Closed

Support async v5 solver steps in TscircuitAutorouter loop#2104
seveibar wants to merge 1 commit intomainfrom
codex/fix-pipeline5-iteration-limit-bug-nwtnwl

Conversation

@seveibar
Copy link
Copy Markdown
Contributor

@seveibar seveibar commented Apr 5, 2026

Motivation

  • The v5 autorouter pipeline performs async work and exposes stepAsync(), and the existing synchronous loop could exhaust iterations while awaiting external promises.
  • The autorouter loop needs to await async solver steps when available to avoid spinning step() and hitting MAX_ITERATIONS limits.

Description

  • Added a stepSolver() helper that awaits solver.stepAsync() when present and falls back to solver.step() for synchronous solvers in lib/utils/autorouting/CapacityMeshAutorouter.ts.
  • Converted the internal cycle runner runCycleAndQueueNextCycle() to an async function and awaited stepSolver() inside the time-sliced loop, preserving progress events and scheduling behavior.
  • Ensured start() still has a void return and launches the async cycle runner without changing the public API surface.
  • Added a regression test tests/features/autorouter-version-v5-async-step.test.ts that monkey-patches the v5 solver with a fake async implementation and verifies stepAsync() is used (and step() is not).

Testing

  • Ran bun test tests/features/autorouter-version-v5-async-step.test.ts, and the test passed (1 pass, 0 fail).
  • Ran typecheck with bunx tsc --noEmit, which completed with no errors.
  • Ran formatter with bun run format, which completed successfully.

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

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

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment Apr 5, 2026 4:45am

Request Review

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

This PR was closed because it has been inactive for 1 day since being marked as stale.

@github-actions github-actions bot closed this Apr 9, 2026
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