Major Features: - Debug counter infrastructure for Refill Stage tracking - Free Pipeline counters (ss_local, ss_remote, tls_sll) - Diagnostic counters for early return analysis - Unified larson.sh benchmark runner with profiles - Phase 6-3 regression analysis documentation Bug Fixes: - Fix SuperSlab disabled by default (HAKMEM_TINY_USE_SUPERSLAB) - Fix profile variable naming consistency - Add .gitignore patterns for large files Performance: - Phase 6-3: 4.79 M ops/s (has OOM risk) - With SuperSlab: 3.13 M ops/s (+19% improvement) This is a clean repository without large log files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
36 lines
1.8 KiB
Markdown
36 lines
1.8 KiB
Markdown
# CURRENT SPEC (SACS‑3)
|
||
|
||
## Hot Path
|
||
- サイズでTier決定: Tiny(≤1KiB) / L1 ACE(1KiB–<2MiB) / L2 Big(≥2MiB)
|
||
- RCUスナップショット `FrozenPolicy` を関数冒頭で1回load、以後読み取りのみ
|
||
- `clock_gettime()` のような重い処理はホットパス禁止(サンプリングのみ)
|
||
|
||
## Layers
|
||
- Tiny: TLS Magazine + TLS Active Slab + MPSC remote‑free
|
||
- L1 ACE:
|
||
- Mid: 2/4/8/16/32 KiB(+DYN1: 環境で1枠可変)
|
||
- Large: 64/128/256/512 KiB/1 MiB
|
||
- W_MAX 丸め: `class ≤ W_MAX × size` のとき上位クラス許可
|
||
- 32–64KiB ギャップはW_MAXで64KiB吸収
|
||
- L2 Big: BigCache + mmap(THPゲート)
|
||
|
||
## Learning
|
||
- CAP学習(実装済)
|
||
- 別スレッドで窓ごとにヒット/ミス差分→ヒット率 vs 目標(Mid 0.65 / Large 0.55)で CAP ±Δ
|
||
- 予算制約(任意)とヒステリシス
|
||
- Soft CAPでリフィル強度を調整(Over: bundle=1 / Under: ≤4, 下限はENV)
|
||
- DYN1(可変Midクラス×1)
|
||
- `HAKMEM_MID_DYN1=<bytes>` で1枠有効化、ACE候補に追加、Poolは完全一致で判定
|
||
- DYN1専用CAP: `mid_cap_dyn1`(学習対象)
|
||
- しきい値(mmap)
|
||
- `FrozenPolicy.thp_threshold` をホットパスで使用(既定 2MiB)。
|
||
- 学習(オプション)で離散候補を回し、将来的にUCB1/Canaryで最適化(現状はラウンドロビン採用の簡易版)。
|
||
|
||
## ENV(抜粋)
|
||
- 学習: `HAKMEM_LEARN=1`, `HAKMEM_LEARN_WINDOW_MS`, `HAKMEM_TARGET_HIT_MID/LARGE`, `HAKMEM_CAP_STEP_MID/LARGE`, `HAKMEM_BUDGET_MID/LARGE`
|
||
- CAP手動: `HAKMEM_CAP_MID=a,b,c,d,e`, `HAKMEM_CAP_LARGE=a,b,c,d,e`, `HAKMEM_CAP_MID_DYN1`
|
||
- W_MAX: `HAKMEM_WMAX_MID`, `HAKMEM_WMAX_LARGE`
|
||
- DYN1: `HAKMEM_MID_DYN1=<bytes>`
|
||
- ラッパー内L1許可: `HAKMEM_WRAP_L2=1`, `HAKMEM_WRAP_L25=1`
|
||
- Midリフィル最小バンドル: `HAKMEM_POOL_MIN_BUNDLE`(既定2)
|