Skip to content

feat: average eval scores across independent runs - #229

Merged
mattrossman merged 18 commits into
mainfrom
mattrossman/ai-1027-average-eval-scores-over-3-runs-with-parallel-sandboxes
Aug 26, 2026
Merged

mattrossman merged 18 commits into
mainfrom
mattrossman/ai-1027-average-eval-scores-over-3-runs-with-parallel-sandboxes

Conversation

@mattrossman

@mattrossman mattrossman commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

What's inside

I intentionally omitted results from the final diff and made UI changes backwards compatible so we can do the refresh in a follow-up PR, to reduce review surface area.

I considered stacked PRs, but there's not a clean way to incrementally add just the framework changes without breaking our --runs interpretation or adding pointless backwards compat temp fluff.

Problem

Runs aren't sufficiently reliable. We assign a binary Pass/Fail on each experiment x eval pair, which means results can shift significantly across refreshes.

Today we partly denoise failures by giving agents 1 extra attempt upon failure, but that biases our results and forces more work in serial (since runs can be conditional on the prev running passing or not).

Changes

Each experiment x eval pair now runs multiple times, in parallel (in CI). Website averages results across runs. Both benchmark and regression results use this strategy.

I'm picking 3 runs because it's the smallest starting point that gives us tie breakers. Based on how CI handles the significant increase in Sandboxes, we can re-evaluate from there.

Framework

--runs N now means exactly N independent scored runs. Removes stop-on-pass and --run-all-attempts.

Each run writes results/<experiment>/<eval>/run-<n>/result.json, resumable per run index with --skip-existing.

$ tree results/codex-gpt-5.4-mini                         
                  
results/codex-gpt-5.4-mini
└── resolve-security-002-rls-cross-tenant-leak
    ├── run-1
    │   └── result.json
    ├── run-2
    │   └── result.json
    └── run-3
        └── result.json

Export emits one row per run with optional "run" index. export-results --runs N skips + warns about pairs whose set of runs is incomplete (example), so a partial refresh can't publish a differently-weighted average.

CleanShot 2026-08-25 at 15 30 03@2x

UI

  • "Eval" table now shows average pass rate % for multi-run results
  • Sidebar sheet show per-run details
  • Legacy results lacking the "run" index fall back to existing Pass/Fail rendering (so that we can refresh results after merging this)
CleanShot 2026-08-24 at 16 10 44@2x

Workflow

Sandboxes tags are updated to trim less useful ones (attempt, runner label) to make room for the more useful run index, since we can only have <=5 tags (proof).

See new run_index: tag from screenshot of sample inflight sandbox:

image

How to review

Look at the preview build from a (now reverted) commit that includes partially refreshed results w/ the new run strategy.

Notice the eval table now shows a % for certain cells instead of just Pass/Fail.

Click into those cells and notice the new nested Run N sections which shows the per-run details (example).

Look at this sample run which refreshed the Claude Code / Sonnet 5 pairs at a 35 concurrency limit across 69 sandboxes spawned (i.e. 2 waves to complete) which took 17m 40s. When scaling up to our full benchmark refresh (690 sandboxes at a 250 concurrency limit) it extrapolates to around 20-30 min for the workflow.

If you'd like to try the new behavior locally, try the following and look at the results/ it produces:

pnpm eval --runs 3 --experiment codex-gpt-5.4-mini --eval investigate-security-010-sql-row-injection-drop

