Skip to content

fix(benchmark): retain partial results until native grading completes - #7762

Open
songoow wants to merge 1 commit into
mainfrom
codex/benchmark-grading-completion-20261101
Open

songoow wants to merge 1 commit into
mainfrom
codex/benchmark-grading-completion-20261101

Conversation

@songoow

@songoow songoow commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

The EdgeBench adapter currently writes final_result.json when worker execution is terminal, even when the native result explicitly says grading is pending or unknown. Native consumers use this filename as a completion marker, and the report exporter also accepts it without checking grading completion.

This change publishes explicit incomplete grading to partial_result.json and rejects such historical final markers at report export. It preserves the native scores, grading reason, runtime status, history and archives.

中文:执行结束不等于评分完成。显式未完成的评分现在保留为部分结果,避免下游把它计作已完成评测。

Outcome basis: a reproduced completion-marker defect through the actual publisher and exporter. Intended base: loopx-project/loopx:main at 04c5799b88f6c4cf12a224b7fa679f272e1e794e.

Author Declaration

Written by: model_agent — GPT-6 family, OpenAI; independently reviewed by a second model agent.

Implemented against

  • Existing completion-marker and partial-result contract: benchmark/edgebench/README.md and benchmark/runtime/RUNTIME.md at the base above.
  • Native result semantics inspected at EdgeBench 9cf691a3bdf9c5d7af042ae2d6042bc2fa5dabac. Its RunResult.to_dict() retains grading status; run_agent does not itself write the final marker.
  • The bounded repair in this PR supplies the previously missing explicit grading check; the edited documentation is not treated as independent proof.
Criterion Disposition Owner / decisive evidence
A completion marker must not represent explicitly incomplete grading implemented Shared native-result publisher; pending/unknown/null/future-state regression
Preserve partial native evidence and failed native Goal behavior implemented Full payload comparisons, runtime status, unchanged history/archive bytes
Preserve sources predating the grading field implemented Missing-field compatibility is distinct from explicit null or unknown
Reports must reject an old final marker with explicit incomplete grading implemented Actual exporter and real CLI rejection before creating output
Keep scoring, archive selection and execution classification with existing owners implemented Full diff and caller audit; no new scoring or retry policy

Self-check: reviewed the full diff, native producer and both active consumers; a separate reviewer executed the writer-to-exporter CLI matrix. Related #7082 and #6902 do not repair this publication boundary.

Changes

  • Move the existing file publisher into the small provider-specific result_publication.py owner. The runner imports that implementation directly; it does not retain a duplicate wrapper.
  • Use one completion predicate in publication and report export: a present grading_status must equal complete. A missing field retains the legacy behavior, without inventing a grading attestation.
  • Preserve atomic temporary-file replacement, partial scores/reasons, native Goal outcome handling and best-only coverage declarations.
  • Update existing provider fixtures that intend completed grading to say so when the provider supports the field.
  • Document execution completion separately from grading completion.

Scope And Continuation

Complete within the LoopX adapter's result-publication and report-export boundary. Worker status and CLI exit classification remain execution observations. This does not rescore submissions, choose a different incumbent, replace the current final archive with a historical best, wait beyond the existing grading budget, or rewrite frozen histories.

The independent native EdgeBench CLI is an upstream boundary and is not repaired by this adapter PR. Actual benchmark outcomes and performance gains require separate evidence.

Validation

Tested revision: 6190333d3492b3308897f0d22d32cc6c15cc82d1 (the published tree exactly matches the reviewed and tested source tree).
Run state: finished. Input classes: synthetic.

