Skip to content

API for interrupting jobs - #357

Merged
ArquintL merged 1 commit into
masterfrom
stoppable-verification-server
Oct 30, 2026
Merged

ArquintL merged 1 commit into
masterfrom
stoppable-verification-server

Conversation

@ArquintL

@ArquintL ArquintL commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

This PR adds interruptVerification and interruptAstConstruction to VerificationServer. Clients of a plain ViperCoreServer can thus interrupt a single job without stopping the whole server. So far, only the LSP frontend could do this, via ViperServerService.stopVerification.

Gobra needs this API so that stopping a verification in Gobra-IDE also stops the backend. Without it, the ViperServer job and its prover processes keep running to completion and keep occupying one of the server's job slots.

  • Both methods return whether an active task has been interrupted. They do not discard the job: the job's message stream completes, and the job is cleaned up, once the interrupted task has finished tearing down.
  • The JobActor replies to stop requests with a typed StopProcessReply(interrupted, message) instead of a string.
  • Tests run with -Xss128m, as run does already. Otherwise, the new test's program overflows the stack of Silicon's worker threads on Linux.

This PR used to contain several bug fixes as well. They are now in separate PRs stacked on this one, to be merged in this order:

  1. API for interrupting jobs #357 (this PR): the interrupt API
  2. Fixes hangs and leaks when cancelling jobs #367: fixes hangs and leaks when cancelling jobs
  3. Stops prover processes when an interrupted verification tears down #368: stops prover processes when an interrupted verification tears down
  4. Lets the LSP frontend delegate job interruption to the interrupt API #369: lets the LSP frontend delegate job interruption to the interrupt API

🤖 Generated with Claude Code

@ArquintL
ArquintL requested review from rayman2000 and a lite review from Copilot August 17, 2026 07:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rayman2000

Copy link
Copy Markdown
Contributor

Looks like the test is failing deterministically, can you take a look?

@ArquintL
ArquintL force-pushed the stoppable-verification-server branch from e17cf70 to 0a27088 Compare August 20, 2026 05:37
@ArquintL

Copy link
Copy Markdown
Member Author

I've addressed the failing CI, polished the comments, and also unified the lifetime of AST & verification jobs. @rayman2000 could you please take another look?

@ArquintL

ArquintL commented Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

@rayman2000 In my own words, this PR adds interruptAstConstruction and interruptVerification to the VerificationServer trait and, thus, ViperCoreServer (which Gobra / Gobra-IDE) uses. Without this change, Gobra is unable to abort a verification job once submitted to ViperServer.
#367 & #368 address issues that have been identified around cancelling jobs and #369 changes ViperServer's LSP frontend (used by Viper-IDE) to use the new API introduced by this PR

Adds `interruptVerification` and `interruptAstConstruction` to
`VerificationServer` such that embedders of a plain `ViperCoreServer` (e.g.
Gobra) can interrupt a single job without stopping the entire server. So far,
only the LSP frontend's `ViperServerService.stopVerification` offered this.

The JobActor now replies to `StopProcessRequest`s with a typed
`StopProcessReply`, which tells askers whether a task has actually been
interrupted.

Tests now run with 128MB thread stacks, as `run` does already: the new test's
long-running program otherwise overflows the 1MB default stack of Silicon's
worker threads on Linux.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rayman2000
rayman2000 force-pushed the stoppable-verification-server branch from 23a7367 to e64f57e Compare October 30, 2026 11:14
@ArquintL
ArquintL enabled stacked auto-merge October 30, 2026 11:19
@ArquintL
ArquintL added this pull request to the merge queue Oct 30, 2026
Merged via the queue into master with commit 612ceff Oct 30, 2026
13 checks passed
@ArquintL
ArquintL deleted the stoppable-verification-server branch October 30, 2026 11:40
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.

3 participants