-
Notifications
You must be signed in to change notification settings - Fork 2
feat(frontend): task × agent solve grid in the Eval section #1100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pfbyjy
wants to merge
1
commit into
claude/eval-pareto-frontier
Choose a base branch
from
claude/eval-solve-grid
base: claude/eval-pareto-frontier
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+191
−1
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,178 @@ | ||
| "use client"; | ||
|
|
||
| import { memo, useMemo } from "react"; | ||
| import type { Task } from "@/lib/types"; | ||
| import { | ||
| getExperimentAgentKey, | ||
| getModelScopedAgentsFromSummaries, | ||
| type ExperimentAgentSummary, | ||
| } from "@/lib/experiment-agent-grouping"; | ||
| import { QueueKeyIcon } from "./queue-key-icon"; | ||
|
|
||
| interface TaskSolveHeatmapProps { | ||
| tasks: Task[]; | ||
| agentSummaries: ExperimentAgentSummary[]; | ||
| hiddenAgents: Set<string>; | ||
| } | ||
|
|
||
| type Cell = { n: number; c: number } | null; | ||
|
|
||
| type HeatmapRow = { | ||
| taskId: string; | ||
| taskName: string; | ||
| cells: Cell[]; | ||
| /** Mean solve rate over the agents that ran the task (the sort key). */ | ||
| mean: number; | ||
| }; | ||
|
|
||
| // Cell fill uses the dashboard's semantic status tokens: a pass ramp whose | ||
| // strength is the solve rate, a fixed fail tint for ran-and-never-passed, | ||
| // and near-nothing for never-ran. | ||
| function cellBackground(cell: Cell): string { | ||
| if (cell == null) | ||
| return "color-mix(in oklch, var(--paper-ink-4) 12%, transparent)"; | ||
| if (cell.c === 0) | ||
| return "color-mix(in oklch, var(--paper-fail) 28%, transparent)"; | ||
| const strength = Math.round(20 + 80 * (cell.c / cell.n)); | ||
| return `color-mix(in oklch, var(--paper-pass) ${strength}%, transparent)`; | ||
| } | ||
|
|
||
| export const TaskSolveHeatmap = memo(function TaskSolveHeatmap({ | ||
| tasks, | ||
| agentSummaries, | ||
| hiddenAgents, | ||
| }: TaskSolveHeatmapProps) { | ||
| const visibleSummaries = useMemo( | ||
| () => agentSummaries.filter((summary) => !hiddenAgents.has(summary.key)), | ||
| [agentSummaries, hiddenAgents] | ||
| ); | ||
|
|
||
| const rows = useMemo(() => { | ||
| const modelScopedAgents = getModelScopedAgentsFromSummaries(agentSummaries); | ||
| const built: HeatmapRow[] = []; | ||
| for (const task of tasks) { | ||
| const byAgent = new Map<string, { n: number; c: number }>(); | ||
| for (const trial of task.trials ?? []) { | ||
| const key = getExperimentAgentKey(trial, modelScopedAgents); | ||
| const bucket = byAgent.get(key) ?? { n: 0, c: 0 }; | ||
| bucket.n += 1; | ||
| if (trial.reward === 1) bucket.c += 1; | ||
| byAgent.set(key, bucket); | ||
| } | ||
| const cells = visibleSummaries.map( | ||
| (summary) => byAgent.get(summary.key) ?? null | ||
| ); | ||
| const ran = cells.filter((cell): cell is { n: number; c: number } => | ||
| Boolean(cell) | ||
| ); | ||
| if (ran.length === 0) continue; | ||
| built.push({ | ||
| taskId: task.id, | ||
| taskName: task.name, | ||
| cells, | ||
| mean: ran.reduce((acc, cell) => acc + cell.c / cell.n, 0) / ran.length, | ||
| }); | ||
| } | ||
| // Hardest first: the unsolved rows are the ones worth reading. | ||
| return built.sort((a, b) => a.mean - b.mean); | ||
| }, [tasks, agentSummaries, visibleSummaries]); | ||
|
|
||
| if (rows.length === 0 || visibleSummaries.length === 0) { | ||
| return null; | ||
| } | ||
|
|
||
| const gridTemplateColumns = `minmax(120px,220px) repeat(${visibleSummaries.length}, minmax(22px,1fr))`; | ||
|
|
||
| return ( | ||
| <div className="flex h-full min-w-0 flex-col rounded-[10px] border border-[color:var(--paper-line)] bg-[color:var(--paper-surface)] px-4 py-3"> | ||
| <div className="mb-2 flex items-baseline justify-between gap-3"> | ||
| <h3 className="font-display text-[15px] font-medium tracking-[-0.01em] text-[color:var(--paper-ink)]"> | ||
| Solve grid | ||
| </h3> | ||
| <span className="font-mono text-[10.5px] text-[color:var(--paper-ink-3)]"> | ||
| per-task pass rate · hardest first | ||
| </span> | ||
| </div> | ||
|
|
||
| <div className="max-h-64 min-w-0 overflow-auto"> | ||
| <div | ||
| className="sticky top-0 z-10 grid items-center gap-px bg-[color:var(--paper-surface)] pb-1" | ||
| style={{ gridTemplateColumns }} | ||
| > | ||
| <span /> | ||
| {visibleSummaries.map((summary) => ( | ||
| <span | ||
| key={summary.key} | ||
| title={summary.label} | ||
| className="flex justify-center" | ||
| > | ||
| <QueueKeyIcon | ||
| queueKey={summary.queueKey} | ||
| model={summary.model} | ||
| agent={summary.agent} | ||
| size={13} | ||
| /> | ||
| </span> | ||
| ))} | ||
| </div> | ||
| {rows.map((row) => ( | ||
| <div | ||
| key={row.taskId} | ||
| className="grid items-center gap-px" | ||
| style={{ gridTemplateColumns }} | ||
| > | ||
| <span | ||
| title={row.taskName} | ||
| className="truncate pr-2 font-mono text-[10.5px] leading-[18px] text-[color:var(--paper-ink-2)]" | ||
| > | ||
| {row.taskName} | ||
| </span> | ||
| {row.cells.map((cell, i) => ( | ||
| <span | ||
| key={visibleSummaries[i].key} | ||
| title={ | ||
| cell | ||
| ? `${row.taskName} · ${visibleSummaries[i].label}: ${cell.c}/${cell.n} passed` | ||
| : `${row.taskName} · ${visibleSummaries[i].label}: not run` | ||
| } | ||
| className="h-[14px] rounded-[3px]" | ||
| style={{ background: cellBackground(cell) }} | ||
| /> | ||
| ))} | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
|
||
| <div className="mt-2 flex items-center gap-3 font-mono text-[9.5px] text-[color:var(--paper-ink-3)]"> | ||
| <span className="inline-flex items-center gap-1.5"> | ||
| <i | ||
| className="inline-block h-2 w-4 rounded-[2px]" | ||
| style={{ background: cellBackground({ n: 1, c: 1 }) }} | ||
| /> | ||
| all pass | ||
| </span> | ||
| <span className="inline-flex items-center gap-1.5"> | ||
| <i | ||
| className="inline-block h-2 w-4 rounded-[2px]" | ||
| style={{ background: cellBackground({ n: 2, c: 1 }) }} | ||
| /> | ||
| some | ||
| </span> | ||
| <span className="inline-flex items-center gap-1.5"> | ||
| <i | ||
| className="inline-block h-2 w-4 rounded-[2px]" | ||
| style={{ background: cellBackground({ n: 1, c: 0 }) }} | ||
| /> | ||
| none | ||
| </span> | ||
| <span className="inline-flex items-center gap-1.5"> | ||
| <i | ||
| className="inline-block h-2 w-4 rounded-[2px]" | ||
| style={{ background: cellBackground(null) }} | ||
| /> | ||
| not run | ||
| </span> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In-progress trials painted as failed
Medium Severity
Every trial increments
n, and any cell withc === 0gets the fail tint meant for ran-and-never-passed. Pending, queued, and running trials have a nullreward, so they land in that fail bucket and also pull the hardest-first sort upward. Live experiments then read unfinished work as hard failures, unlike the main trial matrix which keeps those statuses separate.Additional Locations (1)
frontend/src/components/task-solve-heatmap.tsx#L30-L37Reviewed by Cursor Bugbot for commit 68501eb. Configure here.