Check kind Result Public-safe evidence / limitation
regression_parity passed The original writer was first relocated with identical AST and the exporter unchanged; the decisive regression set failed 11 cases on that baseline behavior.
unit / integration passed python -m pytest -q benchmark/tests/test_edgebench_result_publication.py benchmark/tests/test_edgebench_report.py: 100 passed. Covers actual file publication, writer → exporter → verify, and rejection of incomplete historical final markers.
real_entrypoint passed Independent same-fixture writer → exporter CLI matrix: legacy/complete exported; pending/null stayed partial and simulated old final markers were rejected without creating a report directory. Native payload, history and archive bytes were preserved.
static passed Changed Python compilation, diff hygiene, staged bilingual-RFC gate, explicit ten-file public-boundary scan: zero errors. Two absent-optional-registry warnings are disclosed.
semantic advisory not_applicable The advisory tool excludes benchmark/; its unsupported scope is not counted as semantic coverage. This reuses native grading vocabulary and adds no shared enum or schema.
integration not_run Optional installed SForge/Harbor suites, Docker qualification, model/native benchmark tasks and full repository CI were not run locally.

The independent checks exercise the actual publication and exporter filesystem paths with synthetic native result objects. They do not qualify a provider or prove a scientific result.

Frontend / Visual Evidence

UI impact: none. No screen or rendering change; consumers receive the correct existing final/partial artifact. Source data: synthetic. Screenshots and preview: N/A.

Type of Change / LoopX Area

Bug fix, focused regression tests and contract documentation; benchmark adapter/evidence boundary. No authority-provider, routing, permission or scoring change. Shared-authority RFC fixture impact: N/A.

Boundary Checklist

  • The diff and PR contain no private state, credentials, raw trajectories/verifier output, internal links or host-local paths.
  • No live benchmark or model run was launched.
  • Dedicated codex/ worktree, latest target main verified, explicit staging and DCO sign-off.
  • No paired RFC changed; the staged bilingual gate passed.
  • UI impact is none.
  • Tested and independently reviewed source tree was verified byte-for-byte against the published Git tree.

Signed-off-by: song <22676124+songoow@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T18:43:39.467333Z 6190333 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@songoow songoow 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.

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

Reviewer: model_agent | GPT-6 Astra Pro | OpenAI | self_reported

审阅固定在 6190333d3492b3308897f0d22d32cc6c15cc82d1,基线 04c5799b88f6c4cf12a224b7fa679f272e1e794e。这是作者所属PR的COMMENT形式approval结论;未声称GitHub正式自我批准,也未执行合并。

未发现阻断性问题,代码审查结论为 APPROVE。 当前原生provider全量资格未在本环境重做;本次变更的producer/reader发布规则已用无provider依赖矩阵、真实export CLI和保留工件的完整内容对照覆盖。CI pending与合并时资格单独处理。

动机 / Motivation

受影响的是运行和汇总 EdgeBench 实验的维护者,以及把 final_result.json 当作运行完成标记的下游消费者。 求解进程已经停止时,原生评分仍可能 pending 或 unknown;旧发布器仍写 final_result,旧导出器也接受它,导致尚未完成评分的 attempt 看起来已经完整。 本次在写入和导出两端使用同一条原生评分完成规则,保留未完成尝试的分数、原因与历史,同时阻止明确未完成的评分被导出成终局结果。 范围是结果发布和离线导出,不重新评分、不替换当前归档为历史最好、不重写冻结历史,也不自动恢复执行或完成评分。

基线书面边界为 benchmark/runtime/RUNTIME.md,revision 04c5799b88f6c4cf12a224b7fa679f272e1e794e:native-score-authority 对应保留原生评分且工件不授予资格,frozen-history 对应新source pin用于新attempt、历史receipt不改写。这两个标识是本审查给未编号要求的引用名。基线README曾写handled terminal保留final,本PR正是明确纠正这个过宽规则;不把修改后的文档循环当成既有验收证据。

改动思路 / Approach

原生 provider 继续拥有评分事实与排序,result_publication 只拥有完成标记谓词,writer 与 exporter 共享该谓词;没有第二个评分或资格判定 owner。 当前 PR 的独立边界是原生结果到 final/partial 工件再到公开报告的完整发布链,provider 执行、预算和冻结历史保持原有边界。 只有writer修复会放过历史已误写的final,只有export修复则继续误导只按文件名判断完成的消费者,所以两端共享检查是最小完整修复。字段缺失被保留为旧来源格式,而显式null或未知值不能冒充legacy;缺失兼容不增加评分已完成的attestation。没有新状态表、命令开关或自动历史迁移。

