autosetup: preprocessing watchdog — cancel cloud jobs stuck in prover preprocessing#84
Draft
shellygr wants to merge 1 commit into
Draft
autosetup: preprocessing watchdog — cancel cloud jobs stuck in prover preprocessing#84shellygr wants to merge 1 commit into
shellygr wants to merge 1 commit into
Conversation
Add a preprocessing watchdog to CloudProverRunner's wait loop. The prover's treeview carries an empty rules list for as long as the run is in preprocessing (scene construction, storage/pointer analyses, CVL typechecking); rules appear only once rule checking begins. A run whose preprocessing blows up therefore sits in RUNNING with no rules until the prover's global timeout, and autosetup burned its whole 150-minute per-job budget polling it. The watchdog piggy-backs on the existing 10s status poll: queue time is free, the clock starts on the first RUNNING observation, and after a grace period it probes the treeview at a bounded cadence. A non-empty rules list makes it dormant; probe transport errors self-disable it (restoring the old behavior); exceeding the budget cancels the job and classifies the result as a new distinct JobStatus.PREPROCESSING_TIMEOUT so that: - conf workarounds never retry an identical doomed job (on_job_problem guard) and the submission cache is dropped so a deliberate future run submits fresh, - sanity_summary.md shows a dedicated row instead of crashing on the missing job report of a cancelled job. Env knobs (0 budget disables): AUTOSETUP_PREPROCESSING_BUDGET_SECONDS (default 1800), AUTOSETUP_PREPROCESSING_GRACE_SECONDS (300), AUTOSETUP_PREPROCESSING_PROBE_SECONDS (90). Verified live against a production job stuck in preprocessing: cancelled and classified ~5.5 minutes after the budget window opened, with the job showing CANCELED on the cloud. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
A cloud job whose prover-side preprocessing (scene construction, storage/pointer analyses, CVL typechecking) blows up never produces rule results: it sits in
RUNNINGuntil the prover's global timeout (~2h). Autosetup's wait loop only polls the coarse job status, so it cannot distinguish this from a healthy long run and burns its entire 150-minute per-job budget — per job, several times per contract.Approach
The prover's
treeViewStatus.jsoncarries an emptyruleslist for the whole preprocessing phase; rules appear in it only once rule checking begins (verified against a live production job — note that the file itself is served early, so mere existence is not the signal). The newPreprocessingWatchdog(certora_autosetup/utils/preprocessing_watchdog.py) piggy-backs on the existing 10s status poll:RUNNINGobservation does;get_treeview_status;rules⇒ dormant forever (zero further overhead);JobNotFoundError= "not served yet", not an error; 3 consecutive transport errors self-disable the watchdog, restoring the old behavior byte-for-byte;PREPROCESSING_TIMEOUT.The result is classified as a new distinct
JobStatus.PREPROCESSING_TIMEOUT:on_job_problemskips conf workarounds for it (a preprocessing stall is not conf-fixable), so no identical job is resubmitted; the submission-cache entry is dropped so a deliberate future run submits fresh;sanity_summary.mdgets a dedicated row instead of crashing on the missing job report of a cancelled job (theget_job_reportcall is now also generally hardened).Env knobs:
AUTOSETUP_PREPROCESSING_BUDGET_SECONDS(default 1800;0disables),AUTOSETUP_PREPROCESSING_GRACE_SECONDS(300),AUTOSETUP_PREPROCESSING_PROBE_SECONDS(90). No CLI-surface change, no new dependencies.Testing
tests/test_preprocessing_watchdog.py— 15 tests: state machine (queue-time free, grace, probe cadence, dormancy, empty-rules-is-still-preprocessing, not-found vs error, self-disable), wait-loop integration with mocked POU (stuck ⇒ cancel+classify; rules appear ⇒ never cancelled; zero-budget ⇒ watchdog off), retry suppression, serialization round-trip, reporter rows.CANCELEDon the cloud, andPREPROCESSING_TIMEOUTwas returned (vs ~90 min of doomed polling before).pyright: 0 errors on all changed files.🤖 Generated with Claude Code