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>
This commit is contained in:
Moe Charm (CI)
2025-11-05 12:31:14 +09:00
commit 52386401b3
27144 changed files with 124451 additions and 0 deletions

View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -euo pipefail
# Head-to-head for Large(64KB1MB), 10s, system/mimalloc/hakmem (P1/P2 profiles)
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
LARSON="$ROOT_DIR/mimalloc-bench/bench/larson/larson"
LIB_HAK="$ROOT_DIR/libhakmem.so"
LIB_MI="/lib/x86_64-linux-gnu/libmimalloc.so.2"
if [[ ! -x "$LARSON" ]]; then
echo "[ERR] larson not found: $LARSON" >&2; exit 1
fi
if [[ ! -f "$LIB_HAK" ]]; then
echo "[ERR] libhakmem.so not found: $LIB_HAK" >&2; exit 1
fi
TS=$(date +%Y%m%d_%H%M%S)
OUT="$ROOT_DIR/docs/benchmarks/${TS}_HEAD2HEAD_LARGE"
mkdir -p "$OUT"
echo "[OUT] $OUT"
cd "$ROOT_DIR/mimalloc-bench/bench/larson"
echo "System malloc LARGE_4T" | tee "$OUT/system_large_4t.log"
timeout "${BENCH_TIMEOUT:-13}s" "$LARSON" 10 65536 1048576 10000 1 12345 4 2>&1 | tee -a "$OUT/system_large_4t.log"
echo "mimalloc LARGE_4T" | tee "$OUT/mimalloc_large_4t.log"
timeout "${BENCH_TIMEOUT:-13}s" env LD_PRELOAD="$LIB_MI" "$LARSON" 10 65536 1048576 10000 1 12345 4 2>&1 | tee -a "$OUT/mimalloc_large_4t.log"
# P1 best (alloc優先)
echo "hakmem P1 LARGE_4T (remote, factor=4, HDR=1)" | tee "$OUT/hakmem_p1_large_4t.log"
timeout "${BENCH_TIMEOUT:-13}s" env LD_PRELOAD="$LIB_HAK" HAKMEM_WRAP_L25=1 HAKMEM_L25_PREF=remote HAKMEM_L25_RUN_FACTOR=4 \
HAKMEM_HDR_LIGHT=1 HAKMEM_SHARD_MIX=1 HAKMEM_TLS_LO_MAX=512 \
"$LARSON" 10 65536 1048576 10000 1 12345 4 2>&1 | tee -a "$OUT/hakmem_p1_large_4t.log"
# P2+TC best (free優先)
echo "hakmem P2+TC LARGE_4T (remote, factor=4, HDR=2, TC_SPILL=16)" | tee "$OUT/hakmem_p2_large_4t.log"
timeout "${BENCH_TIMEOUT:-13}s" env LD_PRELOAD="$LIB_HAK" HAKMEM_WRAP_L25=1 HAKMEM_L25_PREF=remote HAKMEM_L25_RUN_FACTOR=4 \
HAKMEM_HDR_LIGHT=2 HAKMEM_L25_TC_SPILL=16 HAKMEM_SHARD_MIX=1 HAKMEM_TLS_LO_MAX=512 \
"$LARSON" 10 65536 1048576 10000 1 12345 4 2>&1 | tee -a "$OUT/hakmem_p2_large_4t.log"
cd - >/dev/null
rg -n "Throughput" "$OUT"/*.log | tee "$OUT/summary.txt" || true
echo "[DONE] Logs at $OUT"