Repository navigation
feat(xtask): record each run's judge view against the judge's budget - #2261
Conversation
A run whose view does not fit the judge is unjudged before any call, and the only place the estimate and the budget appeared was that run's error. A scenario could therefore sit within a few tokens of the budget and look healthy until a text change or a longer host path flipped it (#2256, #2257). `Judging` now keeps the pair the fit check compared, and the run record states `judgeEstimate` and `judgeBudget` beside the outcome. Both fields are optional on the wire, so runs.jsonl written before this change still reads; the re-judge and pool paths carry them through `SavedRun`. The fit flow asserts that the judged view keeps over 4 000 tokens of headroom and the overgrown one clears the budget by more than 4 000, so the fixture states its margin instead of relying on it. model-prompts §8.1 records that every run's record carries the pair.
zerob13
left a comment
There was a problem hiding this comment.
One blocking issue in xtask/src/scenario_eval.rs:6136–6180: when a judge request has already passed the fit check but runs past the judge phase budget or cleanup grace, the timeout handler replaces the result with Judging::unfinished and drops the estimate and budget computed at lines 9054–9081. A local loopback judge received the requests on both timeout paths, but both call_failed records stored null for judgeEstimate and judgeBudget. That makes a run that did reach the fit check indistinguishable from one that never did, defeating the new diagnostic on these failures.
Acceptance: both timeout paths retain the original numeric pair while preserving the timeout outcome. Runs that never reached the fit check and older records without the fields still read as having no pair. Document that distinction in model-prompts §8.1.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
The goal is to keep the judge view's token estimate and the judge's budget beside each run's judge outcome, so a scenario close to the budget is visible in runs.jsonl instead of only in an unfit run's error. The commit threads the pair through Judging, ChildOutcome, SavedRun and RunRecord, recomputes it on --rejudge, reads it back on --pool, and the fit flow now asserts its margin from the record.
This head is stacked on #2260 (211a90e), which is reviewed separately. The findings below apply to 66e5c9e only. On the main paths the plumbing is sound: the recorded pair is the same one the fit check compared, old runs.jsonl lines read as None through SavedRun's defaults, and the fit flow passes with its margins.
P2: A judge timeout drops a pair the fit check already took, and the new contract says it cannot.
Problem: judge_export computes fit = Some((estimate, budget)) before its first await (xtask/src/scenario_eval.rs:9060-9063). Both timeout paths in drive_once return Judging::unfinished, which hardcodes fit: None (:6151, :6172, :5901), although the view was built and is kept (:6184). The record then has judgeEstimate: null and judgeBudget: null. That contradicts the new rule at docs/design/model-prompts.md:168 ("Every run's record states...") and both field comments (:2867-2869, :5871-5874).
Failure scenario: a judge that hangs past JUDGE_PHASE_BUDGET (600 s, or the 30 s cleanup grace after a wall-clock stop; the fixture at :21693 triggers it with a 1 s budget) leaves a saved judge-view.jsonl and a record with a null pair. A scenario sitting near the budget stays invisible in exactly these runs, which repeats the old "computed both numbers and kept neither" problem.
Fix: extract the request and estimate computation from judge_export, run it before wrapping the judge call in timeout/timeout_at, and pass the pair to Judging::unfinished. If that is out of scope, narrow the design sentence and both field comments to a run whose judge phase completed, and say that a judge timeout records null.
P3: The field comments exclude the main case.
Problem: RunRecord.judge_estimate says "None when no view reached the judge" (:2867-2869). An unfit view never reaches the judge, and it is the record this change exists to fill, so the comment reads as if unfit records carry null. Judging.fit says "when a view reached the judge" (:5871-5874), with the same inversion.
Failure scenario: a reader uses the comment to decide whether judgeEstimate is present; the fit test asserts the unfit record carries the pair (:17251-17259), so the comment and the behavior disagree.
Fix: state the actual rule. Some when the fit check ran (judged, unreadable, call failed, or unfit); None when no view was built, the judge was not resolved, the run is incomplete, or the judge phase did not finish.
Optional test gaps.
No test asserts the pair survives --rejudge or --pool: the rejudge source records lack it (:15446-15464), so a regression that writes null still passes. One assertion on a rejudged judged record and one on a pooled record that carries the pair would pin the PR's claim. The fit test also pins the margin but not the field's meaning; asserting that the narrow judge's judgeBudget is the declared window less maxTokens (39 800) would.
Optional: inert serde defaults.
RunRecord derives only Serialize (:2831), so the two #[serde(default)] attributes added at :2870-2873 have no effect. Compatibility with old runs.jsonl lines comes from SavedRun (:1347-1350), which does have them. Dropping the RunRecord attributes, or noting why they are there, avoids implying RunRecord is read back.
REQUEST_CHANGES
| reasks: 0, | ||
| calls: Vec::new(), | ||
| temperature_dropped: false, | ||
| fit: None, |
There was a problem hiding this comment.
Judging::unfinished hardcodes fit: None, but both of its callers (:6151, :6172) wrap judge_export, which computes the pair synchronously before its first await (:9060-9063), and the view is kept (:6184). A slow judge therefore drops an estimate that was taken and a saved view's budget. Compute the fit before the timeout and pass it here, or document that a judge timeout records null.
| /// use. | ||
| judge_reasks: u32, | ||
| /// The view's estimate against the judge's budget the fit check compared; | ||
| /// `None` when no view reached the judge, and in records written before |
There was a problem hiding this comment.
This comment is inverted for the case the field exists for: an unfit view never reaches the judge (no call is made) and is exactly the record that now carries Some(estimate, budget) (:9064-9075, asserted at :17251-17259), while a judge timeout records None after the view reached the judge (:5901). Please state the actual rule.
There was a problem hiding this comment.
Partly fixed in 1b2ba7b: the Some rule is right now, and both timeout arms keep the pair (drive_once passes the same fit binding at xtask/src/scenario_eval.rs:6148-6191, and Judging::unfinished stores it at :5898-5908). One clause still contradicts that: or the judge phase did not finish in time (the field comment at :2874) says a timeout records null, while model-prompts §8.1 and Judging.fit (:5874-5877) say it keeps the pair when the check ran. Drop that clause, or say timed out before the check.
| The last row is the rule's limit at the floor: catching that loss 80% of the time needs about 44–51 runs per scenario per arm. The report therefore prints both arms' counts, both rates, the loss, the p-value and the Holm threshold for every comparison, so a reader sees a loss the rule did not flag as well as one it did. The measured table resamples whole runs, which keeps each run's probes together. The pooled rows do not: they count each probe of each run as an observation, and the probes of one run share a transcript, so those p-values are optimistic. That errs toward rejecting, which means failing a candidate, and the per-probe rows compare one probe over whole runs. | ||
|
|
||
| **Failed and unjudged runs.** A failed run is one that ended on an error or its wall-clock budget, or one whose judging did not happen: there was nothing the judge could be asked, or a judge call failed — a window overflow, a transport or an HTTP error, or a reply cut off at its output cap. An unjudged run is one the judge answered but gave no usable verdicts for after two re-asks, or one whose view does not fit the judge's budget, which is never asked: it enters none of its arm's probe rates, and the report counts it and lists it with its reason; the unjudged-run rate compares it. A failed run is out of the probe rates too, and is compared once, as the failed-run rate. Those two rates count the runs an arm had something to compare in — its judged, failed and unjudged runs — and an incomplete fixture is not one of them: it lowers neither rate, and the report states the arm's attempts and its incomplete fixtures beside the rates. An incomplete run is one the harness's turn cap stopped before a request its probes read existed: the step after the first idle never ran, or an input the runner submitted — the message, a request that step submitted, a switch follow-up or a steer — was not carried by the request of the turn that consumed it. A request carries an input when nothing begins or ends a turn between the consumption and the request's `step/model-start`, and either the request's own model call exists or the call of a request that replaced it in the same turn does. A run its wall clock stopped is a failed run, not an incomplete one, and a run that ended idle is scored for the requests its export holds. An incomplete run is neither a failed nor a judged run: it enters none of its arm's probe rates, does not count toward the floor, and the report lists it with its reason apart from the failed and unjudged runs, so a probe no request could answer is not read as the candidate's loss. A re-asked verdict comes from a longer conversation with the same judge at the same settings, and both arms are re-asked by the same rule. A run is judged through a view of its export: each request is given against the previous request of its line — the messages added since that request, or the whole message list after a history change — and every other field of the request appears in full only when it changed, or as an unchanged marker when it did not, so nothing is dropped. A request's consecutive `step/thinking` deltas are one line carrying their text in order, because a delta line is mostly an event id and field names and the judge reads the run as a whole. The judge reads the view in one call. A view that does not fit the judge's declared window — the window less the reply's `maxTokens` — is not split into parts: a probe that counts, orders or holds over a whole run cannot be answered from one part, so the run is unjudged before any call, and the report gives the estimate and the budget. The estimate is the runner's own and is taken before any call, so a predicted overflow is never asked. A call the provider refuses for a window overflow therefore means the declared window or the estimate was wrong, and it stays a failed run: a refusal is how a run outgrowing its model's real window shows up, and failed runs are compared between the arms. The scenario judge is asked for `present` or `absent`; the verdict parser the scenario and summary evaluations share also accepts `contradicted`, which a `must_not_show` probe treats as not shown. An evaluation whose judge declares no window fails before its first call. | ||
| **Failed and unjudged runs.** A failed run is one that ended on an error or its wall-clock budget, or one whose judging did not happen: there was nothing the judge could be asked, or a judge call failed — a window overflow, a transport or an HTTP error, or a reply cut off at its output cap. An unjudged run is one the judge answered but gave no usable verdicts for after two re-asks, or one whose view does not fit the judge's budget, which is never asked: it enters none of its arm's probe rates, and the report counts it and lists it with its reason; the unjudged-run rate compares it. A failed run is out of the probe rates too, and is compared once, as the failed-run rate. Those two rates count the runs an arm had something to compare in — its judged, failed and unjudged runs — and an incomplete fixture is not one of them: it lowers neither rate, and the report states the arm's attempts and its incomplete fixtures beside the rates. An incomplete run is one the harness's turn cap stopped before a request its probes read existed: the step after the first idle never ran, or an input the runner submitted — the message, a request that step submitted, a switch follow-up or a steer — was not carried by the request of the turn that consumed it. A request carries an input when nothing begins or ends a turn between the consumption and the request's `step/model-start`, and either the request's own model call exists or the call of a request that replaced it in the same turn does. A run its wall clock stopped is a failed run, not an incomplete one, and a run that ended idle is scored for the requests its export holds. An incomplete run is neither a failed nor a judged run: it enters none of its arm's probe rates, does not count toward the floor, and the report lists it with its reason apart from the failed and unjudged runs, so a probe no request could answer is not read as the candidate's loss. A re-asked verdict comes from a longer conversation with the same judge at the same settings, and both arms are re-asked by the same rule. A run is judged through a view of its export: each request is given against the previous request of its line — the messages added since that request, or the whole message list after a history change — and every other field of the request appears in full only when it changed, or as an unchanged marker when it did not, so nothing is dropped. A request's consecutive `step/thinking` deltas are one line carrying their text in order, because a delta line is mostly an event id and field names and the judge reads the run as a whole. The judge reads the view in one call. A view that does not fit the judge's declared window — the window less the reply's `maxTokens` — is not split into parts: a probe that counts, orders or holds over a whole run cannot be answered from one part, so the run is unjudged before any call, and the report gives the estimate and the budget. Every run's record states the estimate the fit check took and the judge's budget it compared, so a scenario that sits near the budget is visible before it flips a judgement. The estimate is the runner's own and is taken before any call, so a predicted overflow is never asked. A call the provider refuses for a window overflow therefore means the declared window or the estimate was wrong, and it stays a failed run: a refusal is how a run outgrowing its model's real window shows up, and failed runs are compared between the arms. The scenario judge is asked for `present` or `absent`; the verdict parser the scenario and summary evaluations share also accepts `contradicted`, which a `must_not_show` probe treats as not shown. An evaluation whose judge declares no window fails before its first call. |
There was a problem hiding this comment.
Every run's record states ... does not hold for runs the runner did not judge: a run with no view (harness failure, no export, a profile with no judge host, an incomplete run) has no estimate; a run whose judge phase times out records null although the fit check ran (xtask/src/scenario_eval.rs:5901, :6143-6180); and records from older runners have neither field. Either carry the pair on the timeout paths and scope this sentence to a run whose view the fit check read, or state the null cases here.
The phase budget and the cleanup grace replace the judging with `Judging::unfinished`, which dropped the estimate and budget the fit check had already taken. A run that reached the check and then timed out therefore read like one that never did, which is the distinction the record exists to carry. `judge_export` hands the pair back through a slot as soon as it takes it, and both timeout paths attach it to the unfinished judging. A new flow holds the judge past a 200 ms phase budget: the record keeps the pair beside `call_failed`, while a run that never reached the check still records none. model-prompts §8.1 states the distinction.
|
Thanks — fixed in 760c89d.
New flow Verified: |
Review follow-up on #2261. `judge_export` needs an expectation for its argument count now that it takes the slot a timeout reads; the argument count error was what made `verify (linux)` fail. The two field comments said `None` when no view reached the judge, which inverts the case the fields exist for: an unfit view never reaches the judge and does carry the pair. Both now state the actual rule, and the re-judge flow pins it: a re-judged run states the fit its new judge took, and a run whose judge was never asked records none. `RunRecord` derives only `Serialize`, so its `#[serde(default)]` attributes had no effect; they are gone. The fit flow also asserts the narrow judge's budget is its declared window less the output cap.
|
All addressed in 1b2ba7b, on top of 760c89d which fixed the timeout path before this review landed.
|
zerob13
left a comment
There was a problem hiding this comment.
The timeout finding is resolved. I verified that both the judge-phase deadline and cleanup grace preserve the exact estimate and budget while leaving the result as call_failed. Runs that do not reach the fit check still record no numbers; old JSONL rows, pooling, and rejudge also behave as intended. No remaining blocker. Optional: clarify that the RunRecord comment's timeout case only means a timeout before the fit check.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
The goal is to keep the judge view's token estimate and the judge's budget beside each run's judge outcome in runs.jsonl, and to state the rule the record follows. This head is stacked on #2260, now merged as 1de96c7; the review covers 1de96c7..1b2ba7b.
Fixed and withdrawn
- P2 withdrawn. Both timeout paths now keep the pair the fit check took.
drive_oncekeeps onefitbinding and passes&mut fittojudge_exportin both timeout arms (xtask/src/scenario_eval.rs:6148-6191);judge_exportwrites the pair synchronously before its first await (:9081-9082), andJudging::unfinishedstores it (:5898-5908) throughChildOutcome(:3219-3226) andchild_record(:5773-5774) intoRunRecord.a_judge_that_outlives_its_budget_keeps_the_fit_it_tookpins the phase-budget path (:17335-17366); the cleanup-grace path uses the same binding, and its existing test still passes (:21112). - P3 withdrawn for the design rule: docs/design/model-prompts.md:168 now states the timeout case and the never-reached and old-record cases.
Judging.fitis fixed and withdrawn: it now says the pair survives an unfit view and a timeout (:5874-5877); the remainingRunRecordclause is below.- The inert
RunRecord#[serde(default)]attributes are gone (:2871-2876);SavedRunkeeps the defaults old lines read through (:1351-1354).
Remaining
P3 (optional): one None clause of the RunRecord comment is now false.
Problem: the comment says present when the check ran, "and None when ... the judge phase did not finish in time" (xtask/src/scenario_eval.rs:2871-2874). A timeout that reached the check now records the pair, as Judging.fit (:5874-5877) and model-prompts §8.1 say. The two comments disagree, and this clause is the only place that still says a timeout records null.
Failure scenario: a reader uses the field comment to tell a timed-out run that took the check from a run that never built a view. Under the comment both have null; in the record only the second does.
Fix: drop "or the judge phase did not finish in time", or say "timed out before the check".
Optional test gaps (P3).
- The cleanup-grace timeout site (:6159-6165) is not asserted for the pair; the new test covers the phase-budget site (:6183-6189) only. One assertion in
a_timed_out_run_whose_judge_never_answers_frees_its_worker(:21159-21162) would pin the second. pooled_recordcopies the pair (:1200-1201), but no pool test asserts it;a_pool_reports_several_finished_evaluations_under_one_rule(:15641) reads pooled records and could.
Coverage now pinned: rejudge carry and the not-asked null case (:15538-15549), the narrow judge's budget (window less maxTokens, 39,800) and the judged margin (:17273-17286), and the timeout pair (:17335-17366). The targeted fit, rejudge, pool and timeout tests pass at this head.
APPROVE
The record's field comment still said a judge phase that does not finish records none, while both timeout arms keep the pair once the fit check ran. It now says a phase that timed out after the check keeps it, and only a phase that timed out before the check records none.
|
The remaining clause is fixed in 152ac69: the field comment now reads Separately, this run's |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
The goal is to keep the judge view's token estimate and the judge's budget beside each run's judge outcome in runs.jsonl, and to state the rule the record follows. This head is stacked on #2260, merged as 1de96c7. This review covers the full origin/main 4a98a5a to 152ac69 range; the only change since the approved head 1b2ba7b is one doc comment.
Fixed and withdrawn
- P3 (optional) withdrawn. The
RunRecordcomment at xtask/src/scenario_eval.rs:2871-2875 now says the pair is present for a judge phase that timed out after the check, and absent when no view was built, the judge was not resolved, the run is incomplete, or the phase timed out before the check. That matches the code: both timeout arms keep the onefitbinding (:6149-6193),judge_exportwrites the pair before its first await (:9082-9083),Judging::unfinishedstores it (:5899-5909), andJudging.fitdocuments the same rule (:5875-5879). docs/design/model-prompts.md:168 reads the same way. - The rest of the diff is unchanged from 1b2ba7b: judged, unreadable, failed-call, unfit, timeout, rejudge and pool paths carry the pair;
SavedRunkeeps the serde defaults old lines read through (:1351-1355); the inertRunRecorddefaults stay gone. The optional test gaps noted at 1b2ba7b remain optional, and I do not ask for them here.
Checks
The delta changes only doc comments on private fields, so I did not rebuild or rerun the targeted tests at this head. git diff 1b2ba7b7..152ac692 --check is clean. None of the open PRs #2249, #2255, #2262, #2263, #2264, #1881 touches xtask/src/scenario_eval.rs or docs/design/model-prompts.md, and origin/main 4a98a5a has no change in either file since the branch base, so the merge with main is clean. CI at this head: changes passed and verify (linux) and macos-native were still running when checked; the PR is MERGEABLE.
APPROVE
Summary
Stacked on #2260 (
dim/2256-eval-judge-window); review that one first. This PR only adds the second commit.The judge view's estimate against the judge's budget was invisible unless a run was unjudged:
Judgingcomputed both numbers, used them for the fit check, and kept neither. A scenario could therefore sit within a few tokens of the budget and look healthy until a text change or a longer host path flipped every run of the arm (#2256, #2257).What changes:
Judgingkeeps the pair the fit check compared;ChildOutcomecarries it from the serve child to the parent,SavedRunkeeps it for--rejudgeand--pool, andRunRecordwritesjudgeEstimateandjudgeBudgetbesidejudgeOutcome. Both are optional on the wire (#[serde(default)]), so aruns.jsonlwritten before this change still reads, and a record from before it states no numbers rather than zero.xtask/src/scenario_eval.rsonly.docs/design/model-prompts.md§8.1 states that every run's record carries the estimate and the budget, so a scenario near the budget is visible before it flips a judgement.Not decided here, and stated on #2257: whether the view should stop carrying the run's system prompt and tool definitions in full, whether the byte estimate should be calibrated against the judge's tokenizer, and whether an unfit view should fail the evaluation rather than leave the run unjudged. Those change the rule, not its observability.
Design rule checklist
xtask; no new part, no state or lifecycle in the product.beforecallbacks: n/a.Documentation
docs/design/model-prompts.md§8.1 records the new fact beside the rule it belongs to.Verification
cargo test -p xtask --features eval-tests --bins scenario_eval::tests— 177 passed, 6 ignored.cargo fmt --all -- --check --config error_on_line_overflow=truecargo clippy --workspace --all-targets --locked --features xtask/eval-tests -- -D warningsRefs #2257