具体改动 / Changes

关键代码讲解

  • native_grading_complete(result_publication.py:6)是唯一完成谓词:字段缺失保留原legacy行为,存在时只接受精确complete。writer与exporter都调用它,pending、unknown、null、未来值不会各有一套处理规则。
  • write_native_result(result_publication.py:11)复用原writer,完整保留result.to_dict();执行terminal但评分不完整时写partial并保留runtime_status: terminal和原生reason/score。native Goal完成不能覆盖pending grading,反过来评分complete也不能把failed/cancelled Goal升级为final。best-only的online_only与offline_scoring_complete=false保持。
  • export(export_report.py:207,新增检查:238)在任何output目录写入前读取相同谓词,既拦新结果,也拒绝历史误写final。现有身份、模型、score/history与countability绑定继续执行,不改评分、排序或qualify状态。native-score-authority 与 frozen-history 均得到对应测试和源文件hash证据。

我也检查了“partial写入后旧final残留”的真实入口:正常run.main要求新trial目录(exist_ok=False);warm路径先拒绝已经存在的run父目录,restore后的exist_ok=True只用于本次已经被native owner创建的新目录。writer不是同一旧trial上的重复发布API,补丁没有引入合法复用旧final的路径,也不应为消除这种假设去改写冻结文件。

验证与兼容

本轮focus Python原始记录为126 passed、302 skipped、exit0,覆盖独立publisher与report矩阵;缺SForge/Harbor/Docker的测试明确保留skip。Ruff记录通过,本次另复核base到head的git diff --check通过。实际CLI针对legacy、complete、pending、unknown各在base/head运行:前两者均exit0;后两者base错误导出,而head exit1、不生成输出,所有源文件保持原hash。null/future状态和native outcome交叉情况由无provider依赖矩阵覆盖。

进一步检查原CLI保留工件,先将输入fixture fingerprint与日志绑定,再比较legacy/complete各5个实际导出文件(4份数据加index)的SHA256:全部字节一致,没有只把“runs=1/files=4”的摘要相等当作完整兼容证明。publication测试同时断言run_history、当前final archive与历史submission archive字节保持,未拿历史最好归档替换当前结果。

对主干的风险 / Risks

主要兼容风险是旧provider和冻结receipt没有grading_status;保留此分支有明确消费者与持久数据依据,不能要求补写complete来伪造新证明,也不应无迁移条件删除。适当退休时机是旧来源与历史读取被明确停止支持,本次不新增第二套版本协议。新规则会让显式不完整的旧final导出失败,这是预期纠正;源证据仍保留,读者能看到真实native reason。

长期工作能力由保留原生评分权威、历史和合法导出路径来维持:已有complete/legacy仍可用,不完整状态不能被误晋升。本PR不提供或声称自动pending转complete、自动resume或自动重评分;后续真实评分仍归原owner。当前快照没有failed checks,尚有pending及条件跳过任务;本次changed invariant已有独立覆盖,pending本身不否决代码审查。合并仍需按配置做fresh head与CI/readiness检查。

我的整体评价 / Verdict

这是范围合理的生产修复:约30行共享发布模块替代原局部函数,两个真实消费者共同使用,测试覆盖新拒绝、旧兼容、未知值与native outcome交叉,不是仅增加报告标签。6190333d3492b3308897f0d22d32cc6c15cc82d1 的代码与已执行证据支持批准。本PR没有渲染页面变化;检查了实际JSON/CSV导出文件与绑定验证,视觉布局验收不适用。 原生provider全量资格、评分效率与模型采纳均未验证,也不包含在本次approval主张里;没有因此要求本PR重建未改变的provider系统。

English verdict: APPROVE — exact head 6190333; shared publication/export checks prevent explicit incomplete grading from becoming a final result while preserving native evidence and byte-identical legacy/complete exports. This author-owned PR uses a COMMENTED approval conclusion; merge readiness remains separate.

This branch has not been deployed

No deployments
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.

1 participant