Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
This was referenced Oct 1, 2026
ananthsub
force-pushed
the
ananthsub/partial-ckpt-proof-refinement
branch
from
October 1, 2026 21:53
160c609 to
74b3278
Compare
ananthsub
force-pushed
the
ananthsub/partial-ckpt-e2e
branch
from
October 1, 2026 21:53
87e1f0c to
207f588
Compare
This was referenced Oct 1, 2026
ananthsub
force-pushed
the
ananthsub/partial-ckpt-proof-refinement
branch
from
October 1, 2026 22:05
74b3278 to
e9e628f
Compare
ananthsub
force-pushed
the
ananthsub/partial-ckpt-e2e
branch
from
October 1, 2026 22:05
207f588 to
afee845
Compare
…undaries The proof refinement agent runs its own seed, generate, verify, and correct loop inside a legacy /run, so until now every checkpoint had to retire its rollouts and restart them from the task input. It now runs under the agent participant's legacy_run and records a boundary before seeding, before each generation, before each verification, and once it has its final result. A restored attempt continues from that boundary: it skips the seed, keeps the completed attempts, and never regenerates a proof that was already generated. - Seeding and generation are replay steps. Verification uses the mode the resources server reports on its seed reply. - The agent's /v1/responses proxy passes the policy model's 409 checkpoint_parked through to /run instead of failing. /run backs off, returns to the boundary before the generation, and parks there once the agent's own admission closes. - The session hooks are no-ops: the boundary holds the whole episode. math_formal_lean compiles each proof on its own in a stateless sandbox, so it declares checkpoint_mode = "stateless" and checkpoint_verify = "replay". Ported from #3634 onto the v2 checkpoint hooks. The capture-outcome handling (failing on capture_failed, masking no_generation), the model-call coordinates, the resource request IDs and revisions, and the explicit fresh-parent call for correction turns are not carried: the first two depend on token-capture changes that are not on this stack, and the rest are gone from the v2 design. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
ananthsub
force-pushed
the
ananthsub/partial-ckpt-e2e
branch
from
October 2, 2026 13:22
afee845 to
6a3c667
Compare
ananthsub
force-pushed
the
ananthsub/partial-ckpt-proof-refinement
branch
from
October 2, 2026 13:22
e9e628f to
4e0eace
Compare
This branch has not been deployed
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.
ananthsub/partial-ckpt-proof-refinementananthsub/partial-ckpt-e2efeature,area:agent,area:env-infra(draft, so no state label yet)What changed and why
The proof refinement agent runs its own seed, generate, verify, and correct loop inside a legacy
/run. Before this PR it did not opt into checkpointing, so it was restart-only: every checkpoint had to retire its in-flight rollouts and restart them from the task input, which throws away proofs already generated and compiled.This PR:
Runs the
/runloop under the agent participant'slegacy_runand records a boundary before each step:seed, before/seed_session;generate, before each policy call, holding the current input and the completed attempts;verify, before each/verify, holding the generated proof;return, once the final result is known.A replacement attempt continues from that boundary. It skips the seed, keeps the completed attempts, and never regenerates a proof that was already generated.
Runs the seed and each generation as replay steps. A checkpoint does not wait for them. The policy model holds an undelivered response until resume, and after a crash the step runs again from its boundary. Verification uses the mode the resources server reports in its seed reply (
x-ng-checkpoint-verify), as Simple Agent does.Makes the agent's
/v1/responsesproxy pass the policy model's 409checkpoint_parkedthrough to/runinstead of raising a 500./runbacks off for 0.1 seconds, returns to the boundary before the generation, and calls again. Once the agent's own admission closes, that boundary parks the run until resume. The backoff covers the short window when the policy model has closed but the agent has not yet been prepared.Sets
checkpoint_sessions_supported = True. The three session hooks are no-ops, because the boundary holds the whole episode.Declares
math_formal_leanascheckpoint_mode = "stateless"andcheckpoint_verify = "replay". Its/verifybuilds the proof from the request, compiles it in the sandbox's stateless/executeroute, and returns a result that depends only on the request and the compiler output. It keeps no session state, so running it again after a crash is safe and changes nothing a checkpoint holds.Without checkpointing,
/runbehaves as before. The only visible difference is that the first attempt'sinputrecord is dumped in JSON mode, which serializes to the same bytes.How it works
Where this PR sits in the overall flow
The highlighted part is what this PR adds.
flowchart LR C["Controller<br/>NeMo RL, or rollout collection"] CO["Coordination<br/>prepare, commit, restore, resume, retire"] K["Control plane on every server<br/>phases, fencing, lease, storage"] subgraph G["One participant per Gym server"] E["Environment server<br/>episode steps"] M["Policy model<br/>held responses, generation cuts"] A["Agent<br/>sessions parked at boundaries"] R["Resources server<br/>session state"] end W["Inference worker<br/>stages cut prefixes"] D[("Checkpoint directory<br/>records, then manifest")] C --> CO --> K K --> E & M & A & R M --> W G --> D classDef this fill:#fde68a,stroke:#b45309,stroke-width:2px,color:#1f2937 class A,R thisOne checkpoint, a crash, and the restore, end to end:
This PR
The proof refinement agent's legacy
/runloop, with a boundary after every step. A restored attempt starts after its last boundary and never repeats a finished generation.Where this sits in the stack
This PR builds on the partial-rollout checkpointing stack: #3882 (core) through #3889 (end-to-end suite), plus #3893 (rollout collection). It is one of five PRs that port the environments the old stack checkpointed onto the new hooks. Each one is based on #3889 and can be reviewed on its own, except Blackjack, which builds on the Gymnasium fix:
ananthsub/partial-ckpt-workplace-assistant): feat(checkpoint): checkpoint Workplace Assistant sessionsananthsub/partial-ckpt-gymnasium): fix(gymnasium): build Gymnasium servers on the shared resources server setupananthsub/partial-ckpt-blackjack): feat(checkpoint): export Blackjack game state for partial-rollout checkpoints (on the Gymnasium PR)ananthsub/partial-ckpt-indirect-prompt-injection): feat(checkpoint): export indirect prompt injection session stateananthsub/partial-ckpt-proof-refinement): feat(checkpoint): continue proof refinement agent turns from their boundaries (this PR)Relationship to the old stack
This PR supersedes #3634, which added the same continuation on the old stack. The loop shape, the stop rules, and the attempt records carry over, and so does the replay-safe Lean verification test. These parts are not carried:
capture_failedmodel call and turned ano_generationcall into a masked zero-reward result withfailure_kind = agent_no_generation. Both read the model-call capture outcome header and the failure kind added by the token-capture fixes in feat(checkpoint): add durable turn-level rollout recovery #3349, which are not on this stack. The agent does not inspect capture outcomes here.PendingModelPayload, the committed model call ID and capture key, and the forwarding of the model-call ID and outcome headers through/v1/responses. On v2 an undelivered generation is left out of the checkpoint and re-issued from thegenerateboundary, and the model ledger restores rows under the next attempt's key.take_checkpoint_parent()before each correction so its capture started a new root. v2 has no parent relay. A correction prompt replaces the conversation, so it does not extend the earlier proof's capture.retry_checkpoint_refusal, andcheckpointable_external_wait. Ordering replaces receipts. The 409 handling above replaces the refusal retry, and the seed reply's verify mode replaces the agent-sidecheckpoint_replayable_verifyconfig flag.Issue
No separate issue. This ports #3634 onto the v2 checkpoint hooks.
Validation
RAY_TMPDIR=/tmp python -m pytest -q responses_api_agents/proof_refinement_agent/tests: 9 passed. The new checkpoint tests drive the agent's real ASGI app and control routes. The agent's self-call to/v1/responsesalso goes through the app, so only the policy model and the Lean server are faked./runis checkpointed in five positions: generation in flight, replayable verification in flight, a waited-on verification, the correction generation in flight, and the final verification finishing during prepare. The checkpoint is committed, the original attempt is retired, and the record is restored into a fresh agent instance. The replacement attempt returns exactly the uncheckpointed result. It never re-seeds, and it generates and verifies only the steps after its boundary. For example, with a replayable verification in flight it verifies turns 0, 1, and 2 but generates only turns 1 and 2.checkpoint_parkedreaches/runthrough the proxy. The run stops calling the model once the agent is prepared, and it completes with the uncheckpointed result after resume./runwithout a rollout ID is refused with 400rollout_id_required.RAY_TMPDIR=/tmp python -m pytest -q resources_servers/math_formal_lean/tests: 45 passed, 2 skipped. New tests:x-ng-checkpoint-verify: replay, status reportsstateless/replay,/verifyis served while the server is prepared, and a commit exports no records.NEMO_SKILLS_SANDBOX_HOST:NEMO_SKILLS_SANDBOX_PORT. No sandbox was available, so these 2 tests were skipped.RAY_TMPDIR=/tmp python -m pytest -q tests/unit_tests/test_checkpoint_*.py: 116 passed, including themath_formal_leanentry added to the server declaration test.pre-commit run --files <changed files>: passed.Rollout evidence
Pending. #3634 ran a training and recovery experiment on the old stack, with a checkpoint taken after a failed first proof and a resume in fresh processes. That needs to be rerun on this stack with a real policy model and a Lean sandbox. The process-level e2e suite does not cover this agent yet.
Compatibility
/runcallers or datasets./runnow needs a rollout ID (_ng_rollout_id, or task and rollout indices) and is refused with 400rollout_id_requiredwithout one, as Simple Agent's is.no_generationturns) is not part of this PR. It should land with the token-capture fixes it depends on.