feat: add ContinuousCasting domain (CuttingOptimization + CuttingOptimizationOnline) - #107
feat: add ContinuousCasting domain (CuttingOptimization + CuttingOptimizationOnline)#107zzy2007zzy2007 wants to merge 6 commits into
Conversation
…mizationOnline) Two original benchmarks inspired by CUMCM 2021 Problem D, formalized into deterministic, stdlib-only, verifiable optimization tasks. - CuttingOptimization (offline): cut a continuously cast billet (with fixed 0.8 m scrap segments) into pieces to minimize total scrapped length, then match a customer target. Reference DP = 88.7, baseline = 72.5; the optimum is reachable (openevolve hits 88.7). - CuttingOptimizationOnline (closed-loop): scrap segments are revealed only within a reveal_lead horizon; the agent decides each cut with only the visible past and is scored against the full hidden defect set. Clairvoyant reference = 76.4, baseline = 52.4, agents (3 frameworks x 3 runs) = 70.43 +- 0.83 — an online agent cannot reach the clairvoyant optimum (info asymmetry), which is the key difference vs offline. Integrity/anti-cheat mirrors the accepted CVRP/TelecomBackup benchmarks: reference solver and generator excluded from the sandbox + forbidden by the validator, FRONTIER_* env stripping (host side-channel), runtime instance generation, EVOLVE-BLOCK fixed-region check, determinism probe, sandbox-evaluator test coverage, multiseed_stat tool, and honest README/Task docs. Unit tests: 35 (offline) + 23 (online) pass.
Address reviewer feedback on the new ContinuousCasting benchmarks:
- online (threat model, high): fixed instances embedding the hidden defect schedule are no
longer copied into the sandbox (copy_files.txt drops verification/data/instances); the
evaluator loads them from the host source benchmark dir, so a candidate cannot read the
hidden defects out of a data file.
- online: unify naming/default to reveal_lead = 10.0 (generator default 60.0 -> 10.0; docs
reveal_dist/8.0 -> reveal_lead/10.0).
- online: scoring now applies the 1e-4 target-fit penalty in the utilization (matches the
offline formula; the docs already claimed it), so equal-scrap plans are tie-broken.
- online: Task.md interface section now matches the per-decision-call implementation (was
stale REPL text with wrong state keys).
- offline: titles disambiguate as offline/static ('连铸切割优化(离线/静态版)') so they are
not confused with the online task.
- online: remove a duplicated/stale README note; soften the 'cannot reach' claim to an
empirical observation + note the optional online-oracle reference layer.
Address second reviewer pass on CuttingOptimizationOnline: - multiseed_stat.py: DEFAULT_REFERENCE 88.72 (offline) -> 76.37 (online clairvoyant), and the docstring/usage example now point at the online run dir; README notes the tool aggregates every run in the dir (restrict via sub-glob for config-specific stats). - simulator.py: DEFAULTS reveal_lead 60.0 -> 10.0 (final config; no silent 'faithful' default), docstring updated for the penalty-inclusive util formula. - Tie-break is no longer rounded away: simulator keeps util at 4 decimals and evaluate rounds combined_score to 3 decimals, so the 1e-4 target-fit penalty (order ~1e-3 util) actually discriminates equal-scrap plans (matches the offline formula).
…DETAILS Align TASK_DETAILS rows with the Task/README framing: the online info-asymmetry claim is an observed effect (3 frameworks x 3 runs each below the clairvoyant ceiling), not a proven lower bound. EN/ZH rows now use 'empirically keeps below' / '(经验上)低于' wording.
Ran unified runtime in task.runtime.isolation_mode=docker under WSL for both benchmarks (FRONTIER_EVAL_UNIFIED_DOCKER_USER=1000:1000, no shell override, docker_image built from the task Dockerfile). Offline baseline scored 72.49 / valid=1.0 and online baseline 52.40 / valid=1.0, identical to process mode — so docker isolation scoring is verified (not just documented), and for the online task this also confirms the anti-cheat holds in-container (fixed instances with the hidden defect schedule stay out of the sandbox; the evaluator reads them from the container's mounted source repo).
🤖 AI Code Review (gemini-3-flash-preview)🇬🇧 English Analysis1. Executive Summary
2. AI Content Analysis
3. Engineering & Economic Assessment
4. Quality Assurance
5. Security & Privacy Check
🇨🇳 中文分析1. 摘要
2. AI 成分分析
3. 工程与经济评估
4. 质量保证
5. 安全与隐私检查
|
y-ji24
left a comment
There was a problem hiding this comment.
Review — ContinuousCasting
Thank you for the contribution. Overall, ContinuousCasting is a solid and fairly mature benchmark. The simulator, baselines, reference solutions, tests, and Frontier-Eng integration are generally well implemented. I was able to reproduce the baseline scores, and all 58 unit tests pass.
Before merging, I found the following issues that should be addressed.
1. Major — Online hidden defects are accessible in the local evaluation path
The online task relies on information asymmetry: the agent should only see defects within the configured reveal window. However, I constructed a candidate that reads ../verification/data/instances/*.json, computes the clairvoyant DP solution, and replays the cuts.
Running it through the real evaluator produced:
score = 76.371valid = 1.0
This essentially reaches the clairvoyant ceiling of 76.4 while passing the static checks and deterministic probe.
The Docker/sandboxed path correctly excludes the instance files, but the documented local evaluation path does not. Therefore, the hidden-defect guarantee is currently environment-dependent.
Recommendation: Make isolated evaluation mandatory for authoritative scores, or explicitly state that the secrecy guarantee only applies to the sandboxed/Docker path.
2. Major — Runtime-generated instances are not enforced by the default evaluation path
Runtime-generated instances are the main defense against memorizing the fixed public instances, but generation is currently opt-in through environment variables and is not enforced by the task configuration.
The default evaluation therefore uses the 8 public instances. These can be memorized; for the online task, instances can also be fingerprinted through observable properties such as total_length. For the offline task, optimized plans can similarly be embedded using instance characteristics.
Recommendation: Make fresh generated instances mandatory for official evaluation and treat the fixed instances as calibration/smoke-test cases.
3. Major — The documented reference-score command does not reproduce the reference score
The documented verification/evaluate.py ref_solver.py path returns 0.0 because the reference solver is rejected during candidate preflight. The reported reference scores themselves are correct when evaluated through direct simulation.
Recommendation: Provide a dedicated reference-scoring path, or document the exact direct-scoring procedure used to obtain the reported scores.
4. Major — Time-budget semantics are inconsistent with the framework timeout
The online task's 60-second budget is per decision, while the framework-level timeout is 300 seconds for the entire evaluation. An instance may require roughly 10–35 decisions, so a legitimate candidate can exceed the framework timeout.
The offline task can also exceed the 300-second cap once all instances and deterministic probes are included.
Recommendation: Reconcile the task-level and framework-level time budgets and document the expected worst-case evaluation time.
5. Minor — Online EVOLVE-BLOCK protection is not actually enforced
The online evaluator calls check_candidate(prog) without the baseline program, so the fixed-region comparison described by the validator is not applied in this path.
The practical impact is limited, but the documented defense does not fully match the implementation.
Recommendation: Apply the same fixed-region check to the online evaluator, or update the documentation accordingly.
6. Minor — Offline scoring loses tie-break precision
The offline evaluator rounds utilization to two decimal places. Given the 1e-4 penalty weight, some secondary-objective differences can disappear after rounding.
Recommendation: Preserve sufficient precision if the secondary objective is intended to affect the final ranking.
7. Minor — Documentation inconsistencies
A few smaller issues should also be cleaned up:
- Use consistent wording for the reference DP: it is a grid-quantized empirical ceiling rather than a strict theoretical optimum.
- Remove duplicated paragraphs/comments in the online README.
- Report the reference score consistently as approximately 88.71/88.7 rather than mixing 88.7 and 88.72.
- Clearly distinguish fixed-instance calibration results from fresh-instance evaluation results.
Documentation / Collaboration
Please also keep the PR description, task introduction, README-facing explanations, and other repository-facing documentation in English.
Overall
The core benchmark is in good shape, and these issues do not require a major redesign. The main concern is that several parts of the evaluation protocol do not yet fully match the benchmark's stated threat model and reproducibility requirements.
I recommend addressing the two evaluation-integrity issues first, followed by the reference-score and timeout inconsistencies, and then the validator and documentation issues.
Recommendation: REQUEST CHANGES.
新增
ContinuousCasting域:CuttingOptimization+CuttingOptimizationOnline背景
题材取自 2021 全国大学生数学建模竞赛 D 题的连铸切割工程背景;本贡献将其重新形式化为两个确定性、纯标准库、可验证的 benchmark(
ContinuousCasting域,下辖两个任务)。1.
CuttingOptimization(离线/静态版)verification/ref_solver.py)= 理论最优;baseline 为朴素等分。2.
CuttingOptimizationOnline(在线闭环版)reveal_lead(最终配置 10 m)以内时"得知"该段异常,每个切割决策点只拿到当下可见状态,看不到未来;最后按完整隐藏报废表评分(任何与报废段重叠的切块整块报废)。reveal_lead=10(制造"未知带"、体现信息不对称)。"在线 agent 低于全知最优"属经验观察(3 框架 × 3 次均低于 76.4),非严格下界证明;如需坐实可另加"仅用可见信息的在线 oracle"参照层。完整性 / 防作弊
ref_solver.py/generator.py不进沙箱并被 validator 禁引用(ref_solver、generator、anomaly_seedtoken)。copy_files.txt去掉verification/data/instances),评测器从宿主源目录加载——候选无法读取隐藏报废表作弊。FRONTIER_*及任务前缀环境变量(封宿主侧信道)。frontier_eval/evaluator.py)有测试覆盖;verification/multiseed_stat.py供多轮 mean±std。文件
benchmarks/ContinuousCasting/:两个 task 全套(baseline / verification / frontier_eval / Docker / README / Task.md)。ContinuousCasting域两行:TASK_DETAILS.md/TASK_DETAILS_zh-CN.md。