Skip to content

feat(core): define typed rollout outcomes and recovery #2135

Open
2 of 3 issues completed
Open

Description

@sephmard

Priority

Wave 1 — core recovery contract. Develop in parallel with transport, verifier, session, and lifecycle work.

Problem

Gym can route some returned failure markers and opt-in /run exceptions to a sidecar, but it has no canonical durable representation for every no-result rollout attempt. Kill-shaped omissions leave no evidence, open files can bypass cleanup on cancellation, and resume does not validate materialized input or resolved configuration identity.

Essential scope

  • A serializable no-result failure record that never fabricates reward, response, messages, or token data.
  • Stable logical rollout and attempt identity.
  • Row association for expected request, response, and result-validation failures.
  • Append-and-flush success and failure persistence with guaranteed file closure on success, error, and cancellation.
  • A manifest or equivalent digest that validates materialized input, relevant resolved configuration, run, and schema identity before resume.
  • Append-only attempt history and deterministic selection when late older work arrives.
  • Exact expected, successful, failed, intentionally omitted, and unknown coverage accounting.
  • Preserve run_examples() compatibility: existing callers may remain exception-based while an explicit outcome API is added for callers that want typed failures.

Deferred or excluded scope

Dependencies and integration

Folded compatibility work

Closed #2249 is folded here and into #3180. This issue owns explicit compatibility conversion at the caller boundary and its deletion condition; #3180 owns producer migration and removal of duplicated legacy construction.

Acceptance criteria

  • No-result failures carry no synthetic reward or fake Responses object.
  • Every dispatched logical rollout reconciles to success, failure, intentional omission, or explicit unknown state.
  • Successes and failures are flushed incrementally and files close under error and cancellation.
  • Resume rejects incompatible materialized input or resolved configuration identity unless explicitly overridden.
  • Earlier attempts remain append-only and cannot overwrite a newer accepted result.
  • Direct callers retain documented compatibility behavior and can explicitly opt into typed outcomes.
  • Aggregation reports completion coverage and never presents partial results as complete.
  • The shared record survives every process boundary that actually carries it.

Sub-issues

Sub-issues

2 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. moved this from Done to Details Todo in NeMo Gym 0.6.0 - Sept 2on Jul 24, 2026
  2. sephmard commented on Jul 30, 2026

    @sephmard
    ContributorAuthor

    Duplicates: #1492

  3. sephmard commented on Jul 30, 2026

    @sephmard
    ContributorAuthor

    Related to #1544

  4. changed the title [-][UX] Improved failure handling for rollout collection[/-] [+][ux] Improved failure handling for rollout collection[/+] on Jul 30, 2026
  5. bxyu-nvidia commented on Jul 30, 2026

    @bxyu-nvidia
    Contributor

    For this issue, i think the root problems are:

    1. there is no consistent way of signaling to rollout collection that there has been a failure not caused by the model, of which judge failures are one type
    2. what we should do when there is a failure

    2 is out of scope/trivial (it just goes to the failures like your current pr says)

    for 1, i think the current PR is good but we can make it more explicit. fundamentally 1 is a data problem where the gym schema doesn't allow for return of failure information. here is an example proposal that more explicitly covers 1 rather than:

    having an ad-hoc shape built inside one function that is hard to find
    coupling it with other utils that we may not need

    upgrade the BaseVerifyResponse class to include something like

    from pydantic import BaseModel, Field
    
    from nemo_gym.config_types import ModelServerRef
    
    
    class BaseFailure(BaseModel):
        type: str
    
    
    class JudgeError(BaseFailure):
        type: Literal["judge_failed"] = "judge_failed"
        judge_model_ref: ModelServerRef
        exception: str    
    
    
    class BaseVerifyResponse(BaseVerifyRequest):
        reward: float
        errors: Optional[List[BaseFailure]] = Field(default=None, exclude_if=lambda v: v is None)

    then in each of the resources servers, we can let users customize what data is actually returned on error (rather than assuming it), and optionally include the error information to signal something went wrong

    also can we take the same approach as this https://nvidia.slack.com/archives/C0B1MSCB2R0/p1784564278251029?thread_ts=1784543709.909699&cid=C0B1MSCB2R0 and not do a major sweeping change to all of the servers? we only need to update the ones that you tested directly. less work for you and reduces the blast radius 🤣

    Here is a proposal on next steps given the above PR was already merged:

    1. Revert the PR
    2. Apply the proposal above
    3. Address problem 2 "what we should do when there is a failure"
  6. 12 remaining items

  7. changed the title [-][ux] Improved failure handling for rollout collection[/-] [+]feat(core): define typed rollout outcomes and recovery[/+] on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions