Skip to content

fix(eval): preserve empty outcomes and exclude zero-turn traces from training - #3809

Merged
mikasenghaas merged 5 commits into
mainfrom
fix/empty-eval-outcomes
Oct 8, 2026
Merged

mikasenghaas merged 5 commits into
mainfrom
fix/empty-eval-outcomes

Conversation

@xeophon

@xeophon xeophon commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Keep successful empty environment outcomes in evaluation results. A trace-less episode or clean zero-turn trace retains the verdict returned by Verifiers, while training and curriculum logic exclude zero-turn traces.

Before

The dispatcher changed successful trace-less episodes into EmptyEpisode failures. Clean, non-timeout zero-turn traces became EmptyTrajectory failures, marking both the trace and episode unsuccessful. Evaluation therefore recorded a failure even when the environment had returned success, while training and curriculum filters relied on those injected errors to exclude empty traces.

flowchart TD
    Env["Verifiers returns an empty successful outcome"] --> Dispatch["Prime-RL dispatcher"]
    Dispatch --> Episode["No traces: inject EmptyEpisode"]
    Dispatch --> Trace["Clean zero-turn trace: inject EmptyTrajectory"]
    Episode --> Failed["Rewrite outcome as failed"]
    Trace --> Failed
    Failed --> Eval["Evaluation records a failure"]
    Failed --> Training["Training and curriculum filter injected errors"]
Loading

After

flowchart TD
    Env["Verifiers environment returns an episode"] --> Dispatch["Prime-RL dispatcher preserves empty outcome verdicts"]
    Dispatch --> Eval["Evaluation records and metrics"]
    Dispatch --> Filter["Training trace eligibility"]
    Filter --> Empty["Zero turns: no training sample"]
    Filter --> Sample["Eligible trace with sampled tokens: training sample"]
    Dispatch --> Curriculum["Curriculum ignores zero-turn traces and admits only trainable groups"]
Loading

Remove the synthetic EmptyEpisode and EmptyTrajectory errors. iter_trainable_traces() filters empty traces alongside failed and untrainable traces before advantages are assigned, so the advantage gate needs no separate zero-turn check. Difficulty sampling also excludes zero-turn traces. Empty groups finish without producing a trainer payload, and mixed groups retain their eligible traces. Curriculum admission also requires a trainable trace, so groups without training samples cannot inflate admission metrics. Sampler observations of completed turns are retained even when token metadata is unavailable. Verifiers' no-agent validation and training timeout handling remain in place.

#3824 applies the same ownership rule to partially failed episodes: preserve environment results, then decide training eligibility explicitly.


Note

Medium Risk
Changes evaluation outcome recording and which rollouts feed training/curriculum admission, which can shift eval metrics and training batch composition without touching auth or data stores.

Overview
Stops the dispatcher from injecting EmptyEpisode / EmptyTrajectory errors on successful trace-less or zero-turn outcomes, so evaluation keeps Verifiers’ success verdict instead of recording synthetic failures.

Training and curriculum now exclude zero-turn traces explicitly: iter_trainable_traces() skips num_turns == 0, difficulty-pool reward updates require num_turns > 0, and curriculum admission requires both passing gates and at least one trainable trace via iter_trainable_traces(). Scored rollouts without token/advantage metadata can still update sampler difficulty; groups with no trainable samples no longer count as admitted.

Tests cover mixed groups with non-trainable traces, empty-only groups, and reward-only observations for the sampler.

Reviewed by Cursor Bugbot for commit 8582fb8. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T21:35:53.286017Z 7925f93 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66568a1cbc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/prime_rl/orchestrator/algo/base.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e1585f76a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/prime_rl/orchestrator/algo/base.py Resolved
@xeophon xeophon changed the title fix(eval): preserve empty environment outcomes fix(eval): preserve empty outcomes and exclude zero-turn traces from training Oct 4, 2026
@xeophon
xeophon force-pushed the fix/empty-eval-outcomes branch from a1672ea to 0c771bb Compare October 4, 2026 01:07

@mikasenghaas mikasenghaas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya this makes sense to me

Comment thread docs/eval.md Resolved
@mikasenghaas
mikasenghaas merged commit a3f1f89 into main Oct 8, 2026
19 of 20 checks passed
@mikasenghaas
mikasenghaas deleted the fix/empty-eval-outcomes branch October 8, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants