Files
hakmem/archive/experimental_scripts/ab_sweep_mid.sh
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

48 lines
1.6 KiB
Bash
Executable File
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.

#!/usr/bin/env bash
set -euo pipefail
# A/B sweep for Mid (232KiB) with WRAP L1 ON, varying DYN1 CAP and min bundle.
# Saves logs under docs/benchmarks/<timestamp>.
RUNTIME=${RUNTIME:-1}
THREADS_CSV=${THREADS:-"1,4"}
CAPS=${CAPS:-"32,64,128"}
MINB=${MINB:-"2,3,4"}
DYN1=${DYN1:-14336}
BENCH_TIMEOUT=${BENCH_TIMEOUT:-}
KILL_GRACE=${KILL_GRACE:-2}
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
OUTDIR="$ROOT_DIR/docs/benchmarks/$(date +%Y%m%d_%H%M%S)_AB_MID"
mkdir -p "$OUTDIR"
LIB="$(readlink -f "$ROOT_DIR/libhakmem.so")"
LARSON="$ROOT_DIR/mimalloc-bench/bench/larson/larson"
echo "A/B sweep (Mid 232KiB) RUNTIME=${RUNTIME}s THREADS=${THREADS_CSV}" | tee "$OUTDIR/summary.txt"
echo "DYN1=${DYN1} CAPS={${CAPS}} MINB={${MINB}}" | tee -a "$OUTDIR/summary.txt"
if [[ -z "${BENCH_TIMEOUT}" ]]; then
BENCH_TIMEOUT=$(( RUNTIME + 3 ))
fi
IFS=',' read -r -a TARR <<< "$THREADS_CSV"
IFS=',' read -r -a CARR <<< "$CAPS"
IFS=',' read -r -a MARR <<< "$MINB"
for cap in "${CARR[@]}"; do
for mb in "${MARR[@]}"; do
for t in "${TARR[@]}"; do
label="cap${cap}_mb${mb}_T${t}"
echo "== $label ==" | tee -a "$OUTDIR/summary.txt"
timeout -k "${KILL_GRACE}s" "${BENCH_TIMEOUT}s" \
env HAKMEM_WRAP_L2=1 HAKMEM_WRAP_L25=1 \
HAKMEM_LEARN=0 HAKMEM_MID_DYN1="$DYN1" HAKMEM_CAP_MID_DYN1="$cap" \
HAKMEM_POOL_MIN_BUNDLE="$mb" \
LD_PRELOAD="$LIB" "$LARSON" "$RUNTIME" 2048 32768 10000 1 12345 "$t" 2>&1 \
| tee "$OUTDIR/${label}.log" | tail -n 3 | tee -a "$OUTDIR/summary.txt"
done
done
done
echo "Saved: $OUTDIR" | tee -a "$OUTDIR/summary.txt"