Repository navigation
Estimate and cap the Grader panel's spend (#1884) - #1951
Merged
Merged
Conversation
The pre-Experiment estimate lists each panel seat's remaining sessions and expected cost from the frozen price table. Panel spend is reported apart from the Arms under panel_spend, and --panel-spending-limit pauses grading once a run's panel sessions reach it; a resume continues from saved calls.
Save a panel call before pricing its session, so an unpriceable session under a spending limit pauses without being graded again on resume. Ask about the panel alone when only its calls remain. Name the estimate's types, move a seat's measured mean onto SeatSpend, share the positive amount parser and the plural helper.
This was referenced Nov 10, 2026
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The Grader panel's cost is estimated per seat before the Experiment, reported apart from the Arms, and capped by an optional Bar setting,
--panel-spending-limit <usd>.experiment cost::confirm Trial groups, worst case, estimate + Grader panel seat N (harness/model): S sessions (P pairs × 2 orders), estimate $X at $Y per <basis> + Grader panel estimate: $T for priced seats, apart from the Arms + Grader panel spending limit: $L per run, then grading pauses workers, pairs, model Grader panel::run for each owed call (pair, seat, order) + if this run's priced panel spend >= limit: pause Grader session -> save call + price the new session(s) from the frozen table (unpriceable -> pause; call kept) experiments <id> [--json] accounting (Arms only, unchanged) + panel_spend {sessions, cost_usd, seats[]} # every retained panel session, retries includedRun the remaining Grader panel sessions? [y/N]on a terminal.bar.panel.spending_limit,panel_spend,PanelSpendandPanelSeatSpendare added within the unreleased format 10 ofdocs/experiment-results.md. The guide, the glossary's Bar entry, code-navigation and the three hand-written site pages are updated, and the manual is regenerated.Evidence
Execution evidence
origin/issue-1872, with this branch'stests/experiments/panel.rs):cargo test --test experiments panel::9ea1047c), the same command:an_unpriceable_panel_session_under_a_limit_keeps_its_completed_callon72fddea9failed withassertionleft == rightfailed: a completed call was graded again / left: 3 / right: 2. On9ea1047cit passes, because the call is saved before its session is priced.9ea1047c:cargo test --test experiments: 182 passed, 0 failed.cargo test --bin thirdshift: 1710 passed, 0 failed.cargo test --test console: 274 passed, 0 failed.npm test --prefix site: 68 passed, 0 failed.npm run docs:check --prefix site: passed.cargo clippy --all-targets: clean.72fddea9:scripts/affected-tests origin/issue-1872selected the site, Console and full Rust suite checks. The site and Console checks passed. The fullcargo test --no-fail-fastrun, which outlasted the script's foreground window, passed with 0 failures.Visual evidence
These are text-only additions to existing paragraphs of the hand-written pages, with no CSS or layout change. Each pair is at 1440×900 desktop, scrolled to the Grader panel paragraph. No mobile capture was taken, because responsive layout is unaffected.
Home (
site/index.html):How it works:
Architecture:
Review coverage
Both reviewers read every changed file except
site/docs/index.html. That file is generated fromdocs/guide.mdbysite/generate-docs.mjs, and both reviewers confirmed the exclusion: they reviewed the guide's diff and re-rannpm run docs:check --prefix site, which passed. It is intentionally unread. No changed file was left unread otherwise.The fixes for Standards 3–6 and 8 and Spec 1 (in
9ea1047c) were not re-reviewed.Unaddressed findings
Fixed in
9ea1047c:options::positive), 4 and 5 (SeatEstimate,SessionPrice,SessionTokens, with the basis rendered from the constant), 6 (SeatSpend::mean_usd; the dropped spend error is now commented as the same narrowing as unreadable Arm history) and 8 (cost::counted).Standards
2. Duplicated loop shape between
panel::remainingandpanel::run(judgement). Declined. The two loops apply different rules:runowes a call only once both Trials of the pair have finished (src/evals/experiment/panel.rs:617,.any(|identity| !trial_results::finished(...))), and it reads each pair's sides once, lazily.remaining(src/evals/experiment/panel.rs:566) must count unfinished pairs too, because the estimate runs before any Trial.A shared iterator would have to carry both rules.
7.
Filesseam versusNativeandPath::exists(judgement). Declined.Filesseam (src/evals/experiment/trial_results/files.rs:13) serves the read-only Experiment views, which is wherepanel::spendis used fromreading.rs.panel::runlaunches sessions and writes calls on the live directory, asmodel_grader::rundoes (src/evals/experiment/model_grader.rs:113).remainingfeeds the live pre-run estimate.Spec
needs-triage). The issue's wording is "resuming continues from the completed calls". The Bar can't change after the first Trial (src/evals/experiment/store.rs, "Bar cannot change after the first Trial"), so a whole-Experiment limit could never be lifted by a resume. The per-run reading is documented in the guide and the results format.failed. Declined; the reviewer also did not raise it as a defect. The issue asks for the pause "as an unavailable Grader does now", and an unavailable panel or model Grader session today also ends asfailed: onlysession::limits::Reachedis logged aspaused(src/evals/experiment.rs:495, otherwise"failed"at:505). The Experiment's own state ispaused, with the reason inpause_reason.Security review outcome
No unaddressed introduced findings.
Merge Danger
Door: two-way
New optional Bar field and view fields within the unreleased format 10. Existing Experiments deserialize unchanged because
spending_limitdefaults to absent.Blast Radius: small
Only Experiments that name a Grader panel see new estimate lines,
panel_spendor the limit. The Arms' accounting, the Verdict and the cost ceiling are untouched.Closes #1884
Built with claude 2.1.314 · opus · default effort