From 452d2f2642d789f61451880eca03dd8a7253892a Mon Sep 17 00:00:00 2001 From: lili Date: Sat, 27 Jun 2026 07:00:01 -0700 Subject: [PATCH] =?UTF-8?q?feat(cheap-worker):=20bake-off=20=E5=8A=A0=20--?= =?UTF-8?q?offset=20=E6=94=AF=E6=8C=81=E8=A1=A5=E8=B7=91=E4=B8=8D=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E6=97=A2=E6=9C=89=E6=89=B9(M1=20U3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补跑 click-score(确认满批 5/7 是否抖动)需 gid 从 offset 起、不覆盖 bake--0..6; run_bakeoff 加 offset 参数,gid=bake--。单测 11/11 仍绿。 Co-Authored-By: Claude Opus 4.8 (1M context) --- cheap-worker/bake_off.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cheap-worker/bake_off.py b/cheap-worker/bake_off.py index b38b2aa7..5dfc71ff 100644 --- a/cheap-worker/bake_off.py +++ b/cheap-worker/bake_off.py @@ -97,7 +97,7 @@ def run_one_sync(genre_key: str, brief: str, k: int, port: int, cdp: int) -> dic "failedGates": (v or {}).get("failedGates"), "costRmb": summary.get("costRmb")} -async def run_bakeoff(genre_keys: list, n: int, conc: int = 1, +async def run_bakeoff(genre_keys: list, n: int, conc: int = 1, offset: int = 0, base_port: int = 4320, base_cdp: int = 9222) -> dict: """三品类 × n 达标批跑:逐款 run_studio(自动 spec 九门),按品类聚合 ≥80%。 @@ -128,7 +128,7 @@ async def run_bakeoff(genre_keys: list, n: int, conc: int = 1, port, cdp = await pool.get() try: print(f"[{key} {k + 1}/{n}] port={port}/{cdp} 生成→自动spec→九门 …", file=sys.stderr) - r = await asyncio.to_thread(run_one_sync, key, brief, k, port, cdp) + r = await asyncio.to_thread(run_one_sync, key, brief, offset + k, port, cdp) genre_runs[key].append(r) print(f"[{key} {k + 1}/{n}] passed={r['passed']} finished={r['finished']} cost={r['costRmb']}", file=sys.stderr) @@ -170,8 +170,9 @@ if __name__ == "__main__": help="逗号分隔品类键(默认三 tap-targets 代表品类)") ap.add_argument("--n", type=int, default=7, help="每品类款数(20 款收口约每品类 7;小批联调用 1–2)") ap.add_argument("--conc", type=int, default=1, help="并发款数(端口池+线程,≤15;本机 Chrome 建议 ≤4)") + ap.add_argument("--offset", type=int, default=0, help="gameId 起始索引(补跑用,避免覆盖既有 bake--)") a = ap.parse_args() keys = [k.strip() for k in a.genres.split(",") if k.strip()] - rep = asyncio.run(run_bakeoff(keys, a.n, conc=a.conc)) + rep = asyncio.run(run_bakeoff(keys, a.n, conc=a.conc, offset=a.offset)) # 退出码:整体达标 0、未达标 1。 sys.exit(0 if rep["overallMeets"] else 1)