Skip to content

feat(benchmark): show best-score trajectories alongside all observations - #8089

Merged
huangruiteng merged 3 commits into
mainfrom
codex/benchmark-score-trajectory-view
Nov 5, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/benchmark-score-trajectory-view

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

Campaign report readers can request a standalone HTML view with --score-curves. The primary chart shows the running best. Its scale comes from first scores and subsequent records. The expandable full-range chart retains every observed sample, including regressions. Charts separate cases and normalization mappings and consume arm labels from the study.

The renderer also accepts a caller-supplied observation horizon, labeled units, and an optional continuation marker on the caller's time axis. It does not classify runs, grant score authority, or infer missing observations.

The HTML keeps its 960-unit chart canvas at its intrinsic CSS width instead of shrinking 13 px SVG labels into a 580 px narrow-screen canvas. At 390 px the chart remains horizontally scrollable within its section, the scroll region is keyboard focusable, and ArrowRight advances the visible range. Desktop charts still fit the 960 px content frame without horizontal overflow.

Verification

Tested head: cf8dc746eb; base: 64f1c7b039.

  • Campaign report suite: 21 passed, 0 failed, 0 skipped.
  • Control-plane TypeScript typecheck: passed.
  • loopx canary premerge --from-git-diff --git-diff-base origin/main: 15 selected, 0 failures. The existing maintainability ratchet remains an inherited advisory outside this diff.
  • Real CLI generated the opt-in HTML with four synthetic arms, multiple improving/regressing samples, a single-sample series and distinct normalization mappings.
  • At 1280 px the chart region is 960 px wide with 13 px SVG text and no internal overflow. At 390 px the region is 358 px wide, its scroll width is 960 px, SVG and tick text remain 13 px, and keyboard ArrowRight changes scrollLeft from 0 to 40.

Visual evidence

Synthetic public CLI output produced from tested head cf8dc746eb; the renderer output is byte-identical to the pre-rebase visual capture. This is a local source build, not an installed App or benchmark result. The existing Markdown, CSV and JSON outputs remain the default; HTML is opt-in.

Desktop score chart

390px score chart

390px expanded score chart

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

REQUEST_CHANGES — [P2] 保留窄屏坐标文字的实际字号。 Reviewed head: 59e8f0c4b95df80ac84f773b97204298bee84f97;base: bca7e3c7267a90dcf8dd1546b73160a342869107。

动机 / Motivation

研究报告读者需要在多次试验中辨认最好成绩和退步样本;此前只有表格与 JSON 序列,需另写绘图代码。

本次真实 CLI 已生成按 case 和 normalization 分组的 HTML,最好成绩保持到最后观测,全部样本可展开;窄屏坐标文字仍过小。

本 PR 不选择实验、不补采样、不授予成绩可计数资格,也不证明任何模型或 LoopX 效果。

尚余:Fix the reproduced narrow-chart readability before this independently useful artifact slice is accepted.

改动思路 / Approach

该方案复用现有报告计算 owner:先验证调用者已选择的运行和采样,再按 case 与 normalization 分组,最后生成纯 SVG。默认视图展示 running best(截至该时刻的最好观测),展开后保留失败迭代;两者不混成一条不完整的跨题均值。新增 helper 不读取实验账本,也不把 provisional 采样升级成有效成绩。最小实现是在原命令增加输出格式,加入另一个服务或实验 ledger 没有必要。

Renderer remains a pure projection beside the existing report owner; no second experimental authority or service is needed.

Retain the existing command and pure renderer; fix narrow text scaling within this PR, without extending experiment authority.

具体改动 / Changes

本次完整 diff 为 4 文件 +147/-2:生产代码 116 行新增、测试 24 行、文档 7 行。规范依据为 docs/reference/benchmark-campaign-report.md,spec_revision bca7e3c7267a90dcf8dd1546b73160a342869107;同一 immutable revision 的 docs/development/design.md 提供字号与 populated-page 要求。映射条款 normalized-samples、observations-only 已实现:不混尺度、不补缺失点,单点和空序列保持诚实。readable-primary-data 尚未满足,下述窄屏反例可复现。

