7f9e4015da
docs: Update ENV_VARS.md with Phase 3 additions
...
Added documentation for new environment variables and build flags:
Benchmark Environment Variables:
- HAKMEM_BENCH_FAST_FRONT: Enable ultra-fast header-based free path
- HAKMEM_BENCH_WARMUP: Warmup cycles before timed run
- HAKMEM_FREE_ROUTE_TRACE: Debug trace for free() routing
- HAKMEM_EXTERNAL_GUARD_LOG: ExternalGuard debug logging
- HAKMEM_EXTERNAL_GUARD_STATS: ExternalGuard statistics at exit
Build Flags:
- HAKMEM_TINY_SS_TRUST_MMAP_ZERO: mmap zero-trust optimization
- Default: 0 (safe)
- Performance: +5.93% on bench_tiny_hot (allocation-heavy)
- Safety: Release-only, cache reuse always gets full memset
- Location: core/hakmem_build_flags.h:170-180
- Implementation: core/box/ss_allocation_box.c:37-78
Deprecated:
- HAKMEM_DISABLE_MINCORE_CHECK: Removed in Phase 3 (commit d78baf41c )
Each entry includes:
- Default value
- Usage example
- Effect description
- Source code location
- A/B testing guidance (where applicable)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-29 09:58:14 +09:00
2a47624850
Document Phase 4c/4d master trace and stats control
...
Complete ENV cleanup Phase 4 documentation:
- Phase 4c: HAKMEM_TRACE unified trace control
- Phase 4d: HAKMEM_STATS unified stats control
- Summary of all 6 new master control variables
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-28 16:11:38 +09:00
322d94ac6a
Document Phase 4b master debug control in ENV_VARS.md
...
Add documentation for new HAKMEM_DEBUG_ALL and HAKMEM_DEBUG_LEVEL
environment variables introduced in Phase 4b.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-28 16:03:53 +09:00
eec33ca37d
Document ENV Cleanup Phase 4a completion (20 variables total)
...
Phase 4a: Hot Path getenv Caching - COMPLETED
- All getenv() calls in hot paths verified as properly cached
- Key fix: hakmem_elo.c (10+ loop calls → cached is_quiet())
- Verified correct caching in 7 other critical files
Added ENV_VARIABLE_SURVEY.md:
- Comprehensive survey of 228 ENV variables
- Category breakdown and consolidation recommendations
- Target: ~80 variables (65% reduction)
Updated docs/specs/ENV_VARS.md:
- Added ENV Cleanup Progress section
- Documented Phase 4a findings
- Outlined Phase 4b+ future work (HAKMEM_DEBUG/TRACE/STATS unified vars)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-28 15:29:16 +09:00
a6e681aae7
P2: TLS SLL Redesign - class_map default, tls_cached tracking, conditional header restore
...
This commit completes the P2 phase of the Tiny Pool TLS SLL redesign to fix the
Header/Next pointer conflict that was causing ~30% crash rates.
Changes:
- P2.1: Make class_map lookup the default (ENV: HAKMEM_TINY_NO_CLASS_MAP=1 for legacy)
- P2.2: Add meta->tls_cached field to track blocks cached in TLS SLL
- P2.3: Make Header restoration conditional in tiny_next_store() (default: skip)
- P2.4: Add invariant verification functions (active + tls_cached ≈ used)
- P0.4: Document new ENV variables in ENV_VARS.md
New ENV variables:
- HAKMEM_TINY_ACTIVE_TRACK=1: Enable active/tls_cached tracking (~1% overhead)
- HAKMEM_TINY_NO_CLASS_MAP=1: Disable class_map (legacy mode)
- HAKMEM_TINY_RESTORE_HEADER=1: Force header restoration (legacy mode)
- HAKMEM_TINY_INVARIANT_CHECK=1: Enable invariant verification (debug)
- HAKMEM_TINY_INVARIANT_DUMP=1: Enable periodic state dumps (debug)
Benchmark results (bench_tiny_hot_hakmem 64B):
- Default (class_map ON): 84.49 M ops/sec
- ACTIVE_TRACK=1: 83.62 M ops/sec (-1%)
- NO_CLASS_MAP=1 (legacy): 85.06 M ops/sec
- MT performance: +21-28% vs system allocator
No crashes observed. All tests passed.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-28 14:11:37 +09:00
f4978b1529
ENV Cleanup Phase 5: Additional DEBUG guards + doc cleanup
...
Code changes:
- core/slab_handle.h: Add RELEASE guard for HAKMEM_TINY_FREELIST_MASK
- core/tiny_superslab_free.inc.h: Add guards for HAKMEM_TINY_ROUTE_FREE, HAKMEM_TINY_FREELIST_MASK
Documentation cleanup:
- docs/specs/CONFIGURATION.md: Remove 21 doc-only ENV variables
- docs/specs/ENV_VARS.md: Remove doc-only variables
Testing:
- Build: PASS (305KB binary, unchanged)
- Sanity: PASS (17.22M ops/s average, 3 runs)
- Larson: PASS (52.12M ops/s, 0 crashes)
Impact:
- 2 additional DEBUG ENV variables guarded (no overhead in RELEASE)
- Documentation accuracy improved
- Binary size maintained
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-27 03:55:17 +09:00
d511084c5b
ENV cleanup: Remove 21 doc-only variables from ENV_VARS.md
...
Removed 21 ENV variables that existed only in documentation with zero
code references (no getenv() calls in source):
Pool/Refill (1):
- HAKMEM_POOL_REFILL_BATCH
Intelligence Engine (3):
- HAKMEM_INT_ENGINE, HAKMEM_INT_EVENT_TS, HAKMEM_INT_SAMPLE
Frontend/FastCache (3):
- HAKMEM_TINY_FRONTEND, HAKMEM_TINY_FASTCACHE, HAKMEM_TINY_FAST
Wrapper/Safety/Debug (5):
- HAKMEM_WRAP_TINY_REFILL, HAKMEM_SAFE_FREE_STRICT, HAKMEM_TINY_GUARD
- HAKMEM_TINY_DEBUG_FAST0, HAKMEM_TINY_DEBUG_REMOTE_GUARD
Optimization/TLS/Memory (9):
- HAKMEM_TINY_QUICK, HAKMEM_USE_REGISTRY
- HAKMEM_TINY_TLS_LIST, HAKMEM_TINY_DRAIN_TO_SLL, HAKMEM_TINY_ALLOC_RING
- HAKMEM_TINY_MEM_DIET, HAKMEM_SLL_MULTIPLIER
- HAKMEM_TINY_PREFETCH, HAKMEM_TINY_SS_RESERVE
Impact:
- ENV_VARS.md: 327 lines → 285 lines (-42 lines, 12.8% reduction)
- Code impact: Zero (documentation-only cleanup)
- Variables were: planned features never implemented, replaced features,
or abandoned experiments
Documentation:
- Added SAFE_TO_DELETE_ENV_VARS.md to docs/analysis/
- Complete analysis of why each variable is obsolete
- Verification proof that variables don't exist in code
File: docs/specs/ENV_VARS.md
Status: Documentation cleanup - no code changes
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-27 02:52:35 +09:00
a9ddb52ad4
ENV cleanup: Remove BG/HotMag vars & guard fprintf (Larson 52.3M ops/s)
...
Phase 1 完了:環境変数整理 + fprintf デバッグガード
ENV変数削除(BG/HotMag系):
- core/hakmem_tiny_init.inc: HotMag ENV 削除 (~131 lines)
- core/hakmem_tiny_bg_spill.c: BG spill ENV 削除
- core/tiny_refill.h: BG remote 固定値化
- core/hakmem_tiny_slow.inc: BG refs 削除
fprintf Debug Guards (#if !HAKMEM_BUILD_RELEASE):
- core/hakmem_shared_pool.c: Lock stats (~18 fprintf)
- core/page_arena.c: Init/Shutdown/Stats (~27 fprintf)
- core/hakmem.c: SIGSEGV init message
ドキュメント整理:
- 328 markdown files 削除(旧レポート・重複docs)
性能確認:
- Larson: 52.35M ops/s (前回52.8M、安定動作✅ )
- ENV整理による機能影響なし
- Debug出力は一部残存(次phase で対応)
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-26 14:45:26 +09:00
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