Skip to content

feat(agent): add the suite stats across trials to summary.csv - #715

Open
omkargaikwad23 wants to merge 2 commits into
feat/agent-run-statsfrom
feat/agent-suite-stats
Open

omkargaikwad23 wants to merge 2 commits into
feat/agent-run-statsfrom
feat/agent-suite-stats

Conversation

@omkargaikwad23

Copy link
Copy Markdown
Collaborator

Stacked on #713.

What

With num_trials above 1, the summary.csv of an agent run gets 9 new columns. They hold the stats of the whole suite across trials. The existing columns do not change, and a run with one trial has no new column.

Column On the row Content
pass_rate goal_completion Passed trials divided by scored trials, over all scenarios.
interval_low, interval_high goal_completion The Wilson interval of pass_rate.
flakiness, confidence goal_completion The average of the scenario values, over the scenarios with more than one scored trial.
flaky_scenarios goal_completion Number of flaky scenarios.
trial_min, trial_median, trial_max Each numeric metric The min, median, and max of the suite average of the metric in each trial. Only the scenarios with a scored result in every trial count.

Example from a job with 4 scenarios and num_trials: 3. One scenario runs in one trial only, so the job has 10 trials. Empty cells and the rows without new values are left out.

metric_name metric_score correct_results_count total_results_count pass_rate interval_low interval_high flakiness confidence flaky_scenarios trial_min trial_median trial_max
goal_completion 100.0 10.0 10 1.0 0.7225 1.0 0.0 0.3439 0
token_consumption 62017.1 620171.0 10 42443.6667 52956.6667 107602.3333

On the goal_completion row, correct_results_count gives partial credit. pass_rate counts a trial only as a pass or a failure, with the pass_threshold of the scorer.

Why

The summary shows one average for each metric. It does not show if the trials agree. With these columns, a team can see the certainty of the pass rate, the number of flaky scenarios, and the range of cost and latency between trials.

Testing

  • 11 new unit tests.
  • Antigravity CLI, local, the same 4 scenarios with num_trials: 1 and with num_trials: 3. With one trial, summary.csv has no new column. With 3 trials, the new values match a separate calculation from scores.csv.
  • The new code on the scores.csv of an earlier Claude Code run, in which one scenario passed 2 of 3 trials. The result is a pass_rate of 0.9, a flakiness of 0.2963, and 1 flaky scenario.

Logs: https://paste.googleplex.com/6755399437150219 (Google-internal)

Not run: a job through the gRPC service (two unit tests cover this path), a job with the bigquery reporter, the other harnesses.

With num_trials above 1, the summary of an agent run gets the pass rate,
Wilson interval, flakiness, confidence, and flaky scenario count of the
suite on the goal_completion row. Each numeric metric gets the min,
median, and max of its suite average in each trial. A run with one trial
has no new column.
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.

1 participant