Fix Moli benchmark harness and add opt-in layout recovery - #25
lanyue-llk wants to merge 35 commits into
Conversation
Review: no blocking findings in #25The stated goal matches the changed paths: the macOS Selenium process tracking addresses the platform-specific infrastructure failure; the download progress helper attaches a rejection handler before awaiting a potentially slow click and removes the CDP listener; routing I reviewed the runner, adapter, cohort comparator, task correction, and relevant tests. The consolidated CI check passes. Locally, 26 download/CDP/cohort tests passed on the #27 tree (which contains #25 unchanged), and both PR diffs pass |
Add opt-in layout reruns for failed Moli cases
| reporter.phase(f"Failed after {reporter.completed_rows}/{reporter.total_rows} result rows") | ||
| raise BenchError("parallel run failed for some attempts:\n" + "\n".join(errors[:10])) | ||
| reporter.finish() | ||
| if "moli" in selected_engines and args.moli_layout == "off" and getattr(args, "try_layout", False): |
Chromium baseline correctionThe two Chrome 151 non-passes in
Targeted verification used Chrome for Testing Verification:
|
There was a problem hiding this comment.
Independent review — 1ab9c552077b2d25d1333583c3c3881e8ddb4997
Reviewed the PR diff and the current fixed --moli-layout off/on execution, attempt summaries, resource collection, and evidence validation. I found two reproducible issues:
[P2] Normalize the cohort run ID before deriving paths and receipts
tools/run_moli_cohort.py:82–83 builds its run directory and conditions receipt from the original argument, although line 69 accepts hyphens and arbitrary lengths. The invoked runner applies compact_run_id() in reserve_run_dir(). Directly exercising that real reservation function gives:
release-1_1_9→release_1_1_9; the wrapper's expected directory does not exist.- An 80-character
xID →xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_d929cdee; the wrapper's expected directory does not exist.
Consequently the benchmark can finish successfully, then the wrapper fails while opening run_manifest.json, with its conditions receipt stored under a different ID. Case folding also changes the receipt's recorded identity even on a case-insensitive filesystem. Normalize once with the runner's canonical function before collision checks, receipt creation, and command construction, or reject noncanonical IDs before any mutation. Add a wrapper-level regression covering a hyphenated ID and a compacted ID.
[P2] Bind each resource measurement to the certified binary
tools/summarize_moli_macos_resources.py:144–145 validates each row's layout but never checks its engine_provenance.binary_sha256 against the manifest/receipt. Using the existing two-task resource fixture, changing one off-run row's binary hash from 999…999 to aaa…aaa, and calling summarize_fixed_pairs() still returns quality.publishable: true and attributes that measurement to 999…999.
A stale or mixed-binary results file is therefore accepted as the certified candidate. Check every row's binary hash against the certified identity and reject missing identities as well. The fixed-layout accuracy summarizer already performs this check. Add negative controls for both mismatched and missing row hashes, alongside the valid cohort case.
Validation performed: 127 passed, 8 skipped across test_moli_fixed_layout.py, test_summarize_moli_fixed_layout.py, test_summarize_moli_macos_resources.py, test_framework_driver.py, and test_resources.py. The two reproductions above were run independently in temporary directories; no repository or measured evidence was changed. No additional actionable finding in the removal of layout retries itself.
Reproduction entry points, from the repository root with its Python dependencies installed:
from pathlib import Path
from tempfile import TemporaryDirectory
from runner.run import reserve_run_dir
with TemporaryDirectory() as tmp:
print(reserve_run_dir(Path(tmp), "release-1_1_9", "error")[0])
print((Path(tmp) / "release-1_1_9").exists()) # FalseFor the second finding, use the _run, _receipt, _protocol, and _write_jsonl fixtures in test/test_summarize_moli_macos_resources.py; create the off/on runs, change off/results.jsonl row 0's engine_provenance.binary_sha256, and call summarize_fixed_pairs(off, on, receipt, protocol, expected_tasks=2, expected_frozen_calls=5). The returned quality.publishable is True despite the mismatch.
|
已处理独立 review 的两项问题,修复提交
新增五个参数化回归。独立审查 agent 已复核修改,相关 23 项测试通过;原“错误 binary 仍 publishable”的复现现在按预期抛出 |
Scroll agent-browser and Ferrum targets into view before clicking
* Apply automation profile to Moli and set explicit viewport * test: cover automation profiles for supported engines
Summary
Consolidate the Moli benchmark infrastructure and fixed-layout comparison tooling. No Moli source code or binary is modified.
Infrastructure and reproducibility
Schema.*CDP probes through the page session unless explicitly browser-scoped. Preserve historical measured results while correcting routing notes.Fixed layout only
--moli-layout offand--moli-layout onselect one mode for the entire run.--try-layout, failed-case rescheduling, replacement matrices, recovery receipts, retry-only artifact paths, the recovery summarizer and its design documentation.results.jsonlruns. The CLI accepts repeated--source RUN_DIRarguments for disjoint task batches, preserving layout and binary checks.Evidence and reports
benchmarks/moli-0.1.1-failure-task-ids.txtremains the original 372-case input cohort. New-version successes do not prune that historical definition.Verification
pw_raw_browser_getversionv2_diag_gbcr_fixedv4_cdp_emulation_setemulatedostextscale1ab9c55.automode are rejected. Fixed off/on remain accepted; legacy mixed-layout evidence is rejected.