Follow up tasks

  • Full benchmark results refresh
  • Verify "Evals" Hex recognizes the new multi-run format (I don't anticipate any issues)
  • Better failure recovery—Currently if a GH runner process dies (e.g. if it hits the 60 min timeout), you have to manually re-dispatch runs to repair the partial refresh. We might improve DX with a resume_run_id workflow input to assist in resuming a failed refresh.

Ref AI-1027

@vercel

vercel Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
evals Ignored Ignored Preview Aug 26, 2026 7:14am

Request Review

Preview build already covers the partial refresh; keep results
untouched here so the diff stays focused on the run-averaging feature.
@mattrossman
mattrossman marked this pull request as ready for review August 25, 2026 19:15
@mattrossman
mattrossman requested a review from a team August 25, 2026 19:15
@mattrossman mattrossman changed the title feat: average eval scores across independent runs feat: average eval scores across 3 independent runs Aug 25, 2026
@mattrossman mattrossman changed the title feat: average eval scores across 3 independent runs feat: average eval scores across independent runs Aug 25, 2026

@barryroodt barryroodt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the commit, my agent got a bit enthusiastic and applied the fix instead of leaving a review comment.

The review found that the completeness check accepted {1,2,4} when three runs were expected. Commit 29dddd8 now validates the exact run set and adds coverage.

Typecheck, all 20 tests, and GitHub checks are green. READY.

@mattrossman
mattrossman merged commit 62d0284 into main Aug 26, 2026
7 checks passed
@mattrossman

Copy link
Copy Markdown
Collaborator Author

Results refreshing in #248

mattrossman added a commit that referenced this pull request Sep 11, 2026
) (#241)

This is stacked on #240. Review that first; this diff is against it. No
results are touched.

## Problem

We wrote our own system prompt into every eval run, for all four agents:

> You are an agent solving a Supabase eval task in a Linux workspace.
Use the provided tools to inspect and modify the workspace and run
commands. When you are done, end your turn with a short summary of what
you did.

- Claude Code, Codex and OpenCode ship their own system prompt. Ours was
layered on top, and Codex and OpenCode have no system-prompt flag, so
for them it went onto the user prompt.
- It described `bash` and `files_read`, which only the in-process
`ai-sdk` agent has.
- "End your turn with a short summary" shapes `agentReport`, which the
LLM judge reads. That is a scoring change.
- It says Supabase, and "project". An agent that would otherwise pick a
database has been handed the answer (#164).

## Changes

| Agent | Before | After |
|---|---|---|
| `ai-sdk` | framing + tool list + skills list | one neutral line + tool
list + skills list |
| `claude-code` | ours appended to its own | nothing |
| `codex` | ours prepended to the user prompt | nothing |
| `opencode` | ours prepended to the user prompt | nothing |

- CLI agents take no system prompt at all. `createCliAgent` no longer
stages a system-prompt file or passes a path to the runner;
`--append-system-prompt-file` and the Codex/OpenCode prepend are gone. A
non-empty `systemPrompt` for a CLI agent throws.
- The `ai-sdk` base prompt is now `You are an agent. Use the provided
tools to complete the task.` It is the same in both modes. No Supabase,
no project, no stopping instructions.
- `buildToolSurfaceAddendum` and `buildSkillsPrompt` return `''` for
every CLI agent. The bare sandbox no longer takes an `agent` or returns
a `promptAddendum`.
- Prompt assembly moves out of `run-eval.ts` into `system-prompt.ts` so
it can be unit tested.
- `run-eval.ts` only starts a run when it is the entry point. It used to
call `main()` on import, which the harness unit tests now trigger.
- Each run records `systemPrompt` in its raw `result.json`.
`export-results` drops it, so nothing reaches the site.

Since the first review: the system-prompt-file plumbing for CLI agents
is deleted rather than made optional, and the ai-sdk base prompt is
rewritten for #164. The branch is re-applied on the current #240 (the
retry loop is gone there), so the commits are new. #240 now has `main`
merged in, which brings the usage and duration fields from #270.

## Testing

- `pnpm --filter @supabase-evals/core test`, `pnpm --filter
@supabase-evals/sandbox test`, `pnpm --filter @supabase-evals/framework
test`, `pnpm --filter @supabase-evals/web test`: all pass locally.
- `typecheck` for framework, sandbox and web passes. `biome check .` is
clean.
- Unverified against real CLIs since the deletion. The earlier sandbox
runs (Claude Code
[32785480269](https://github.com/supabase/evals/actions/runs/32785480269),
Codex
[32880822811](https://github.com/supabase/evals/actions/runs/32880822811),
OpenCode
[32880839623](https://github.com/supabase/evals/actions/runs/32880839623))
recorded an empty prompt and still loaded the Supabase skills, and the
path they exercised (no flag, task alone) is the one that remains.

## Score movement

Full benchmark on both branches before this revision, artifact only,
nothing published. Both used `runs=2`.

| | #240, no prompt change | #241, prompt removed | |
|---|---|---|---|
| all pairs | 86.0% | 84.7% | 21 flips, 12 down 9 up |
| `claude-code` | 92.3% | 92.3% | no change |
| `codex` | 81.5% | 75.0% | down 6.5 points |
| `opencode` | 82.6% | 89.1% | up 6.5 points |

This looks like run-to-run variability. Once #229 lands and scores
average across runs, the numbers should settle.

## Follow-ups

- Re-run the benchmark comparison once #229 lands and the numbers can
carry attribution.
- Drop the "end your turn with a short summary" line from
`evals/resolve-performance-001-slow-query-cpu-spike/PROMPT.md:15`, the
last one left. It sits in the task text so it hits every agent equally,
and removing it invalidates that eval's recorded results, so it should
be a separate change.

Ref AI-1034

---------

Co-authored-by: Matt Rossman <[email protected]>
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.

2 participants