Files
hakmem/docs/analysis/BENCH_REPRODUCIBILITY_SSOT.md
Moe Charm (CI) 89a9212700 Phase 83-1 + Allocator Comparison: Switch dispatch fixed (NO-GO +0.32%), PROFILE correction, SCORECARD update
Key changes:
- Phase 83-1: Switch dispatch fixed mode (tiny_inline_slots_switch_dispatch_fixed_box) - NO-GO (marginal +0.32%, branch reduction negligible)
  Reason: lazy-init pattern already optimal, Phase 78-1 pattern shows diminishing returns

- Allocator comparison baseline update (10-run SSOT, WS=400, ITERS=20M):
  tcmalloc: 115.26M (92.33% of mimalloc)
  jemalloc: 97.39M (77.96% of mimalloc)
  system: 85.20M (68.24% of mimalloc)
  mimalloc: 124.82M (baseline)

- hakmem PROFILE correction: scripts/run_mixed_10_cleanenv.sh + run_allocator_quick_matrix.sh
  PROFILE explicitly set to MIXED_TINYV3_C7_SAFE for hakmem measurements
  Result: baseline stabilized to 55.53M (44.46% of mimalloc)
  Previous unstable measurement (35.57M) was due to profile leak

- Documentation:
  * PERFORMANCE_TARGETS_SCORECARD.md: Reference allocators + M1/M2 milestone status
  * PHASE83_1_SWITCH_DISPATCH_FIXED_RESULTS.md: Phase 83-1 analysis (NO-GO)
  * ALLOCATOR_COMPARISON_QUICK_RUNBOOK.md: Quick comparison procedure
  * ALLOCATOR_COMPARISON_SSOT.md: Detailed SSOT methodology

- M2 milestone status: 44.46% (target 55%, gap -10.54pp) - structural improvements needed

🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 18:50:00 +09:00

49 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Bench Reproducibility SSOTころころ防止の最低限
目的: 「数%を詰める開発」で一番きつい **ベンチが再現しない問題**を潰す。
## 1) まず結論(よくある原因)
同じマシンでも、以下が変わると 515% は普通に動く。
- **CPU power/thermal**governor / EPP / turbo
- **HAKMEM_PROFILE 未指定**route が変わる)
- **export 漏れ**(過去の ENV が残る)
- **別バイナリ比較**layout tax: text 配置が変わる)
## 2) SSOT最適化判断の正
- Runner: `scripts/run_mixed_10_cleanenv.sh`
- 必須:
- `HAKMEM_PROFILE=MIXED_TINYV3_C7_SAFE` を明示
- `RUNS=10`(ノイズを平均化)
- `WS=400`SSOT
- 任意(切り分け用):
- `HAKMEM_BENCH_ENV_LOG=1`CPU governor/EPP/freq をログ)
## 3) referenceallocator間比較の正
allocator比較は layout tax が混ざるため **reference**
ただし “公平さ” を上げるなら同一バイナリで測る:
- Same-binary runner: `scripts/run_allocator_preload_matrix.sh`
- `bench_random_mixed_system` を固定して `LD_PRELOAD` を差し替える
## 4) “ころころ”を止める運用(最低限の儀式)
1. SSOT実行は必ず cleanenv:
- `scripts/run_mixed_10_cleanenv.sh`
2. 毎回、環境ログを残す:
- `HAKMEM_BENCH_ENV_LOG=1`
3. 結果をファイル化(後から追える形):
- `scripts/bench_ssot_capture.sh` を使うgit sha / env / bench出力をまとめて保存
## 5) 重要メモAMD pstate epp
`amd-pstate-epp` 環境で
- governor=`powersave`
- energy_perf_preference=`power`
のままだと、ベンチが“遅い側”に寄ることがある。
まずは `HAKMEM_BENCH_ENV_LOG=1` の出力が **同じ**条件同士で比較すること。