fix: predictions row carries arm run_id under shared gate_log; drain evolve gather on failure (algo #6)

This commit is contained in:
2026-07-17 03:52:19 -04:00
parent 23a64042fe
commit 0b839937df
5 changed files with 90 additions and 18 deletions
+4
View File
@@ -409,7 +409,11 @@ async def _run_single_question(
返回:
预测结果字典(含 video_id, question_id, prediction, answer 等)。
"""
# run_id 必须显式入 record:HarnessLog.insert 缺省用**实例** run_id 填充,
# 连续并发 gate 共享单一 gate_log(实例 run_id 为 step 级)时,各臂行必须
# 落自己的臂 run_id,否则 validate 回读 _load_run_rows(臂 run_id) 为空。
record: dict[str, Any] = {
"run_id": run_id,
"video_id": qa.video_id,
"question_id": qa.question_id,
"task_type": qa.task_type,
+11 -7
View File
@@ -1370,13 +1370,17 @@ class Runner:
rejected=state.rejected_buffer.get(task_type, []),
)
records = dict(
zip(
active_types,
await asyncio.gather(*[_evolve_one(t) for t in active_types]),
strict=True,
)
)
# 首异常先取消其余进化任务并排水再向上传播(与 validate_skills_concurrent
# 同款语义):避免失败后残留 in-flight LLM 任务与 pending task 警告。
tasks = [asyncio.ensure_future(_evolve_one(t)) for t in active_types]
try:
evolved = await asyncio.gather(*tasks)
except BaseException:
for task in tasks:
task.cancel()
await asyncio.gather(*tasks, return_exceptions=True)
raise
records = dict(zip(active_types, evolved, strict=True))
# 无真实改动的题型照旧写 skipped 后出队
gated: dict[str, EvolutionRecord] = {}