feat(checkpoint): persist recoverable Gym rollout state - #4265
Open
macandro96 wants to merge 1 commit into
Open
macandro96 wants to merge 1 commit into
macandro96 wants to merge 1 commit into
Conversation
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
This was referenced Sep 25, 2026
macandro96
added this pull request to stack #4267
September 25, 2026 04:28
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.
Summary
Defines and persists the rollout-level state required to recover Gym executions: stable execution ownership, completed-result receipts and ACK obligations, agent continuations, resource dependencies, policy lineage/TQ references, and source-to-replacement attempt mappings.
This is 2/3 in the stacked decomposition of #4117 and depends on #4264.
This layer defines what a recoverable rollout snapshot contains. The next PR schedules, publishes, and restores those snapshots from Single Controller.
Why
Participant files alone are insufficient to resume a rollout. Recovery must also prove that:
restart_onlyresources restart without discarding unrelated continuable work.Without these relationships, recovery can duplicate a rollout, acknowledge the wrong result, or restore agent state against missing model/resource data.
Durable-state flow
flowchart LR A[Gym execution completes] --> B[Completion receipt] B --> C[Rollout manager seals result] C --> D[Recovery ledger records ACK obligation] D --> E[Gym validates and accepts ACK] E --> F[Recovery ledger removes obligation] C --> G[Agent continuation index] G --> H[Policy lineage and TQ reference index] G --> I[Resource revision dependencies] H --> J[Cross-artifact validation] I --> J F --> J J --> K[Recoverable rollout state] K --> L[Source rollout attempt N] L --> M[Replacement attempt N plus 1] M --> N{Resource mode} N -->|export_restore| O[Continue from saved boundary] N -->|restart_only| P[Restart only dependent execution]Main changes
restart_onlyresources.Correctness rules
PENDING_MODELcontinuations must point to real captured model lineage.Nis never reused as the new physical owner; recovery creates a tracked replacement attempt.Scope
Test plan
Targeted coverage includes:
tests/unit/environments/test_gym_checkpoint.pytests/unit/environments/test_nemo_gym.pytests/unit/environments/test_nemo_gym_checkpoint.pytests/unit/environments/test_nemo_gym_token_capture.pytests/unit/experience/test_rollout_manager.pytests/unit/experience/test_rollout_recovery.pytests/unit/data_plane/test_rollout_reassembler.pytests/unit/experience/test_rollout_generation_failures.pySuggested command:
Before review