第三方 Benchmark 接入规范
QitOS 现在把 benchmark integration 视为一套正式 SDK,而不是零散脚本。 如果你要新增一个 benchmark family,默认结构应该是:qitos.benchmark.<family>:数据集适配、runtime、evaluator、scorer、benchmark-native artifactqitos.recipes.*:可复现 baseline methodexamples/*:仅保留最薄的用户入口
qitos/core、DesktopEnv 或 example 文件。
三层边界
Framework 层
这些能力属于 framework:AgentModule + EngineActionSpaceEnvironmentAdapterDesktopEnv- provider-neutral tool / action vocabulary
- family preset 与 harness ownership
- qita replay、export、compare、screenshot timeline、overlay
Benchmark 层
这些能力应放在qitos.benchmark.<family>:
- 数据集读取与 split 逻辑
- 稳定 sample identity
- benchmark runtime
prepare/finalize - benchmark-specific
setup/postconfig - evaluator bridge
- scorer 与 failure taxonomy
- benchmark-native artifact payload
test_all.json、benchmark VM/bootstrap、upstream evaluator 语义的内容,都应该放在这里。
Recipe 层
这些能力应放在qitos.recipes:
- canonical starter baseline
- benchmark baseline
- 可复现对比方法
qit bench- docs/tutorials
- thin examples
- 后续 benchmark report 脚本
建议目录结构
新增 benchmark family 时,建议至少包含:Adapter 契约
Adapter 负责:- dataset root 解析
- record loading
- split / subset 过滤
- 稳定 task/sample identity
- task metadata 归一化
- benchmark-native evaluation
- qita inspection
- 可复现结果导出
benchmarksplit- 稳定 sample identity,例如
task_id或example_id - runtime / evaluator 所需的 benchmark-native metadata
Runtime hook 契约
当 benchmark 需要这些能力时,请使用BenchmarkRuntimeHook:
- 环境 prepare / finalize
- agent 动作前的 benchmark-specific setup
- bootstrap metadata
- cleanup policy
- OSWorld 的 qcow2/bootstrap 与 controller readiness
- benchmark-specific sandbox setup
- 服务 warmup 或结束清理
DesktopEnv 或全局 engine。
Evaluator 与 Scorer 契约
BenchmarkEvaluator 用来产生 benchmark-native payload,例如:
- upstream evaluator bridge 结果
- benchmark-native score JSON
- postconfig 执行结果
BenchmarkScorer 负责把这些结果映射回标准公开行:
successstop_reasonstepslatency_secondstoken_usagecost- benchmark-specific metadata
BenchmarkRunResult,不要再造第二套 public row schema。
标准结果行要求
每个 benchmark 运行最终都应输出统一 public row:task_idbenchmarksplitpredictionsuccessstop_reasonstepslatency_secondstoken_usagecosttrace_run_dirrun_spec_ref
metadata,不要破坏共享结果契约。
Trace 与 qita 兼容要求
新的 benchmark family 必须保留:RunSpecExperimentSpec- trace directory 兼容性
- qita replay / export / compare
manifest.jsonevents.jsonlsteps.jsonl
CLI 与注册要求
要把 benchmark family 变成正式入口,需要完成:- 在
qitos.benchmark中导出 family - 在
qitos.benchmark.runner中注册 task loading 与 builtin runner - 确保它能通过以下入口运行:
qit bench runqit bench evalqit bench replayqit bench export
文档同步清单
新增 benchmark family 时,至少同步这些文档面:- benchmark overview
- benchmark family 页面
- CLI reference(如果 benchmark 名称或 strategy 变了)
- contributor guide(如果引入了新的 runtime/evaluator 模式)
CHANGELOG.md- README 的 progress/news(只要是用户可见能力)
当前仓库中的参考实现
可以直接参考这些 canonical 结构:qitos.benchmark.desktopqitos.benchmark.osworldqitos.benchmark.gaiaqitos.benchmark.tau_benchqitos.benchmark.cybenchqitos.recipes.desktop.osworld_starterqitos.recipes.benchmarks.gaiaqitos.recipes.benchmarks.tau_benchqitos.recipes.benchmarks.cybench
