anthropics / anthropics/claude-plugins-official

skill-creator: aggregate_benchmark.py silently zeroes total_tokens and hardcodes runs_per_configuration

未關閉 適合新手
#5,723 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
36.3k
分支
4.1k
平均合併
2 天 14 小時
30 天內合併 PR
539

描述

`skills/skill-creator/scripts/aggregate_benchmark.py` has two metric-corrupting bugs, both reproducible by reading the code:

**1. `total_tokens` is only read when timing is missing from grading.json** (~line 140). The token count lives inside the fallback branch:

```python
result["time_seconds"] = timing.get("total_duration_seconds", 0.0)
timing_file = run_dir / "timing.json"
if result["time_seconds"] == 0.0 and timing_file.exists():
...
result["time_seconds"] = timing_data.get("total_duration_seconds", 0.0)
result["tokens"] = timing_data.get("total_tokens", 0)
```

When `grading.json` carries timing (the normal case), the branch never runs and `tokens` stays 0 — the benchmark reports zero token cost with no warning. Fix: read `total_tokens` unconditionally from `timing.json` (or from grading.json's timing block if it carries one).

**2. `runs_per_configuration` is hardcoded to `3`** (~line 270, in `benchmark["metadata"]`), regardless of how many runs actually aggregated. Any benchmark run with a different N reports wrong metadata, and downstream variance analysis that trusts it divides by the wrong count. Fix: derive it from the runs actually collected.

Observed on plugin cache version `ed404106fcd8`, running benchmarks locally on real skills; both persisted across a plugin update.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start with skills/skill-creator/scripts/aggregate_benchmark.py, reading the timing/grading parsing around line 140 and benchmark metadata construction around line 270. Run a local benchmark with grading.json timing present and with a run count other than three; done means the aggregated token total is populated and runs_per_configuration matches the runs collected.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
testing
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
活躍
描述清晰度
描述清楚
新手友好度
82/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。