Skip to content

fix(optimizer): interrupt canceled direct HiGHS solves - #896

Merged
frahlg merged 1 commit into
masterfrom
agent/cancel-active-highs
Aug 11, 2026
Merged

fix(optimizer): interrupt canceled direct HiGHS solves#896
frahlg merged 1 commit into
masterfrom
agent/cancel-active-highs

Conversation

@frahlg

@frahlg frahlg commented Aug 11, 2026

Copy link
Copy Markdown
Member

What changed

  • Core sends a bounded cancel_request over a new Unix connection when a sent optimizer request loses its context.
  • The worker tracks active and queued request IDs, wakes canceled queue entries, and suppresses stale replies.
  • Direct HiGHS uses its user-interrupt API across the service and economic solves. Cancellation or deadline expiry wins over a concurrent solver error and never starts the CVXPY fallback.
  • The worker advertises the feature without a protocol bump. An old worker rejects the unknown frame without changing Core's original error path.

Why

#895 stopped stale work in Core, but the Unix sidecar still held its global solve lock until the native solver deadline. A newer plan could therefore wait behind work whose result Core had already discarded.

Scope

Active native interruption applies to direct HiGHS. CVXPY, CLARABEL, and Python model building still stop at their existing checkpoints or deadline; the worker still suppresses their canceled results. The process transport keeps its existing kill-on-cancel path.

Checks

  • make verify-all: 134 Python tests, all Go packages, Core↔Optimizer contract, Compose migration, full-stack e2e, vet/build, and Linux arm64/amd64 plus Windows amd64 cross-builds
  • go test -race ./internal/mpc
  • New Go Unix-transport tests repeated 20 times; cancel wire test repeated 100 times
  • Worker and direct-HiGHS cancellation groups repeated 50 times each
  • Two independent read-only reviews found no P0–P3 issues
  • git diff --check

Part of #885.

@frahlg
frahlg marked this pull request as ready for review August 11, 2026 09:40
@frahlg
frahlg merged commit 16ddcf8 into master Aug 11, 2026
14 checks passed
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.

1 participant