关键代码讲解

  • renderScoreCurves(scripts/benchmark-campaign-report.ts:302)复用 score_time_series 和 arm label;每个 case/mapping 单独生成默认与展开图,不更改原始 report。
  • scoreChart(scripts/benchmark-score-chart.ts:16)校验时间顺序,best 模式保留首个值和严格改善点,横线仅延到最后观测。all 模式保留退步与低分;转义文本用于标题和标签。
  • CLI main(scripts/benchmark-campaign-report.ts:326)只接受原两个位置参数或追加 --score-curves。我通过真实 CLI 比较 base/head/default/opt-in 的 Markdown、CSV、JSON,三种输出逐字节一致;未知选项和非法时间序列仍在写文件前失败。

对主干的风险 / Risks

[P2] scripts/benchmark-campaign-report.ts:322。 390px 下,svg{width:100%;min-width:580px} 把 960-unit viewBox 压到 580px,而 scoreChart 用 font-size="13"。实际字高是 13 × 580 / 960 = 7.85px,单位和刻度在默认主图与展开图都明显过小;横向滚动只能移动这个已经缩小的 canvas。现有 21 项测试只检查数据和 SVG 内容,因此全部通过也发现不了它。请让图表画布保持可读字号后滚动,或实现不缩小文字的响应式布局,并复查 390px 的默认与展开视图。这是输出的阅读缺陷,不要求新增产品权限或研究实验。

独立验证:21 PASS / 0 SKIP;TypeScript typecheck PASS;同输入三种旧格式字节相等;缺失/单点、不同尺度、低分、非法输入、未知选项、horizon 与 marker 反例均已执行。quick premerge 的 4 个直接检查、语义词汇、实验权限和 public-boundary 检查通过;maintainability 的原 interaction_contract 超规模项另记基线对照,严格 quality receipt 仍 stale,整体 merge gate 未通过。未查询或等待 CI,也未以这些检查替代实际图表阅读。

我的整体评价 / Verdict

这是有用且比例合适的报告切片,long_horizon 保留原数据和后续工作权限;当前 user_experience 因窄屏字号回归仍阻塞。默认关闭路径独立验证通过,新语义限于本地展示,不需要增加共享协议或 Python 决策 owner。代码边界可保留,先在当前 renderer 修复缩放。

1280×900 默认与展开视图层次清楚;390×844 展开实图显示单位和刻度仅约 7.85 CSS px,不能靠横向滚动恢复字号。

未核验安装产品或真实实验数据;未独立取得窄屏折叠态及下部截图,不影响已在390px主图与展开图复现的字号问题。

English verdict: REQUEST_CHANGES on 59e8f0c: keep SVG labels readable at narrow widths; default report formats remain byte-identical to the base.

Comment thread scripts/benchmark-campaign-report.ts Resolved
@huangruiteng
huangruiteng force-pushed the codex/benchmark-score-trajectory-view branch from 59e8f0c to e41a0f7 Compare November 5, 2026 06:47
loopx-agent and others added 3 commits November 5, 2026 14:49
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
@huangruiteng
huangruiteng force-pushed the codex/benchmark-score-trajectory-view branch from e41a0f7 to cf8dc74 Compare November 5, 2026 06:49

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; GPT-5; OpenAI; self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

Campaign report 已保留每道题、每个 normalization 的 sample,但读者此前需要另写代码才能看到 running best、回退和后续恢复;首个 HTML 实现又把窄屏整张图缩小,使坐标文字只有约 7.85 CSS px。当前 head 让 opt-in HTML 在桌面完整显示,并在 390px 视口保持图表与文字为 13px,通过局部横向滚动和键盘读取完整时间轴。

受影响的是使用本地 benchmark campaign report 阅读长期分数轨迹、回退样本和不同 normalization 的维护者与研究人员。同一 390px 视口、同一合成数据和同一 SVG:旧样式把文字缩到约 7.85px;当前 head 保持 chart 与文字 13px,358px 容器在 960px 内容上横向滚动,并可键盘移动。可观察结果是:桌面图继续在 960px 内容框内完整显示;390px 下 SVG 与文字保持 13px,滚动容器可聚焦,ArrowRight 将 scrollLeft 从 0 移到 40。边界是不新增实验服务或持久状态,不改变 run selection、score authority、normalization 或 Board;不证明真实 benchmark 效果,也不验证安装态 App。

