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>
58 lines
1.9 KiB
Bash
58 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Run random-mixed bench for HAKMEM, System, mimalloc across ws/seeds and write CSV
|
|
# Usage: scripts/run_random_mixed_matrix.sh [cycles]
|
|
|
|
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
|
cd "$ROOT_DIR"
|
|
|
|
cycles=${1:-150000}
|
|
|
|
echo "[build] benches (fast + random-mixed variants)"
|
|
make -s bench_fast bench_random_mixed_hakmem bench_random_mixed_system bench_random_mixed_mi >/dev/null
|
|
|
|
# Ensure LD_LIBRARY_PATH is defined (set -u safety)
|
|
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}"
|
|
MI_LIBDIR="$ROOT_DIR/mimalloc-bench/extern/mi/out/release"
|
|
|
|
TS=$(date +%Y%m%d_%H%M%S)
|
|
OUTDIR="bench_results/random_mixed_${TS}"
|
|
mkdir -p "$OUTDIR"
|
|
CSV="$OUTDIR/results.csv"
|
|
echo "allocator,cycles,ws,seed,throughput_mops" > "$CSV"
|
|
|
|
ws_list=(200 400 800)
|
|
seeds=(42 1337)
|
|
|
|
run_case() {
|
|
local bin="$1"; shift
|
|
local alloc="$1"; shift
|
|
local cyc="$1"; shift
|
|
local ws="$1"; shift
|
|
local seed="$1"; shift
|
|
local out
|
|
if [[ "$alloc" == "mimalloc" ]]; then
|
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MI_LIBDIR" \
|
|
$bin "$cyc" "$ws" "$seed" | sed -n 's/^Throughput: \([0-9.][0-9.]*\) M ops.*/\1/p' >"$OUTDIR/tmp.txt" || true
|
|
else
|
|
$bin "$cyc" "$ws" "$seed" | sed -n 's/^Throughput: \([0-9.][0-9.]*\) M ops.*/\1/p' >"$OUTDIR/tmp.txt" || true
|
|
fi
|
|
out=$(cat "$OUTDIR/tmp.txt" || true)
|
|
if [[ -n "$out" ]]; then echo "$alloc,$cyc,$ws,$seed,$out" >> "$CSV"; fi
|
|
}
|
|
|
|
for ws in "${ws_list[@]}"; do
|
|
for seed in "${seeds[@]}"; do
|
|
echo "[run] HAKMEM ws=$ws seed=$seed cycles=$cycles"
|
|
run_case ./bench_random_mixed_hakmem hakmem "$cycles" "$ws" "$seed"
|
|
echo "[run] SYSTEM ws=$ws seed=$seed cycles=$cycles"
|
|
run_case ./bench_random_mixed_system system "$cycles" "$ws" "$seed"
|
|
echo "[run] MIMALLOC ws=$ws seed=$seed cycles=$cycles"
|
|
run_case ./bench_random_mixed_mi mimalloc "$cycles" "$ws" "$seed"
|
|
done
|
|
done
|
|
|
|
echo "[done] CSV: $CSV"
|
|
sed -n '1,40p' "$CSV" || true
|