Repository navigation
Description
Describe the bug
Both count_failure_classes_as_zero and count_missing_rollouts_as_zero put an identity-only row into metric aggregation: task index, rollout index, agent ref, and reward: 0.0. Benchmark compute_metrics hooks read the verifier's output, which such a row does not carry.
Three hooks raise, so the run dies after the rollouts are already written:
| hook | raises |
|---|---|
responses_api_agents/tau2/app.py:456 |
KeyError('config') |
resources_servers/vlm_eval_kit/app.py:150 |
KeyError('benchmark_name') |
responses_api_agents/scicode_agent/app.py:144 |
ValueError on mixed token-accounting versions |
Some hooks accept the row and score it as a measurement of something that was never measured:
resources_servers/simpleqa/app.py:182defaults the verdict tonot_attempted, so the run
reports that the model abstained.resources_servers/omniscience/app.py:207defaults toincorrect, which feeds
judge_omni_hallucination: a rollout that never ran is counted as a hallucination.resources_servers/ragtruth/app.py:245scores it a true negative, inflating precision,
recall and F1.resources_servers/asr_with_pc/app.py:399averagesper, a phone error rate, defaulting to
0.0. Zero is a perfect score there, so a rollout that never ran improves the result.resources_servers/math_with_judge/app.py:413returns an empty score dict, so
compute_pass_majority_metricsskips the row:mean/rewardmoves while
pass@1/symbolic_accuracydoes not.
There is no single set of fields that satisfies all of them, because they need verifier verdicts rather than identity. Supplying those would invent outcomes that no verifier produced.
Steps/Code to reproduce bug
Reachable on main today, without count_missing_rollouts_as_zero:
- Take any benchmark whose
compute_metricsreads verifier fields, for exampletau2orvlm_eval_kit. - Set
count_failure_classes_as_zero: ['agent_run_error']. This is the value the option's own description suggests. - Run it so that at least one rollout fails in that class.
tau2 raises KeyError('config'), vlm_eval_kit raises KeyError('benchmark_name'). The failure surfaces from /aggregate_metrics as HTTP 500 and reaches raise_for_status in nemo_gym/rollout_collection.py, after the rollouts jsonl has been closed.
For the silent case, run math_with_judge over two tasks where one succeeds and one fails in a counted class: mean/reward becomes 0.5 while pass@1/symbolic_accuracy still reports 100.
Expected behavior
An imputed zero either enters the benchmark's metrics correctly, or the run refuses to start with a message naming the benchmark and the option, rather than crashing after the rollouts are written or silently changing what a metric means.
One safeguard would cover both options. A benchmark declaring whether it tolerates an identity-only row, with an enforced check, would do it.
Configs
Any config that sets either option on an affected benchmark. Minimal fragment:
count_failure_classes_as_zero: ['agent_run_error']Environment details
- OS: Ubuntu 24.04.4 LTS
- Python: 3.13.14
- nemo-gym: 0.7.0rc0
- pydantic 2.13.4, numpy 2.3.2
Additional context
The row count_failure_classes_as_zero builds is thinner than the one count_missing_rollouts_as_zero builds: _agent_request_failure_row carries only the stamped task and rollout indices, the agent ref and reward, with no task_name. So this is present on main independently of the newer option, which widens the surface rather than opening it.
Activity
docs(eval): record the metric-hook limitation on both zero-counting o…
yuhezhang-ai commentedon Oct 2, 2026
Small, low-priority aggregation follow-up from #3559 to track here alongside the shared safeguards: preserve empty-result coverage reporting when no selected failure can actually be scored.
At
fba554bdddf130eea769b4c4981f58e630eadecc, the newservers_by_agent()lookup contacts the head server whenever either counting option is configured, before establishing whether there is anything to score.Reproduction:
TestRolloutAggregationHelper.test_a_run_with_nothing_to_score_does_not_need_the_head_serverintests/unit_tests/test_rollout_collection.py.count_failure_classes_as_zero=['harbor_failed']to its aggregation config. The fixture has an empty results file and an unstamped sidecar row of classagent_run_error, so the selection matches nothing.Expected: return no aggregate metric and report the excluded failure in coverage, without contacting the head server.
Actual:
RuntimeError: Could not connect to the head server, reached through_identity_key->_metrics_group->servers_by_agent()before scoring. I reproduced the failure and confirmed that the same test/config passes when only the previous aggregation method fromcf86513494622722824af7d26576c90565fcc243is substituted in memory.Suggested follow-up: avoid the server lookup when no eligible rows remain to score, and cover a nonmatching failure-class selection in the existing regression test. This is distinct from the metric-hook compatibility problem above and is non-blocking for #3559; normal aggregation with the head server running is unaffected.
feat(eval): count a rollout that produced no row as zero (NVIDIA-NeMo…