Files
hakmem/docs/specs/CURRENT_SPEC.md
Moe Charm (CI) 52386401b3 Debug Counters Implementation - Clean History
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>
2025-11-05 12:31:14 +09:00

36 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.

# CURRENT SPEC (SACS3)
## 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 remotefree
- L1 ACE:
- Mid: 2/4/8/16/32 KiBDYN1: 環境で1枠可変
- Large: 64/128/256/512 KiB/1 MiB
- W_MAX 丸め: `class ≤ W_MAX × size` のとき上位クラス許可
- 3264KiB ギャップはW_MAXで64KiB吸収
- L2 Big: BigCache + mmapTHPゲート
## 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