Repository navigation
feat(eval): recover from saved evidence with explicit gate results - #5343
Conversation
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — one BLOCKER and twelve RISK findings remain in the recovery and gate paths.
Reviewed all seven changed files and traced the affected rollout producers, cache loader, Slurm dispatch/prologue, aggregate-metrics writer, quality-summary producer, and executor fallbacks. Several new fixtures differ from the production artifact layout, concealing answer regeneration and score-reading failures. This was a static review: tests, scheduler commands, and end-to-end acceptance were not executed. Suggested code below must be verified before adoption.
NOTE — document the public recovery workflow. The new controls in the CLI have no corresponding user guide; the resumable-runs guide only explains automatic chaining. Please add a minimal working recovery example after correcting the score selector, explain the separate dispatch ok and gate acceptance results, and document health criteria, MLflow observations, supported Slurm/resumable scope, and unsupported saved-answer rejudging. Preserve the documented ordinary resubmit behavior rather than implying it shares recovery's budget policy. Acceptance is a static check that the example matches the corrected artifact format and that users can distinguish SUCCESS, RUNNING, RESUMING, FAILED, and unsupported outcomes. The pinned rubric explicitly requires documentation for notable user-facing features.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
/ok to test b221fcb |
…e-judge pass may re-verify A collection limit counts tasks, while reverify reads limit as the largest number of rows to re-verify. The automatic re-judge after collection and the judge-only job kept the run's limit, so a run collected with a limit re-judged at most that many rows per pass and never reached the rest. Both now drop it with the other collection-only settings. Tests cover the automatic pass (a run collected with limit 4 re-judges all 10 due judge failures) and both judge-only job paths. Signed-off-by: Adam Rajfer <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
/ok to test 7b75045 |
… a run Before submitting: the server spin-up limit (default 600 s) covers dependency installation and model loading, so raise it for a large model, a fresh install or a loaded cluster. A spin-up timeout is an infra stop that leaves rows untouched and is never scored as zero; the chain waits for a recover with a raised limit. Judge-only re-judges take the judge key and the other forwarded credentials from the environment of the dispatching shell, so export the valid key there before dispatching. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
…ith the serve extra A container without the ray CLI installed `ray[default]` unpinned before `ray start` and the Serve gateway. The gateway imports `ray.serve`, whose dependencies the `default` extra does not declare, and an unpinned install takes the newest Ray. With a Ray release whose Serve import needs a package outside `default`, every start-up of such a policy service fails the same way at the gateway's import. Install `ray[default,serve]==2.59.0` instead. A container that ships its own Ray is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
…d-evidence One conflict, in resources_servers/swebench_pro/app.py, where both sides added code at the same place: this branch's transport retries for the patch capture, and main's task network policy. The resolution keeps both unchanged, and the import line carries the names both use. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test e00a3f7 |
Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test 365ce5e |
giuliolovisotto
left a comment
There was a problem hiding this comment.
Re-reviewed 365ce5e28. Both findings from my previous review are addressed: invalid judge outcomes no longer count as healthy, and exported trial rates use the gate's omission-adjusted denominator. The five focused health/recovery suites passed (439 tests), and I replayed both earlier probes.
I found no major blocker in the paths reviewed. I'm comfortable landing this with the following two fixes tracked as follow-ups:
-
An unrelated masked row can prevent explicit recovery. In
_decide_from_collected, unknown accounting is recognized by exact equality against the displayed reason.decision()appends a masked-artifact warning to that reason, breaking the comparison. Reproduced with one scored row, one masked row retaining an answer but no gradeable artifact, one missing row, an unreadable retry counter and an explicitOperatorBudget: it returnsSTOP, with no operator continuation. Removing the masked row returnsRESUBMIT. Please represent the stop reason independently of display text and add this combined regression case; the masked row should remain retained while the missing row can resume. -
Health preparation removes group-read access from existing artifacts.
atomic_jsonreplaces the aggregate andquality_summary.jsonwithNamedTemporaryFilefiles. Reproduced both changing from0664to0600, so readers using group access lose access after export. Please preserve the existing file mode before replacement and test it.
Broader producer coverage, all-failure-event aggregation and further policy migration can remain incremental. This was a focused code/test review, not a full live Slurm or MLflow qualification.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41822900928 |
|
Thanks Giulio, both are fair and both are small. I'll take them as one follow-up PR right after this lands: the recovery stop reason represented on its own (not matched against the display text) with the combined masked + missing + budget regression test, and atomic_json keeping the file's existing mode instead of the NamedTemporaryFile 0600, with a test. Tracking them so they don't get lost. |
|
@AdamRajfer — I finished checking the remaining review cases against the merged head (
One additional finding, [P2] clear or bind attempt extensions when starting a fresh run: Could we carry these remaining fixes into a focused follow-up? I also checked #5594 and #5596; their current changes do not address these cases. The later stack inherits them, so I have kept the findings here with the original implementation and discussion. |
|
@yuhezhang-ai the attempt-extension one is fixed in #5601 (ef4699d): a fresh run now removes |
Decide RETRY / RESUBMIT / REVERIFY / NOOP / STOP for a saved evaluation run from its persisted evidence, with retry budgets, acceptance gates and export acknowledgements. This PR consumes the typed failure observations of #5072, which has merged; its diff against main is the recovery layer only. It is based on main after #5536 and #5542, and uses the failure modules at their new locations (
nemo_gym/core/,nemo_gym/utils/).What it does
Recovery from saved evidence:
gym eval resubmit <id> <benchmark> --recover(with--inspectto read only) collects the run's identities, saved results, failure records, quality summary and the chain's stored budgets, and decides one action:fresh-restartwith the command to queue it again.--inspectdispatches and writes nothing; the command prints one JSON line and exits 0 only when the gate readsSUCCESS, so an inspection with work planned exits 1.Budgets are spent, never reset. Infra retries, walltime, the per-rollout attempt cap and the server spin-up limit are raised only by explicit, journaled options:
--extend-retries,--extend-attempts,--max-walltimewith--walltime-reason, and--server-spinup-timeout-secondswith--spinup-timeout-reason. A run whose chain accounting is unknown can continue as an operator continuation that fills only the unreadable counters; an explicit--extend-retriesstill raises a readable spent count. Plaingym eval resubmitwithout--recoverkeeps its explicit-reset behaviour.The job chain's guard (diagram 1) continues, retries on an infrastructure cause named by the scheduler, or stops and writes why to
.gym_chain_incomplete. The typed stops:reached max_walltime cap, or less than one minute left), continued with--recover --max-walltime;--recover, budgets carried over;FAILED,OUT_OF_MEMORYorDEADLINEwithout an infrastructure cause, decided by the saved evidence;server_spinup_timeout,driver_install_failed(first error line quoted),collection_resume_refused,provider_credentials_rejected, each with its remedy;server_start_failedin aFAILEDjob before any rollout was saved: the run restarts fresh once, as one infra retry; a second such failure or a spent budget stops with "fresh restart exhausted" and the fresh resubmit command;follow_up_submission_refused, with sbatch's exit code and error lines): nothing was queued, accounting is known, continue with--recover; a lost or ambiguous reply stays unknown accounting;The chain ends itself. Each follow-up gets an
afteranysentinel that takes over only if the follow-up dies before its prologue. A job that completes the run cancels its sentinel and follow-up and journals the end inchain-end-journal.jsonl; a stop recorded earlier (a refused follow-up, unknown accounting, the cap) is superseded and journaled asrun_complete_stop_superseded. A driver that exits 76 (nothing eligible for retry) writes theno_eligible_retrystop and cancels its own follow-up, unless it left a kind the next guard stops on.Re-judging saved answers:
gym eval reverifysettles re-graded answers into the source run under a receipt. A GPU-served run that serves only its policy gets a CPU judge-only job (--judge-partition,--judge-qos); a run that serves its judge on a node pool of its own gets the job on that pool. A collection--limitno longer caps the rows a re-judge pass may re-verify (verified live: after the fix a judge-only re-judge of a limited run re-judged every due row in one pass). Re-verification of judge-failed rows is performed only for environment servers that declare a stateless verify; for servers that do not declare it, such rows stay masked (never scored as zero) and the judge-only job reports them as not re-verified, while the recovery plan still lists them under re-verify. The planner check and the declarations for the stateless judge servers follow in a separate PR.Acceptance gate: a gate summary with response and trial health over the expected trials. Evaluation-side faults are judged against a fixed 2% limit, model failures are reported but never fail health, masked rows are listed as "completed but not measured", and metric coverage and MLflow delivery are reported as facts. Trials are observed from the run's own grading evidence (bound grading operations, saved verifier output, a self-grading agent's reward), never inferred; an unobserved trial makes the gate
UNVERIFIED, not healthy.Per-task coverage: the reward profile keeps a row for a task none of whose rollouts was saved (
num_rollouts: 0, expected and missing counts, 0% completion), so a partial run's per-task report no longer lists fewer tasks than its inventory. Scores are unchanged.Operator tooling: Store readers run on the run's pinned revision, optionally in a Slurm step (
NEMO_GYM_REMOTE_READER_*); a run can be repinned to a newer commit (--repin, or automatically when the plan needs the installed revision,--no-auto-repinto refuse); resume fingerprints ignore settings added later with a default; a chain whose job ids the scheduler has purged is judged from accounting, so export and re-judge are not blocked;--run-dirrestores a lost job-index entry from the run's own record, and--recordinspects without the index.Docs and skills: the resume, resumable-runs, job-records, CLI and API reference pages, and two public skills,
run-and-babysit-eval(from a run's state to the one action) andadd-model-eval-config(serving a new model for evaluations), plus failure-handling conformance for new benchmarks inadd-benchmarkandadd-harness.Review guide
nemo_gym/orchestration/(recovery, resume script, chain guard shell, collect_evidence): the decision layer; start with the typed stops and the--recover/--inspectpath described below.fern/.../orchestration/how-to/resumable-runs.mdxandfern/.../reference/cli-commands.mdx: the user-facing contract (typed stops, chain-end journal, the walltime budget rule, the fullgym eval resubmitoption table)..agents/skills/run-and-babysit-evaland.agents/skills/add-model-eval-config: the operator path; both are checked command-by-command against--helpat this head.tests/unit_testsat this head and at the main commit it merges.Behaviour changes to note
These are on by default; a user who changes no configuration sees them.
Recovery and re-judging
rollouts.jsonlin place, writes areverification/auto-<time>-<id>/directory and re-aggregates the metrics. A failure in this pass is logged and never fails the run; arequire_completerun that used to fail can now pass. There is no switch to turn it off yet.PLANNED(so--inspectexits 1) until the re-judge settles it; evaluation health still counts the row as an evaluation-side fault.masked_retryablein coverage). A masked result that keeps a saved answer stays the result.Resumable chains
FAILED,OUT_OF_MEMORYandDEADLINEno longer retry. They used to count one retry and resume; they now stop, and the saved evidence decides.PREEMPTED,NODE_FAILandBOOT_FAILnow count againstmax_retries(they used not to).sacctreply is retried 6 times, 10 s apart, then stops the chain (it used to resume), so a scheduler whose accounting lags more than about a minute stops chains that used to continue; an unreadable or unobserved follow-up claim stops the chain (it used to be replaced); a follow-up whose submission reply was lost is never queued again blindly. The log line names the continuation (gym eval resubmit --recover --max-walltime ... --walltime-reason ..., plus--extend-retrieswhen retries are spent).server_start_failed,follow_up_submission_refused, exit 76 ending its own chain, the sentinel job per follow-up, and the finishing job cancelling its follow-up and sentinel.max_walltimebefore services start, which needsscontrolpermission to read and decrease it; failure stops the job before any work.<stem>_manifest.resume-drift.jsonl; a semantic change (data and limits, repeats, agent and model, sampling, judge and grading) is refused, naming each setting. It used to refuse any change.Exports
<stem>_<exporter>_export_donenow names the backend run and the sha256 of every file sent. A later export is skipped only while the receipt matches the files; a mismatched, legacy or malformed marker fails the export and sends nothing (it used to skip silently).Models, agents and benchmarks
refit_output_budget_to_window, default on). When the requested output budget alone exceeds the context window and the server refuses for length, the request is sent once more withmax_tokenslowered to the window minus the prompt (minus a 16-token margin). This can add one/tokenizecall and recordsrequested_max_tokens,applied_max_tokensandoutput_budget_refit. A row that used to fail is now generated and scored.regenerate_on_incomplete_output: truerestores the old behaviour.inconclusive_verification_retries=2); SWE-bench masks a zero without a verdict as a verifier error instead of scoring it; SWE-bench Pro retries patch capture over a lost transport; GDPVal treats an answered agent deadline as final and never reruns it; Terminal-Bench 4 answers a resent rollout of the same run with its recorded, completed attempt (replayed_from); the Harbor, OSWorld, tau2 and verifiers agents type their failures.create.timeout_sdefaults to unset, which waits for the request timeout plus the spec's readiness wait plus 30 s, instead of 1500 s.step_exits); scores are unchanged.Training (RL) path
run_examples/run_outcomes, their completion iterators, the sidecar failure rows and the rule that a row's result is exactly what the environment's/runreturned are untouched, and every public name a trainer imports resolves with the same signature.gym evalre-judges saved judge failures after collection and rewritesrollouts.jsonlin place (with areverification/record); there is no switch to disable it yet.Folded follow-up fixes (from #5513)
The follow-up PR's commits are part of this PR now, in order, on top of the reviewed head; they fix behaviour of this layer that recovery runs exposed:
srunrefused outright (a per-user submit or QOS limit, no node free for an immediate start) used to read nothing, so--inspectreturnedUNKNOWN; it is now submitted again with a back-off inside the reader queue wait.UV_LOCK_TIMEOUT, default 1800 s), and installs the MLflow client, so it can read the exported run's status and MLflow delivery is verified rather than reported unverified.--recover --rerun-masked-without-artifact --rerun-reason "<text>". Opt-in, journaled per attempt beside the rollouts file, within the attempt cap;--inspectnames the rows; nothing changes without the flag.--recover --acknowledge-failed-judge-jobs --acknowledge-reason "<text>"lets exactly one more judge-only job queue after the last two ended without settling; the stop message and--inspectname the flag.driver.gym_install.refretries a failure to reach the repository (10, 30, 60 s) and says when it was the network that failed; only after every attempt failed does it accept a commit that a freshly pruned remote-tracking ref of the running Gym's own clone contains.--score-key, and--score-agentor--score-environmentfor a Gym aggregate).run-and-babysit-evalreads as one path from a run's state to the action, with per-benchmark notes inreferences/benchmark-notes.md, the install line for thegymCLI at a pinned commit, and the flags above;add-model-eval-configchecks that the served chat template renders tools.After the fold, the chain also gained the typed
follow_up_submission_refusedstop, the run-complete supersession of an earlier stop, the one fresh restart afterserver_start_failed, and the per-task row for a task with no saved rollout (see above).Each fix has its own tests; each new behavioural test fails without its change.
Release note
SWE-bench and GDPVal denominators change, DeepSWE retries inconclusive verifications, GDP.pdf keeps incomplete answers, and saved judge failures are re-judged after collection, so scores on these benchmarks can move against runs from older pins. Resumable Slurm chains stop on
FAILED,OUT_OF_MEMORYandDEADLINEinstead of retrying, and an export whose marker predates the receipt format fails until the marker is removed.Validation
pytest tests/unit_testsat this head and at that main commit, with the failing tests compared by test id.--recoverdecides RESUBMIT and dispatches once, and the chain resumes; a run that reaches its walltime cap leaves the typed cap stop and resumes only with an explicit larger budget; completed runs cancel their own follow-up and sentinel.How the failure handling decides
1. The job chain's guard: continue or stop
How the next segment continues, retries on an infrastructure cause, or stops and writes why. The job that completes the run, or whose driver exits 76, ends the chain itself in its epilogue (see above); that path is not drawn.
flowchart TD classDef stop fill:#fde2e1,stroke:#b42318,color:#111 classDef go fill:#dcf5e3,stroke:#1f7a3a,color:#111 classDef fact fill:#eceff3,stroke:#667085,color:#111 START(["Follow-up job starts, afternotok of the previous segment"]) --> SENT{"Is this job the sentinel of a follow-up?<br/>queued afterany next to it"} SENT -->|"yes, and the follow-up recorded itself and queued its own follow-up"| S0["Nothing to do, exit 0"]:::go SENT -->|"yes, and the follow-up never started"| S1["Leave the chain as it is, exit 0"]:::go SENT -->|"yes, and the follow-up died before or right after its guard"| S2["Take over in its place: record the dead job, debit its elapsed time, this counts as one infra retry"]:::fact SENT -->|"no"| REC S2 --> REC["Record this allocation in the job chain and write the provisional marker<br/>if this job dies before it queues a follow-up, the marker says so"]:::fact REC --> ACC{"Is the chain accounting readable and known?<br/>chain file, counters, no pending submission lock, no Slurm requeue of the same job id, no unobserved follow-up claim"} ACC -->|"no"| A0["stop: allocation accounting unknown, reconcile the queue and the terminal chain before recovery"]:::stop ACC -->|"yes"| PREV{"Previous job state, read from sacct"} PREV -->|"COMPLETED"| P0["The run finished: exit 0"]:::go PREV -->|"CANCELLED"| P1["stop: chain stopped with rollouts missing, continue with gym eval resubmit --recover"]:::stop PREV -->|"TIMEOUT"| WALL PREV -->|"PREEMPTED, NODE_FAIL, BOOT_FAIL"| P3["Infrastructure cause named by the scheduler: this continuation needs one infra retry"]:::fact PREV -->|"FAILED, OUT_OF_MEMORY, DEADLINE"| P4["No infrastructure cause established: a stop reason is set, the saved evidence decides below"]:::fact PREV -->|"anything else"| P5["stop: previous state unknown or nonterminal"]:::stop P3 --> WALL P4 --> WALL WALL["Add the previous job elapsed time to the accumulated walltime"]:::fact --> KINDF{"Did the previous driver leave a typed failure kind?<br/>the .gym_driver_failure file of that job"} KINDF -->|"server_spinup_timeout"| K1["typed stop: the servers did not come up within the spin-up limit, the chain does not retry it"]:::stop KINDF -->|"driver_install_failed"| K2["typed stop: the install failed before Gym ran, the first error line is quoted, the chain does not retry it"]:::stop KINDF -->|"collection_resume_refused"| K3["typed stop: the resume was refused, semantic configuration drift"]:::stop KINDF -->|"provider_credentials_rejected"| K4["typed stop: the sandbox provider refused the credentials, the chain does not retry it"]:::stop KINDF -->|"server_start_failed, job FAILED, no rollout saved"| K5{"Restarted fresh once already, or retries used at the cap?"} K5 -->|"yes"| K6["typed stop: server_start_failed, fresh restart exhausted, the fresh resubmit command is printed"]:::stop K5 -->|"no"| K7["Restart the run fresh as one infra retry, mark the restart"]:::fact K7 --> CAP KINDF -->|"none"| INV{"Previous state TIMEOUT and no task inventory yet?<br/>artifacts/rollouts_materialized_inputs.jsonl absent"} INV -->|"yes"| I0["stop: the segment timed out before any work, the fresh restart command with a longer walltime is printed"]:::stop INV -->|"no"| RL1{"Needs an infra retry and retries used at the cap?<br/>cap = configured max_retries plus the recorded extension"} RL1 -->|"yes"| R0["stop: infra retry limit reached"]:::stop RL1 -->|"no"| CAP{"Accumulated walltime below max_walltime, with at least one minute left?"} CAP -->|"no"| C0["stop at the walltime cap: continue with gym eval resubmit --recover --max-walltime above the cap, budgets carry over"]:::stop CAP -->|"yes"| ADM{"Stop reason set, or a previous job with a rollout manifest?"} ADM -->|"no"| NOPROG ADM -->|"yes, state FAILED, TIMEOUT, PREEMPTED, NODE_FAIL or BOOT_FAIL"| READER["Admission by the installed reader on the saved evidence<br/>recovery.continuation_admission runs decide_from_collected, see diagram 2"] ADM -->|"yes, any other state"| D0["stop with the set reason"]:::stop READER -->|"driver exited 76, or the reader says stop or noop"| D1["stop: saved recovery evidence has no eligible retries, with the reader reason"]:::stop READER -->|"reader says resubmit: planned segment work"| NOPROG READER -->|"reader says resubmit: a failed attempt needs a retry"| NEEDR["This continuation needs one infra retry"]:::fact NEEDR --> NOPROG NOPROG{"Previous state TIMEOUT and the Store progress rows unchanged since that segment started?"} NOPROG -->|"yes"| N0["stop: the segment spent its walltime without saving a row, the fresh restart command is printed"]:::stop NOPROG -->|"no"| RL2{"Needs an infra retry and retries used at the cap?"} RL2 -->|"yes"| R1["stop: infra retry limit reached"]:::stop RL2 -->|"no, retry needed"| SPEND["Spend one infra retry and record it"]:::fact RL2 -->|"no retry needed"| RUN SPEND --> RUN["Run the segment: queue the next follow-up afternotok and its sentinel afterany, claim the follow-up id, clear the provisional marker"]:::go RUN --> SUBF{"Did the follow-up submission get an observed reply?"} SUBF -->|"yes"| OK["The chain continues"]:::go SUBF -->|"refused by the scheduler"| SR["typed stop follow_up_submission_refused: nothing queued, accounting known, continue with gym eval resubmit --recover"]:::stop SUBF -->|"no reply, or the request was lost"| SF["accounting-unknown marker: automatic continuation stops, inspect the queue and the terminal accounting"]:::stop2.
gym eval resubmit --recoverand--inspectHow recovery decides one action from the saved evidence.
flowchart TD classDef stop fill:#fde2e1,stroke:#b42318,color:#111 classDef go fill:#dcf5e3,stroke:#1f7a3a,color:#111 classDef fact fill:#eceff3,stroke:#667085,color:#111 COL(["Collect the saved evidence of the job directory<br/>collect_evidence.COLLECT_SCRIPT"]) --> MS{"Written by a rollout store, and is an authoritative Store reader available to select the attempts?"} MS -->|"store, reader unavailable or it could not verify the artifacts"| M0["stop: an authoritative Store reader is unavailable, every identity stays unknown"]:::stop MS -->|"reader selected the attempts, or no store"| INV{"Task inventory present?"} INV -->|"no, no live job, no saved rows"| F0["fresh-restart: the run ended before the inventory was written, resubmit it as a fresh run with a longer max_walltime"]:::stop INV -->|"no, a job of the run is live"| F1["noop: a job is still running or pending"]:::go INV -->|"no, otherwise"| F2["stop: no inventory to recover against"]:::stop INV -->|"yes"| LIVE{"Is a job of this run live?"} LIVE -->|"yes"| L0["noop: nothing is classified while a job writes the files"]:::go LIVE -->|"no"| VAL{"Inventory valid, no duplicate identities, no saved rows outside it?"} VAL -->|"no"| V0["stop: invalid inventory or rows the inventory does not name"]:::stop VAL -->|"yes"| CLS["Classify every expected identity<br/>scored, model_final, judge_recoverable, retryable, exhausted, terminal, missing, masked, omitted, unknown<br/>attempt counts from the Store, a reservation without an outcome stays unknown unless the scheduler cut that allocation"]:::fact CLS --> UNK{"Unknown identities that a resume would run again, or nothing else to run?"} UNK -->|"yes"| U0["stop: failures with no registered kind, no supported action or no rerun in the Store, nobody owns them"]:::stop UNK -->|"no"| POL{"Does the outcome policy stop an ungraded failure?"} POL -->|"yes"| PS["stop: mixed dispatch cannot enforce separate task decisions"]:::stop POL -->|"no"| NEED{"Does anything need the policy again?<br/>identities missing or retryable"} NEED -->|"no"| JR{"Judge-recoverable identities only?"} JR -->|"yes"| RV["reverify: re-judge the saved answers, gym eval reverify --judge-failed-only<br/>a model-served Slurm run gets a judge-only CPU job<br/>or, for a run serving its judge on a node pool of its own, a judge-only job on that pool"]:::go JR -->|"no"| TE{"Terminal unscored failures?"} TE -->|"yes"| T0["stop: terminal failures need an owner decision, the run is not complete"]:::stop TE -->|"no"| EX{"Exhausted identities?"} EX -->|"yes"| E0["stop: every attempt used since the last resubmit, a resume would run nothing<br/>--extend-attempts N raises the cap for rollouts the Store would rerun"]:::stop EX -->|"no"| MK{"Masked completed results?"} MK -->|"yes"| MK0["stop: masked results are kept and not measured, a resume would run nothing"]:::stop MK -->|"no"| CPL["noop: every identity is scored, a final model failure, or omitted by an accepted partial stage, the run is complete"]:::go NEED -->|"yes"| MIX{"Judge-recoverable identities as well?"} MIX -->|"yes"| MX0["resubmit: recover names the re-judge part; the resumed run re-judges the saved answers before its policy work and again at the end"]:::go MIX -->|"no"| BUD{"Budget known?<br/>live-job answer, max infra retries, retries used"} BUD -->|"no"| B0["stop: the job chain or scheduler state is unavailable, the budget is unknown<br/>an operator continuation with --max-walltime and a reason may continue it, recorded in the operator-continuation journal"]:::stop BUD -->|"yes"| RET{"Infra retries used below the cap, or planned segment work only?<br/>cap = configured plus recorded extension plus --extend-retries"} RET -->|"no"| R0["stop: the stored infra-retry budget is used"]:::stop RET -->|"yes"| WT{"Walltime capped?"} WT -->|"yes, used walltime unknown"| W0["stop: the used walltime is unavailable"]:::stop WT -->|"yes, used at or above max_walltime"| W1["stop: the stored walltime budget is used"]:::stop WT -->|"no, or below the cap"| RS["resubmit: a resume runs only the missing and retryable identities, budgets carry over"]:::go RS --> DRIFT{"When the resumed segment starts: configuration drift against the recorded configuration of the run?<br/>rollout_recovery._configuration_drift"} DRIFT -->|"semantic drift"| DR0["refused: collection_resume_refused, unless --allow-unsafe-resume, which is recorded in the unsafe-resume journal"]:::stop DRIFT -->|"operational drift"| DR1["allowed and recorded in the resume-drift journal"]:::fact DRIFT -->|"none"| DR2["resume"]:::go3. The inspect gate
How the gate reads evaluation health and failures by kind.
flowchart TD classDef stop fill:#fde2e1,stroke:#b42318,color:#111 classDef go fill:#dcf5e3,stroke:#1f7a3a,color:#111 classDef fact fill:#eceff3,stroke:#667085,color:#111 classDef warn fill:#fff4d6,stroke:#b54708,color:#111 IN(["gym eval resubmit --recover --inspect reads the collected evidence and the recovery decision"]) --> COMP{"Is the run complete?<br/>decision.complete, counting a scored row planned for re-judge as scored (_health_view), and expected trials above zero"} COMP -->|"no"| NE["Health not evaluated: the run has unaccounted trials, the gate reports the recovery decision instead"]:::stop COMP -->|"yes"| CNT["Count the trial faults by kind: recovery.trial_faults<br/>every identity in a failure state, scored rows whose rollout ended on a failed policy call, and zero-scored rows the model left incomplete, truncated_answer"]:::fact CNT --> FC["Classify each kind: recovery.fault_class<br/>model: model_request_error, model_policy_response_timeout, model_context_limit, agent_timeout, agent_limit, agent_invalid_output, agent_command_not_allowed, truncated_answer, empty_answer, malformed_answer<br/>server: server_start_failed, model_transport_error, model_server_error, agent_timeout_infrastructure, every provider_* kind<br/>evaluation-side: server plus every other kind, agent_timeout_infrastructure, invalid_output_budget, invalid_request_parameter, judge_failed, judge_unparseable, verifier_error, environment_episode_failed, rollout_allocation_ended, sandbox and harness kinds, missing, masked, unknown"]:::fact FC --> LIM{"Evaluation-side faults divided by expected trials at or above GATE_FAILURE_LIMIT 0.02?"} LIM -->|"yes"| FAIL["evaluation_health FAIL<br/>the evaluation side failed two percent or more of the trials"]:::stop LIM -->|"no"| OLD{"Do the rows predate operation observations, an earlier pin?"} OLD -->|"yes"| PASSOLD["evaluation_health PASS on coverage, exact false<br/>the exact failure count is unavailable for that pin"]:::go OLD -->|"no"| JOIN{"Is every recovered attempt joined to a completed policy or grading operation?"} JOIN -->|"no"| UV1["evaluation_health UNVERIFIED: recovered failures are not fully joined, treatment is not defined"]:::warn JOIN -->|"yes"| COV{"Is every trial that is not a recorded failure observed?<br/>recovery._observed_trial_operations: a grading operation bound to the saved row, the verifier's own grading record, or a saved grading artifact"} COV -->|"yes"| EXACT{"Evaluation-side share, now including observed gradings without a valid verdict, below the limit?"} EXACT -->|"yes"| PASS["evaluation_health PASS, exact true"]:::go EXACT -->|"no"| FAIL2["evaluation_health FAIL, exact true"]:::stop COV -->|"no, some trials unobserved"| UV2["evaluation_health UNVERIFIED: n of m expected trials unobserved, known failures are a lower bound<br/>this withholds a pass and is no health failure"]:::warn COV -->|"no, coverage not provable at all"| UV3["evaluation_health UNVERIFIED: failures recorded only as zero rewards cannot be ruled out"]:::warn🤖 Generated with Claude Code