Repository navigation
perf(benchmark): return focused experiment row receipts by default - #7711
huangruiteng wants to merge 2 commits into
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
songoow
left a comment
There was a problem hiding this comment.
Reviewer: model_agent — GPT-6 Astra Pro — OpenAI — self_reported
动机 / Motivation
通过 benchmark experiment-board-upsert 记录单个实验结果的用户或 agent,原来每次更新都会收到整张实验看板,响应随无关历史行增长。
原默认返回整个 board;本 PR 默认返回完整规范化的目标 row、原 write receipt 和 read hint,需要整板时使用新增 --include-board 或既有 experiment-board-show。更新、校验和持久化 owner 没有变化。
真实 CLI 的 1,000 行同一 ledger 上,JSON 预览 stdout 从 1,008,836 字节降到 1,459 字节;完整目标 row 与 write receipt 保留,显式整板、执行后的独立 show 和最终 ledger 都与基线一致。
这是明确的默认响应格式调整,不是 ledger IO 优化,也不改变评分、countability、实验门槛或权限。未验证模型理解、token 计费或长期实验质量,旧脚本若读取 upsert 顶层整板字段需要显式选择兼容路径。
改动思路 / Approach
这是响应范围的有意调整:单行写操作返回该行的完整规范化结果与原写回回执,整板查询仍有原路径。实现没有接管评分、ledger 或并发写 owner;文档明确旧整板消费者如何继续取得完全相同的结果。
范围止于 upsert 的 JSON/Markdown 投影、一个显式兼容选项和现有技能/能力说明。实际 ledger 读取与更新保持原实现,所以交付的是输出减少,不是 O(1) 数据访问或实验质量保证。
用户 row 先经过原 normalization 和 preview/upsert 校验。预览根据完整四段身份从原 owner 的结果取出目标行,执行直接使用原写回事实;默认投影完整 row/write/read_hint,显式 --include-board 则沿用旧整板生成。独立 show 从实际 ledger 再读全量,验证写入与呈现没有混为一体。
写入与校验仍复用原 experiment_board owner,显式整板仍复用原 _board_payload/show。CLI 的小型四段 key helper 只定位预览中已规范化的目标行,遵循现有身份合同,不重新定义实验或评分规则;无需新 storage、通用投影框架或第二份 ledger。
具体改动 / Changes
关键代码讲解
- _row_key:按完整身份选出预览中的目标记录。比较 benchmark/study/case/run 四段 key;即使不同 case 复用 run_id,也不把另一条记录当作本次更新。
- _render_upsert_receipt:呈现完整目标记录与原写回事实。Markdown 收据保留本行内容和写入状态,并给出既有整板读取指引;不改指标或 countability。
- handle_benchmark_experiment_board_command:在原更新之后选择响应范围。默认输出规范化 row、write 和 read_hint;--include-board 复用原整板结果。预览不写,执行和错误仍由原 owner 决定。
规范基准:loopx/capabilities/benchmark_toolkit/README.md;修订 2f544f9。按改动前 Experiment board 段落中的紧凑投影、完整四段身份、原子更新、评分与 countability 边界审查。以下是段落定位标签,不虚构正式 criterion 编号;默认响应 delta 另作明确披露和真实调用验证。
| Criterion | 当前结论 | 对应实现或剩余边界 |
|---|---|---|
| Experiment board | implemented | Default row/write receipt; --include-board and unchanged experiment-board-show |
| Run identity | implemented | _row_key selects the exact normalized preview row; original upsert owner unchanged |
| Metric comparisons and countability | implemented | Full normalized row and original write receipt, original validation/upsert/readback owner |
实际验证 / Validation
本轮 exact head 的完整 tests/capabilities/test_benchmark_experiment_board.py 为 44 个案例,全部通过。另在 base/head 各执行 6 次真实 CLI:默认 JSON 预览、显式整板、默认 Markdown、实际写入、独立 show,以及非法状态倒退;使用同一 1,000 行 ledger,不压缩数据集或指标。
默认 JSON 预览 1,008,836→1,459 字节,Markdown 158,456→1,926,执行响应 1,009,001→1,624。目标行包括零指标与未 qualified 的 countability,和原 write receipt 完整保留;其余 999 行未变。候选 --include-board 预览逐字节等于基线默认整板(SHA256 7698fa90d9f4513c51c8955a9b4d6885b28babe8d0086fbed37e393b072e5c22);执行后的独立 show 指纹同为 2b8cfef2350b56dc6ba372941b94067089375a50010900467932e082cab6d590,最终 ledger 同为 4946ffa1a562d3e73071bbfddc9e1c46bdcd80854e21e6dd7a57987003919b42。非法 completed→running 两端退出码均 2 且不写;诊断只多了新 flag 的 usage 行,不能称整段 stderr 无差别。
对主干的风险 / Risks
最主要代价是默认 shape 变化,依赖旧 runs/summary 的外部脚本必须选择 --include-board。仓内调用方检索未找到隐藏自动消费者,文档/技能同步说明,真实兼容路径与单独读回保持原结果。四段 key 避免复用 run_id 时选错行,完整 row/write 保留评分与资格依据。未发现阻断性实现问题,但不把输出字节减少解释成 storage、评分或模型效果提升。
语义与 CI 对齐
这是有意的响应范围变化,不能称默认输出字节等价。独立旧合同要求的身份、指标、countability、原子写入和整板比较路径都保留;read_hint 是导航,不是额外强制任务。本文同时披露兼容成本,并没有用缩小输出来授权删掉目标行的决策信息。
远程 Linux shard 4/5 失败,其大日志在有界重试中未能取回。Windows 的具体失败为 SQLite delegation task revalidation 的 internal lock timeout(1 failed、13 passed、5 skipped、6 deselected);browser 在 research-display-language.mjs:146 等待 30 秒超时。未取得这些场景本轮原生基线证据,故不称已证历史问题;checks/pytest/merge gate 仍红,当前源码评价与最终合并就绪应分开。
当前阻断是验证缺口,不是凭红灯虚构的代码 finding。 仓库当前 verdict_policy 明确未归因的 current failures 阻止批准;仅证明变更文件不在失败路径,尚不足以归类 pre_existing。最小解除条件是对上述具体失败提供不可变 base/head 的同命令、同签名对照,或独立证明外部/环境原因并补齐受影响合同的当前资格;若归因确属回归,再修相应代码。本轮不要求为未归因失败修改无关代码,也不放宽已有预算。
我的整体评价 / Verdict
REQUEST_CHANGES:未发现阻断性的代码缺陷;当前 CI 失败尚缺政策要求的归因证据,因此暂不具备批准资格。 审查绑定 exact head 3593776。
长期实验记录仍由原原子写入 owner 保存,全部行、countability 和比较依据不变。一次更新的确认更聚焦,整板分析仍可独立读回;这不等于 ledger 变成 O(1) 读取,也不证明实验或模型的长期质量。
日常更新能直接看到本次完整结果与写回状态,仍有明确读取整板的路径。代价是默认 JSON shape 有意改变:依赖旧顶层 runs/summary 的外部脚本要加 --include-board;文档、技能与真实兼容路径已一起交付。 变更为 CLI JSON/Markdown 与技能指引,没有浏览器页面布局变化;两种文本输出及整板读回均已实测。
本次已在原 CLI 投影处解决输出膨胀,不需要改 ledger 或增加缓存。保留 --include-board 是有明确旧响应用途的兼容边界;全量 ledger 读取仍存在,但不能在没有对应瓶颈证据时把这次响应优化扩成 storage 重写。
已检索仓内实际消费者,未发现除文档/测试之外依赖 upsert 顶层 runs/summary 的自动解析器;外部脚本仍可能需要迁移。这里只测真实 CLI 输出字节和 ledger 语义,未证明 token 费用、模型采用、长期质量或 ledger IO 优化;远程 CI 失败归因仍有限。
English verdict: REQUEST_CHANGES — exact head 3593776; Current required CI failures lack the repository-required attribution, so approval is withheld. No blocking code defect was found in the exercised change; resolve the named validation gap rather than changing unrelated code.
…response-20261030 Signed-off-by: huangruiteng <huangrt01@163.com>
|
CI attribution on exact head
No timing threshold or Dashboard code is changed in this PR. |
Updating one experiment row currently builds and returns the entire experiment board, so an agent must discard unrelated rows and comparisons after every update. Preview and execute now return the complete normalized affected row, the original write receipt and focused read guidance. Metrics, countability, exact run identity, transition validation and write semantics stay with their existing owners.
This changes the default JSON/Markdown response of
experiment-board-upsert. Consumers that need the previous board-shaped response can pass--include-board;experiment-board-showremains the comparison read path. Benchmark/study filters apply to the optional board projection, not the mutation. The benchmark skill and capability documentation explain receipt reuse and when a fresh board read is needed.Validation:
The change stays in the existing Python CLI adapter and reuses the capability's row normalization/persistence contract; no new semantic owner or storage migration. The shared board builder/rendering consumed by other surfaces is unchanged. This is an agent tool-response improvement within the existing capability, not a new frontend journey or capability. No live benchmark launches or installed-runtime changes. Maintainer review and merge remain pending.