改动思路 / Approach

入口仍是既有 campaign report CLI;buildReport 继续拥有选中的 observations、arm label、case 和 normalization 身份。无 flag 时仍只写 JSON、Markdown、CSV;只有 --score-curves 才增加本地 HTML。renderScoreCurves 按 case 与 normalization 分组,主图走 best 模式,展开区走 all 模式,再复用一个纯 SVG helper。图表不会读取实验账本、补缺失 sample 或改变 countability。

旧 narrow finding 的根因是 SVG 被 width:100%;min-width:580px 二次缩放:960-unit viewBox 压到 580px 时,13-unit 字只有约 7.85px。当前 head 用 scoreChartWidth 同时拥有 SVG 几何与 HTML CSS 宽度,保留 960px intrinsic width,由 .plot 承担局部 overflow;每个 plot 是带 aria label 的 focusable region。架构判断是 retain:The chart is a pure projection beside the existing report owner and the narrow repair reuses the same local overflow mechanism. 当前 PR 的边界是 Deliver an opt-in local HTML view and preserve readable labels across desktop and narrow layouts without extending benchmark authority.

具体改动 / Changes

spec_ref: docs/reference/benchmark-campaign-report.md

spec_revision: 64f1c7b03948f3107b94988b23e16011368b522e

完整 diff 为 4 文件 +150/-2:生产代码新增报告投影和一个纯 SVG helper,测试覆盖真实 CLI、best/all、不同 scale、HTML 安全与窄屏 CSS,文档说明 opt-in 行为。现有三项默认报告格式、输入 schema 和实验权限没有变化。

Criterion 当前 head 证据
REPORT-OPT-IN-HTML implemented 无 flag 不写 HTML;flag 仍走既有原子输出循环
REPORT-RECORD-VS-OBSERVATIONS implemented best 去掉非改善点,all 保留回退;测试圆点数为 [2, 4, 1, 1]
REPORT-SCALE-SEPARATION implemented 每个 case/normalization 独立 section 和坐标轴
REPORT-NARROW-READABILITY implemented 390px 下 SVG 与刻度均 13px,局部 scrollWidth 为 960
REPORT-NO-AUTHORITY implemented 只投影已验证 Report,不选择 run、不归一化、不补零

关键代码讲解

  • scoreChartWidth:单一宽度 owner,同时驱动 SVG viewBox 与 HTML CSS,移除了引发 960→580 二次缩放的冲突假设。
  • scoreChart:对 finite/order/horizon 做失败关闭,best 模式保留 running record,all 模式保留完整观测,并生成读数刻度。
  • renderScoreCurves:只从 report.summary 与 score_time_series 生成 case/mapping 分层图;主图和展开图共用同一时间范围,plot 具有键盘焦点与准确的 aria label。
  • HTML style:桌面让 SVG 占据 960px 内容框;窄屏只在 .plot 内横向滚动,保留 13px 字号和可见 focus outline。

对主干的风险 / Risks

原有 finding 已按根因解决,而不是放大字号补偿:当前浏览器实测 390px 区域宽 358px、scrollWidth 960px、SVG/刻度 computed font-size 13px;聚焦 plot 后 ArrowRight 使 scrollLeft 从 0 变为 40。桌面 1280px 下图表宽 960px、无内部横向溢出。实际页面使用四个 synthetic arms、两道 case、回退、恢复和单点序列,运行中展开后图表仍为页面主内容,没有新增重复说明栏。

强反例是采样非 finite、时间倒序、超出 horizon、不同 normalization 混轴,或没有 flag 却生成 HTML。buildReport 和 scoreChart 会在输出前失败;normalization fixture 被拆成不同 section;CLI 只有显式 flag 才加入 HTML。受限的范围是 installed packaging、真实 campaign 数据、四个以上 arm 和辅助技术组合未验证。

PASS:campaign report suite 21 passed, 0 failed, 0 skipped。PASS:npm run typecheck:control-plane。PASS:exact-head loopx canary premerge 为 15 selected、0 failures;唯一 advisory 是未触及的 maintainability baseline。PASS:源码 CLI 生成的 HTML 在真实 Chromium 中完成 1280×900 与 390×844 检查。

