[Other] tools/ab_engine.py reuses ab_<arm>_r<n>.log in the temp dir across runs, so a later A/B appends its engine logs to an earlier one

未关闭 适合新手
#4,545 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

@ctr-137 已经在做这个了。

开始于 2026年10月29日。

  • #4647 来自 @ctr-137 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
tooling

调研方向

先阅读 tools/ab_engine.py,重点查看第 96 行附近的日志路径设置,以及各个引擎的启动位置。检查服务器如何打开已配置的日志,并运行复现步骤中的两个 A/B 命令。完成的标准是:之后使用相同臂名称运行时不再包含先前的引擎输出,或者工具能明确标识每次运行各自的日志。

由索引模型根据 Issue 内容生成。

描述

Area

[Other] (a tool under tools/)

Desktop app, Terminal or source?

Source

What happened

tools/ab_engine.py gives every arm's engine a log file with a fixed name in the temp directory:

cfg["log"] = str(Path(tempfile.gettempdir()) / f"ab_{name}_r{rnd}.log")     # line 96
cpath = Path(tempfile.gettempdir()) / f"ab_{name}.json"

and the server opens a config's log in append mode on purpose (open(log, "a", ...), #779, so a crash report keeps the time). So a second A/B run days later, with the same arm letters, appends its engine output to the first run's files. After two sessions (2026-10-26 and 2026-10-28) ab_B_r1.log holds six [strata] … engine started: blocks from engines with different binaries and different env settings. A grep for a feature line (for me: the int8 crossover line) then finds the earlier session's arm B and looks like the current engine ignored its environment. It cost me an hour on 2026-10-26 before I noticed the dates on the engine started lines.

Expected: a run of the tool starts from empty engine logs, or tells where this run's logs are.

Suggestion: truncate the file before each start (Path(cfg["log"]).write_text("")), or put each run's files in a tempfile.mkdtemp(prefix="ab_engine_") and print that path once.

Smallest steps or command that reproduce it
  1. python tools/ab_engine.py cfg.json A:STRATA_X=1 B:STRATA_X=2 --rounds 1
  2. run it again with any arms named A and B
  3. grep -c 'engine started' $TMPDIR/ab_B_r0.log → 2 (and more with every run)
Reproduction status

Reproduced locally

Strata version

Source checkout v0.2.7.1 (46c152a1), engine 0.1.53; tools/ab_engine.py is identical on main today

Graphics card, memory and system

Intel Arc Pro B70 32 GB · 62 GB RAM · Debian 13 (not GPU specific)

Model, size and settings

Qwen3.8-Flash-Next IQ3_S (not relevant)

Logs

grep -n 'engine started' ab_B_r1.log after the two sessions: six lines, dated 2026-10-26 03:54 to 2026-10-28 20:52.

主要语言
C++
星标
11.6k
派生
1k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Niko1221/Strata 的其他 Issue

查看 Niko1221/Strata 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。