nemo_gym.rollouts.rollout_records
nemo_gym.rollouts.rollout_records
Index saved rollout outcomes for collection and offline aggregation.
Results and failure sidecars are the source of truth. Execution numbers are reserved in the run manifest; no dispatch or outcome event journal is written.
Module Contents
Classes
Functions
Data
API
A persisted JSONL record, loaded only when its contents are requested.
Legacy migration may assign an attempt index without rewriting the source. Offsets and lengths are bytes, including any final newline.
Read this record with its effective legacy attempt identity.
Every rollout’s attempt cap: the run’s saved cap plus the extension an explicit recovery recorded.
The failure rows that charge a rollout for each later end of an allocation it was in flight in.
A reserved attempt with no saved outcome was in flight when the allocation that made it ended: the writer that
loads the Store holds run_lock, so no other allocation of the run is alive. The first such end of an identity
re-runs for free, and every later one spends an attempt of its cap: the earliest reservation without an
outcome stays as it is and each later one gets a non-terminal rollout_allocation_ended failure. Only an
identity a resume would run again is charged; a finished, settled or blocked one is never touched. The count
is derived from the manifest’s reservations each time, so a saved charge is never charged again.
Validate without mutation, before a writer appends the payload.
Index outcomes, optionally restricted to prefixes captured before the manifest read.
skip_keys names top-level row values that no selection rule reads; large rows are parsed without them.
Index an outcome after its JSONL record has been flushed.
The logical rollouts whose selected result is a masked one an operator approved to run again.
Select byte locations using attempt metadata, without loading payloads.
Failed rollouts resume does not run again although they are neither final nor at their cap: a kept answer or a judge failure (left to verification recovery) and an unclassified execution (left to recovery).
Bases: Exception
Copy one JSON object, replacing the values of some top-level keys with null, in bounded memory.
Bytes are fed in chunks; a skipped value is scanned for its end but never kept. Only top-level keys are matched, so the same name nested anywhere else is copied.
Whether the saved interruption names a cause resume may act on: a request never sent or refused at admission.
Use the same retained-generation facts as collection and recovery.
Scan one record at a time, retaining its original byte coordinates.
With skip_keys a row larger than PROJECTED_ROW_BYTES is read in chunks and parsed without those
top-level values, so a read-only selection never holds a whole large row.
Read one JSONL row from the file position in chunks; a large row is parsed without its skipped values.
Returns the row (None for a blank line, or for an incomplete final row) and the bytes consumed.
Identify failures that spend neither the failure budget nor retry progress.
Whether row records that re-judging the saved answer of judge failure failure failed again.
Whether result re-scores the saved answer of failure without a new model attempt.
failure is a judge failure, or a saved result whose grading is re-verified from its saved answer (a result
masked by a judge or verify-transport failure, or one with no recorded grading). Which saved results are
re-verified is the caller’s selection; this checks only that result binds the same saved answer and attempt.
Repair only an unterminated tail; preserve every complete history record.
Read committed JSONL records; an incomplete final write is not a record.
The id a re-judgment names its predecessor by: a failure’s _ng_failure_id, else, for a saved result whose
grading is re-verified from its saved answer, the digest of the whole saved row.
Whether outcome is the saved result of admission pending: operation, predecessor id and row hash, identity, attempt and admission time all match. Cold readers and the close use this one check.
A failure predecessor is found in failures_path; a saved-result predecessor in results_path.
Find a run’s main output when given its failure sidecar or saved inputs.
An output with its own history owns that history regardless of its name; strip the suffix only when the parent run has a manifest or journal.
Resolve an output without losing its companions.
Readers may retain an unambiguous legacy alias layout. Recovery writers require all history beside the resolved output, so aliases cannot split a run. Legacy-only reverification may reuse reader resolution after excluding history. Derived coverage reports do not establish ownership of a run.