nemo_gym.rollout_compare
nemo_gym.rollout_compare
Per-task parity report between two rollout JSONL files, the gym dev compare command.
A migration aid: before an old resources server is deleted in favour of its Harbor-path replacement, both are run on the same tasks and this report is the gate. It joins the rows by task, classifies every task as identical, flipped, masked or missing, and prints the losing side’s verifier output for every flip. Rows from either path are accepted, and masked failures from the failures sidecar are folded back in. The package re-exports the public names so that nemo_gym.cli.dev and the tests import them from nemo_gym.rollout_compare unchanged.
Submodules
nemo_gym.rollout_compare.commandnemo_gym.rollout_compare.comparenemo_gym.rollout_compare.joinnemo_gym.rollout_compare.reportnemo_gym.rollout_compare.rowsnemo_gym.rollout_compare.schema
Package Contents
Classes
Functions
API
Bases: Exception
An input file could not be read or does not look like rollouts.
Bases: BaseNeMoGymCLIConfig
Compare two rollout JSONL files task by task: count identical, flipped, masked and missing tasks and print the
losing side’s verifier output for every flip. A report, not a gate: the exit code is 0 for a report and 1 when
an input cannot be read or the --json summary cannot be written.
Examples:
One side’s rows for a task, reduced to what the comparison needs.
An agent-level error the row reports without being masked: the legacy agent’s error field or an
*error_type entry in the response metadata (e.g. Terminus’s terminus2_error_type).
The sidecar records that still stand: the collector writes one record per attempt and a retried rollout can end as a scored row in the main file, so only the last record per (task index, rollout index) counts and none whose rollout was scored after all. Records without the indices are kept as they are.
The first candidate field every row carries. Sidecar failure rows that name no task at all are left out
of the vote; they cannot be joined and are listed as masked under an unknown (<side>) #<n> label.
(rows grouped by task label, anonymous rows). An anonymous row is a sidecar failure that names no task: it is kept out of the join entirely and listed as masked on its own side.
Read a rollouts JSONL plus, when present, its sibling <name>_failures.jsonl of masked failures. A failure
superseded by a later attempt (another sidecar record or a scored row) is left out.
Why a row does not count: mask_sample, no reward, or a NaN/infinite reward.
A failure_kind alone does not mask: with mask_sample false it labels a measured reward (e.g. the Harbor
server’s scored zero for a verifier timeout), which counts like any other reward; see measured_failure_kind.
The failure_kind of a row that still counts (not masked): a scored failure the report labels but does
not set aside, so a flip it causes is a real flip.
Load both sides, print the report (or the JSON summary with json_stdout) and write the JSON file when
asked. Exit code: 0 for a report, 1 for unreadable input or unwritable output.
The label a row is joined and listed under: the plain task id, or taskset/task_id with with_taskset
(used when a side spans several tasksets, where the same task id may recur).
(text, source) for a row’s verifier stdout: the file under verifier_logs_dir when it exists, else the
text embedded in the row; (None, reason) when neither is available.