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>
62 lines
1.8 KiB
Bash
62 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Sweep Ultra Tiny (SLL-only) with debug counters and output CSV
|
|
# Usage: scripts/run_ultra_debug_sweep.sh [cycles] [batch]
|
|
|
|
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
|
cd "$ROOT_DIR"
|
|
|
|
cycles=${1:-60000}
|
|
batch=${2:-200}
|
|
|
|
make -s bench_fast >/dev/null
|
|
|
|
TS=$(date +%Y%m%d_%H%M%S)
|
|
OUTDIR="bench_results/ultra_debug_${TS}"
|
|
mkdir -p "$OUTDIR"
|
|
CSV="$OUTDIR/results.csv"
|
|
echo "size,batch,cycles,throughput_mops,class,pop_hits,refills,resets,sll_count" > "$CSV"
|
|
|
|
sizes=(16 32 64)
|
|
|
|
size_to_class() {
|
|
case "$1" in
|
|
16) echo 1;;
|
|
32) echo 2;;
|
|
64) echo 3;;
|
|
8) echo 0;;
|
|
128) echo 4;;
|
|
*) echo -1;;
|
|
esac
|
|
}
|
|
|
|
for s in "${sizes[@]}"; do
|
|
cls=$(size_to_class "$s")
|
|
log="$OUTDIR/ultra_${s}_b=${batch}_c=${cycles}.log"
|
|
# Run with Ultra + debug; capture stdout+stderr in one file
|
|
HAKMEM_TINY_ULTRA=1 HAKMEM_TINY_ULTRA_DEBUG=1 HAKMEM_TINY_MAG_CAP=128 \
|
|
./bench_tiny_hot_hakmem "$s" "$batch" "$cycles" >"$log" 2>&1 || true
|
|
|
|
thr=$(sed -n 's/^Throughput: \([0-9.][0-9.]*\) M ops.*/\1/p' "$log" | tail -n1)
|
|
# Extract Ultra debug block
|
|
start=$(grep -n '^\[Ultra Tiny Debug\]' "$log" | tail -n1 | cut -d: -f1)
|
|
if [[ -n "$start" ]]; then
|
|
# header is the next line; data follows
|
|
data_start=$((start+2))
|
|
# take next 8 lines (classes 0..7)
|
|
sed -n "${data_start},$((data_start+7))p" "$log" > "$OUTDIR/tmp_ultra.txt" || true
|
|
# pick the line for target class
|
|
line=$(awk -F',' -v k="$cls" '($1==k){print $0}' "$OUTDIR/tmp_ultra.txt" | tail -n1)
|
|
if [[ -n "$line" ]]; then
|
|
# line format: class,pop_hits,refills,resets,sll_count
|
|
IFS=',' read -r c ph rf rs sc <<<"$line"
|
|
echo "$s,$batch,$cycles,${thr:-},$c,$ph,$rf,$rs,$sc" >> "$CSV"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
echo "[done] CSV: $CSV"
|
|
sed -n '1,20p' "$CSV" || true
|
|
|