我的整体评价 / Verdict

这次切片保留长期数据的全部观测和后续工作边界,只增加本地展示;narrow defect 修复没有改变 score 语义或默认输出。用户侧收益是无需另写绘图代码即可区分 running best 与回退,并且窄屏不再靠缩小文字换取适配。scoreChartWidth 也消除了 SVG/CSS 两处宽度假设的维护风险。

本次复用既有 Report、score_time_series、CLI 原子输出与纯投影结构,没有新增共享协议或持久状态。兼容性方向是保留 JSON/Markdown/CSV 默认和原输入;回滚可撤销 opt-in HTML 与 chart helper。残余风险是安装态、真实数据和大量 arm 的组合仍未知。

视觉检查结论:Actual source-built HTML was inspected at desktop and narrow widths with populated multi-arm, regressive and single-sample data. The chart remains the primary artifact, axis labels stay readable, the legend remains above the plots, and overflow stays local to the plot. 未覆盖范围是 Installed App packaging, very large arm counts beyond the synthetic four-arm fixture, zoom-assisted layout and real benchmark datasets were not exercised.

English verdict: APPROVE — head cf8dc74 resolves the narrow chart-label finding while keeping default report formats unchanged; 21 focused tests, TypeScript typecheck, 15/15 premerge and desktop/390px real-browser checks passed.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; GPT-5; OpenAI; self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

Campaign report 已保留每道题、每个 normalization 的 sample,但读者此前需要另写代码才能看到 running best、回退和后续恢复;首个 HTML 实现又把窄屏整张图缩小,使坐标文字只有约 7.85 CSS px。当前 head 让 opt-in HTML 在桌面完整显示,并在 390px 视口保持图表与文字为 13px,通过局部横向滚动和键盘读取完整时间轴。

受影响的是使用本地 benchmark campaign report 阅读长期分数轨迹、回退样本和不同 normalization 的维护者与研究人员。同一 390px 视口、同一合成数据和同一 SVG:旧样式把文字缩到约 7.85px;当前 head 保持 chart 与文字 13px,358px 容器在 960px 内容上横向滚动,并可键盘移动。可观察结果是:桌面图继续在 960px 内容框内完整显示;390px 下 SVG 与文字保持 13px,滚动容器可聚焦,ArrowRight 将 scrollLeft 从 0 移到 40。边界是不新增实验服务或持久状态,不改变 run selection、score authority、normalization 或 Board;不证明真实 benchmark 效果,也不验证安装态 App。

改动思路 / Approach

入口仍是既有 campaign report CLI;buildReport 继续拥有选中的 observations、arm label、case 和 normalization 身份。无 flag 时仍只写 JSON、Markdown、CSV;只有 --score-curves 才增加本地 HTML。renderScoreCurves 按 case 与 normalization 分组,主图走 best 模式,展开区走 all 模式,再复用一个纯 SVG helper。图表不会读取实验账本、补缺失 sample 或改变 countability。

旧 narrow finding 的根因是 SVG 被 width:100%;min-width:580px 二次缩放:960-unit viewBox 压到 580px 时,13-unit 字只有约 7.85px。当前 head 用 scoreChartWidth 同时拥有 SVG 几何与 HTML CSS 宽度,保留 960px intrinsic width,由 .plot 承担局部 overflow;每个 plot 是带 aria label 的 focusable region。架构判断是 retain:The chart is a pure projection beside the existing report owner and the narrow repair reuses the same local overflow mechanism. 当前 PR 的边界是 Deliver an opt-in local HTML view and preserve readable labels across desktop and narrow layouts without extending benchmark authority.

具体改动 / Changes

spec_ref: docs/reference/benchmark-campaign-report.md

spec_revision: 64f1c7b03948f3107b94988b23e16011368b522e

完整 diff 为 4 文件 +150/-2:生产代码新增报告投影和一个纯 SVG helper,测试覆盖真实 CLI、best/all、不同 scale、HTML 安全与窄屏 CSS,文档说明 opt-in 行为。现有三项默认报告格式、输入 schema 和实验权限没有变化。

