Files
hakmem/archive/experimental_scripts/ab_fast_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

41 lines
1.4 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) fast-return params: trylock probes × ring return div.
# Saves logs under docs/benchmarks/<timestamp>_AB_FAST_MID
RUNTIME=${RUNTIME:-2}
THREADS_CSV=${THREADS:-"1,4"}
PROBES=${PROBES:-"2,3"}
RETURNS=${RETURNS:-"2,3"}
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
OUTDIR="$ROOT_DIR/docs/benchmarks/$(date +%Y%m%d_%H%M%S)_AB_FAST_MID"
mkdir -p "$OUTDIR"
LIB="$(readlink -f "$ROOT_DIR/libhakmem.so")"
LARSON="$ROOT_DIR/mimalloc-bench/bench/larson/larson"
echo "A/B fast-return (Mid 232KiB) RUNTIME=${RUNTIME}s THREADS=${THREADS_CSV}" | tee "$OUTDIR/summary.txt"
echo "PROBES={${PROBES}} RETURNS={${RETURNS}}" | tee -a "$OUTDIR/summary.txt"
IFS=',' read -r -a TARR <<< "$THREADS_CSV"
IFS=',' read -r -a PARR <<< "$PROBES"
IFS=',' read -r -a RARR <<< "$RETURNS"
for pr in "${PARR[@]}"; do
for rd in "${RARR[@]}"; do
for t in "${TARR[@]}"; do
label="pr${pr}_rd${rd}_T${t}"
echo "== $label ==" | tee -a "$OUTDIR/summary.txt"
timeout -k 2s $((RUNTIME+6))s \
env HAKMEM_HDR_LIGHT=1 HAKMEM_POOL_TLS_RING=1 HAKMEM_SHARD_MIX=1 \
HAKMEM_TRYLOCK_PROBES="$pr" HAKMEM_RING_RETURN_DIV="$rd" \
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"