Repository navigation
feat(eval): add resumable batch runner and verifier-env forwarding - #6977
Closed
Colafornia wants to merge 3 commits into
Closed
Colafornia wants to merge 3 commits into
Colafornia wants to merge 3 commits into
Conversation
Colafornia
force-pushed
the
feat/eval-batch-runner
branch
from
November 17, 2026 16:08
494caa3 to
0183c56
Compare
Add `maka-eval batch` (`products/eval/src/batch.rs`) to expand `tasks × repetitions × subjects` specs, guard append-only `attempts.jsonl` under an exclusive file lock, resume interrupted runs without re-running settled cells, and write `summary.json`. - Adjudicate `HarborRunOutcome` into closed 4-state trial outcomes (`completed`, `subject_failed`, `infra_failed`, `indeterminate`), blocking automatic retries on `AgentTimeoutError` or broken evidence invariants while bounding `infra_failed` retries to `maxRetries`. - Forward optional `--verifier-env` / `verifierEnv` to Harbor's native `verifier.env` job config, share input validation via borrowed `TrialSpec`, and run `run`/`batch` synchronously while keeping the Tokio runtime scoped to `guest-run`. - Exercise `maka-eval run` and `maka-eval batch` end-to-end through the public CLI against live Host processes and verify cell expansion and selection parity against the frozen TypeScript reference (`85a1031c`). Refs apache#6667. Generated-by: Google Antigravity
On Linux, `std::env::current_exe()` reads `/proc/self/exe`, which dereferences symlinks back to `target/` and escapes `IsolatedEnv.bundle` during `run_cli_persists_summary_and_surfaces_guest_root_cause_on_infra_failure`. Stage bundle binaries with `std::fs::hard_link` (falling back to `std::fs::copy` across filesystems) so the kernel `exe_file` dentry remains inside the isolated bundle directory on all platforms. Refs apache#6667. Generated-by: Google Antigravity
Colafornia
force-pushed
the
feat/eval-batch-runner
branch
from
November 18, 2026 14:42
4dbcba2 to
1a0128b
Compare
…t/settle recovery Replace the 4-state retry adjudicator and content-hashing freeze layer with a minimal resumable batch runner: - Collapse trial settlement to completed, subject_failed, and failed - Record started/settled events in results.jsonl so interrupted cells auto-settle as failed on resume while preserving artifacts, while unstarted non-empty cell directories still fail loudly - Drop sha2/hex dependencies and keep path-level experiment.json freeze - Replace internal white-box tests with public CLI integration tests Refs apache#6667. Generated-by: Google Antigravity
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.
English
Summary
#6938 and #6849 wired up single-task Harbor execution (
maka-eval run) and per-request Host usage pricing, but running multi-task or multi-subject comparisons still required external shell loops with no crash recovery, per-run lock protection, or nativeverifier.envforwarding.This PR adds
maka-eval batchand native--verifier-envsupport.maka-eval batchexpands atasks × repetitions × subjectsJSON spec, freezes normalized canonical paths inexperiment.json, records two-phasestarted/settledevents in an OS-locked append-onlyresults.jsonl, resumes interrupted runs without repeating settled work, isolates per-cell failures, and writessummary.json.Refs #6667.
Changes
src/batch.rs):BatchSpecinto canonical paths, freezing it inexperiment.jsonso resumed runs against the same--outreject mismatched specs (bundleDir,harborBin,forceBuild,verifierEnv,repetitions,maxSteps,timeoutMs,subjects,tasks).tasks × repetitions × subjectsin deterministic order (cellId = "${task}::${rep}::${subject.id}") under isolated per-cell directories (trials/cell-{idx}), preventing case-colliding subject IDs or path-separator issues on disk.results.jsonlwith an exclusive non-blockingFile::try_lock, fails fast on truncated trailing lines or out-of-order journal records, and skips already-settled cells on resume.startedbefore launching a cell andsettledafter completion; if a previous run was killed mid-cell (leavingstartedwithoutsettled), resuming auto-settles that cell asfailed(durationMs: null,summaryPath: null) while preservingtrials/cell-{idx}artifacts untouched, then continues remaining cells. Unstarted non-empty directories still fail loudly with thecell_idin the error.summary.json(completed,subjectFailed,failed,cells), and exits non-zero whenfailed > 0.verifier.env(src/harbor.rs,src/guest.rs,src/main.rs):completed,subject_failed(retaining valid verifier scores including0.0when Host usage settled cleanly), orfailed(infra, Harbor, or evidence errors).--verifier-env KEY=VALUE/verifierEnvdirectly into Harbor'sverifier.env, rejects duplicate keys and invalid entries (NUL/=), sharesHarborRunOptionsandrun_and_settlebetweenrunandbatch, scopes the Tokio runtime toguest-run, rejects empty/whitespacestopReasonandinfraErroringuest.rs, and adds no new workspace dependencies (Cargo.toml/Cargo.lockunchanged).tests/eval_runner.rs) & docs (README.md,README.zh-CN.md):maka-eval runandmaka-eval batchagainst realmakaHost processes,0unit tests).Verification
Verified on commit
8c03461e3(rebased onto82b262826;7 files changed, 1534 insertions(+), 318 deletions(-)):cargo test -p maka-evalpassed (7/7integration tests in16.23s,0unit tests), covering:guest-runandruncontracts (subagent delegation, 429 retry, priced/unpriced/missing-cache settlement,maxStepsretirement, missing-usage rejection, andinfraFailedroot-cause reporting).--verifier-envforwarding into Harbor job config and duplicate-key rejection.maka-eval batchmatrix execution, dual-processresults.jsonllock contention, crash recovery after process termination (auto-settling the interruptedstartedcell asfailedwhile preserving orphan artifacts),experiment.jsonfreeze enforcement, and idempotent resume.samevsSame), per-cell failure isolation without aborting remaining cells, and refusing unexpected unstarted non-empty cell directories withcell_id.0.26.0batch runs: Rebuilt the Linuxaarch64bundle (maka-evalBuildID7bad70928ed3bba99a352f891582a89b70bde08e) and executed real containerized trials (alexgshaw/*:20251031,forceBuild: false, nativeverifierEnv):1 task × 2 reps × 2 subjects):log-summary-date-ranges×deepseek-native/deepseek-openai-compatsettled{completed: 4, subjectFailed: 0, failed: 0}; native cells recordedcostUsd: 0.003235938(score: 0.0) and0.00249432(score: 1.0), whileopenai-compatiblecells recordedmetering: complete,costUsd: null, andscore: 1.0.kill -9crash recovery: Killed mid-cell-0(leavingstartedwithoutsettled); resuming the same--outauto-settledcell-0asfailed(durationMs: null,summaryPath: null, preservingtrials/cell-0), executedcell-1tocompleted(score: 1.0,costUsd: 0.002993376,56315 ms), wrotesummary.json({completed: 1, subjectFailed: 0, failed: 1}), and exited non-zero (error: batch finished with 1 failed cell(s)).cell-0ascompleted(score: 1.0) andcell-1asfailedwith the full Docker compose error without aborting the batch ({completed: 1, failed: 1}, exit code 1).docker ps -awas empty after every run.cargo fmt -p maka-eval --check,cargo clippy -p maka-eval --all-targets --no-deps -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --locked -p maka-eval --no-deps, andnode scripts/asf-license-headers.mjs checkall passed.Did not run the full-repo
just checklocally.AI use
Select exactly one:
Tool(s) and scope: Google Antigravity implemented
maka-eval batch, theharbor/guest/mainboundary refinements, README updates, and theeval_runnerintegration tests. Commitsfdb21abd8,1a0128b1b, and8c03461e3carry theGenerated-bytrailer.Checklist
Does this PR entail a change in behavior?
简体中文
概述
#6938 和 #6849 打通了单题容器评测(
maka-eval run)与 Host 用量计费,但跑多题或多模型对比仍需依赖外部脚本循环,缺乏文件锁保护、崩溃恢复和原生verifier.env透传。本 PR 新增
maka-eval batch子命令与原生--verifier-env支持:maka-eval batch按 JSON 配置展开tasks × repetitions × subjects矩阵,将归一化后的规范路径冻结写入experiment.json,在文件锁保护的只追加results.jsonl中记录started/settled两阶段事件,支持断点续跑、单格失败隔离并最终输出summary.json。关联 #6667。
主要改动
src/batch.rs):BatchSpec路径后冻结写入experiment.json,针对同一--out续跑时会校验冻结配置一致性(bundleDir、harborBin、forceBuild、verifierEnv、repetitions、maxSteps、timeoutMs、subjects、tasks)。tasks × repetitions × subjects(cellId = "${task}::${rep}::${subject.id}"),在独立目录trials/cell-{idx}下落盘,避免被测名称大小写冲突或路径分隔符问题。File::try_lock)保护results.jsonl,遇到截断残行或乱序事件直接报错退出,续跑时跳过已结算单元。started、结束后写settled;若上次进程在中途被强杀(存在未结算的started),续跑时会自动将其结算为failed(durationMs: null、summaryPath: null)同时完整保留trials/cell-{idx}现场目录,并继续执行剩余单元;而未记started的意外非空目录仍会明确拒绝覆盖并在报错中给出对应cell_id。failed而不会中断后续单元,最终原子写入summary.json(completed、subjectFailed、failed、cells),若存在失败单元则返回非零退出码。verifier.env透传(src/harbor.rs、src/guest.rs、src/main.rs):completed、subject_failed(Host 用量已正常结算时保留包括0.0在内的合法 verifier 分数)和failed(基础设施、Harbor 或证据缺失故障)。--verifier-env KEY=VALUE/verifierEnv直接写入 Harbor 的verifier.env并拦截重复键及非法键值;run与batch复用同一套HarborRunOptions与run_and_settle,Tokio runtime 仅限于guest-run使用,guest.rs拒绝空白stopReason/infraError,且不引入新的工作区依赖(Cargo.toml/Cargo.lock无改动)。tests/eval_runner.rs)与文档(README.md、README.zh-CN.md):maka-eval run/maka-eval batch驱动真实makaHost 进程的集成测试(0个单元测试)。验证
基于提交
8c03461e3(已 rebase 到82b262826,总变更7 files changed, 1534 insertions(+), 318 deletions(-))完成如下验证:cargo test -p maka-eval通过(7/7集成测试通过,耗时16.23s,0单元测试),覆盖:guest-run与run链路(子会话委托、429 重试、有价/无价/缺缓存拆分结算、maxSteps截断退役、缺 token 计数拦截、infraFailed根因透出)。--verifier-env透传至 Harbor 任务配置及重复键校验拦截。maka-eval batch实时矩阵执行、双进程results.jsonl文件锁互斥、强杀中断后续跑自动将未结算格标为failed并保留现场目录、experiment.json配置冻结校验、幂等空跑续跑。samevsSame)、单格失败隔离不中断批量执行、未记started非空脏目录拒绝覆盖并附带cell_id。0.26.0真容器批量实跑:重编 Linuxaarch64运行包(maka-evalBuildID7bad70928ed3bba99a352f891582a89b70bde08e),在alexgshaw/*:20251031预打镜像上实跑(forceBuild: false+ 原生verifierEnv):1 题 × 2 reps × 2 subjects):log-summary-date-ranges对deepseek-native与deepseek-openai-compat均完成,{completed: 4, subjectFailed: 0, failed: 0};原生两格分别记录costUsd: 0.003235938(score: 0.0)与0.00249432(score: 1.0),openai-compatible两格均为metering: complete、costUsd: null、score: 1.0。kill -9强杀续跑:在cell-0执行中途强杀留下未结算的started记录;同一--out续跑后自动将cell-0结算为failed(durationMs: null、summaryPath: null、保留trials/cell-0),继续跑完cell-1为completed(score: 1.0、costUsd: 0.002993376、56315 ms),产出summary.json({completed: 1, subjectFailed: 0, failed: 1})并以非零码退出(error: batch finished with 1 failed cell(s))。cell-0正常completed(score: 1.0),cell-1捕获完整 Docker compose 报错落盘为failed且未中断批量({completed: 1, failed: 1},退出码 1)。docker ps -a均为空。cargo fmt -p maka-eval --check、cargo clippy -p maka-eval --all-targets --no-deps -- -D warnings、RUSTDOCFLAGS="-D warnings" cargo doc --locked -p maka-eval --no-deps、node scripts/asf-license-headers.mjs check全部通过。本地未跑全仓
just check。AI 使用
单选:
工具与范围:Google Antigravity 实现了
maka-eval batch、harbor/guest/main边界收拢、中英文 README 更新以及eval_runner端到端集成测试;提交fdb21abd8、1a0128b1b与8c03461e3均附带Generated-bytrailer。审查清单
本 PR 是否带来行为变更?