Criterion 当前 head 证据
REPORT-OPT-IN-HTML implemented 无 flag 不写 HTML;flag 仍走既有原子输出循环
REPORT-RECORD-VS-OBSERVATIONS implemented best 去掉非改善点,all 保留回退;测试圆点数为 [2, 4, 1, 1]
REPORT-SCALE-SEPARATION implemented 每个 case/normalization 独立 section 和坐标轴
REPORT-NARROW-READABILITY implemented 390px 下 SVG 与刻度均 13px,局部 scrollWidth 为 960
REPORT-NO-AUTHORITY implemented 只投影已验证 Report,不选择 run、不归一化、不补零

关键代码讲解

  • scoreChartWidth:单一宽度 owner,同时驱动 SVG viewBox 与 HTML CSS,移除了引发 960→580 二次缩放的冲突假设。
  • scoreChart:对 finite/order/horizon 做失败关闭,best 模式保留 running record,all 模式保留完整观测,并生成读数刻度。
  • renderScoreCurves:只从 report.summary 与 score_time_series 生成 case/mapping 分层图;主图和展开图共用同一时间范围,plot 具有键盘焦点与准确的 aria label。
  • HTML style:桌面让 SVG 占据 960px 内容框;窄屏只在 .plot 内横向滚动,保留 13px 字号和可见 focus outline。

对主干的风险 / Risks

原有 finding 已按根因解决,而不是放大字号补偿:当前浏览器实测 390px 区域宽 358px、scrollWidth 960px、SVG/刻度 computed font-size 13px;聚焦 plot 后 ArrowRight 使 scrollLeft 从 0 变为 40。桌面 1280px 下图表宽 960px、无内部横向溢出。实际页面使用四个 synthetic arms、两道 case、回退、恢复和单点序列,运行中展开后图表仍为页面主内容,没有新增重复说明栏。

强反例是采样非 finite、时间倒序、超出 horizon、不同 normalization 混轴,或没有 flag 却生成 HTML。buildReport 和 scoreChart 会在输出前失败;normalization fixture 被拆成不同 section;CLI 只有显式 flag 才加入 HTML。受限的范围是 installed packaging、真实 campaign 数据、四个以上 arm 和辅助技术组合未验证。

PASS:campaign report suite 21 passed, 0 failed, 0 skipped。PASS:npm run typecheck:control-plane。PASS:exact-head loopx canary premerge 为 15 selected、0 failures;唯一 advisory 是未触及的 maintainability baseline。PASS:源码 CLI 生成的 HTML 在真实 Chromium 中完成 1280×900 与 390×844 检查。

我的整体评价 / Verdict

这次切片保留长期数据的全部观测和后续工作边界,只增加本地展示;narrow defect 修复没有改变 score 语义或默认输出。用户侧收益是无需另写绘图代码即可区分 running best 与回退,并且窄屏不再靠缩小文字换取适配。scoreChartWidth 也消除了 SVG/CSS 两处宽度假设的维护风险。

本次复用既有 Report、score_time_series、CLI 原子输出与纯投影结构,没有新增共享协议或持久状态。兼容性方向是保留 JSON/Markdown/CSV 默认和原输入;回滚可撤销 opt-in HTML 与 chart helper。残余风险是安装态、真实数据和大量 arm 的组合仍未知。

视觉检查结论:Actual source-built HTML was inspected at desktop and narrow widths with populated multi-arm, regressive and single-sample data. The chart remains the primary artifact, axis labels stay readable, the legend remains above the plots, and overflow stays local to the plot. 未覆盖范围是 Installed App packaging, very large arm counts beyond the synthetic four-arm fixture, zoom-assisted layout and real benchmark datasets were not exercised.

English verdict: APPROVE — head cf8dc74 resolves the narrow chart-label finding while keeping default report formats unchanged; 21 focused tests, TypeScript typecheck, 15/15 premerge and desktop/390px real-browser checks passed.

@huangruiteng
huangruiteng merged commit 456a1a3 into main Nov 5, 2026
5 of 7 checks passed
@huangruiteng
huangruiteng deleted the codex/benchmark-score-trajectory-view branch November 5, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants