RunResult should record both execution status and the Benchmark verdict. After all tasks finish, aggregate task-level results into a valid MetricResult.
Do Not Confuse Status with Score
A failed test is not necessarily an
EVAL_ERROR. For example, if the verifier contract defines exit code 1 as an ordinary test failure, the result is a valid zero. It becomes an evaluation error only when the verifier cannot complete scoring. Follow the pinned official verifier contract.
Preserve the Existing Execution Result
Usedataclasses.replace() during evaluation so you do not discard the trajectory, artifacts, Model output, or meta already written by the Harness:
COMPLETED merely to let aggregation continue, and do not use a non-empty error for an ordinary wrong answer. When evaluation evidence is large, save a truncated summary or file artifact instead of copying the complete verifier log into several fields.
Use the Default Binary Aggregation
BaseBenchmark.aggregate_metrics() calls aggregate_binary_metrics() by default. It fits a Benchmark whose every attempt produces a boolean correct value. It generates accuracy and applies the configured category, k, and avg@k or pass@k behavior.
An ordinary binary Benchmark does not need to override this method:
RunResult objects. A custom implementation must not assume every field appears at the top level; results with multiple attempts may store them under result["attempts"].
Aggregate Scalar Scores
When the official primary metric is continuous, use the shared helper and state both the metric name and the missing-score behavior:missing_score_value=0.0 counts a missing score as zero. Do not use this default unchanged if the official rules exclude infrastructure failures or use a different denominator. First select attempts and the denominator according to the official rules, then construct MetricResult and preserve total, evaluated, and error counts in counts.
Combine Multiple Primary Metrics
When you must report both accuracy and mean score, combine shared helpers:details.
Minimum MetricResult Requirements
Custom aggregation must return MetricResult:
Custom logic should read attempt data through
attempt_payload() and return new dictionaries or result objects instead of mutating the persisted structure supplied by the runtime. Shared helper implementations live under runtime/metrics.
Check Before Aggregating
- Correct answers, wrong answers, valid zero scores, execution failures, and evaluation failures produce distinct expected statuses.
correct,score, and the official primary metric have consistent meanings; do not infer a verifier crash fromscore == 0.- Attempt selection,
ksemantics, and the failure denominator match the official implementation. - Category aggregation neither drops unscored tasks nor counts one task in multiple mutually exclusive categories.
MetricResultis serializable, every metric is finite, and every count satisfies its bounds.
