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:
67
scripts/verify_fast_cap_0_bug.sh
Executable file
67
scripts/verify_fast_cap_0_bug.sh
Executable file
@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
# Verification script for FAST_CAP=0 SEGV bug
|
||||
# Usage: ./scripts/verify_fast_cap_0_bug.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "============================================"
|
||||
echo "FAST_CAP=0 SEGV Bug Verification"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
|
||||
# Build with debug if needed
|
||||
if [ ! -f libhakmem.so ]; then
|
||||
echo "[Step 1] Building libhakmem.so..."
|
||||
make clean && make
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "[Step 2] Single-threaded test (should PASS)..."
|
||||
HAKMEM_TINY_FAST_CAP=0 \
|
||||
HAKMEM_LARSON_TINY_ONLY=1 \
|
||||
HAKMEM_TINY_USE_SUPERSLAB=1 \
|
||||
timeout 5 ./larson_hakmem 2 8 128 1024 1 12345 1 && echo "✓ PASSED" || echo "✗ FAILED"
|
||||
echo ""
|
||||
|
||||
echo "[Step 3] Multi-threaded test (expected to CRASH)..."
|
||||
HAKMEM_TINY_FAST_CAP=0 \
|
||||
HAKMEM_LARSON_TINY_ONLY=1 \
|
||||
HAKMEM_TINY_USE_SUPERSLAB=1 \
|
||||
HAKMEM_TINY_TRACE_RING=1 \
|
||||
timeout 5 ./larson_hakmem 2 8 128 1024 1 12345 4 2>&1 | tee /tmp/hakmem_crash.log && echo "✓ PASSED (unexpected!)" || echo "✗ CRASHED (expected)"
|
||||
echo ""
|
||||
|
||||
echo "[Step 4] Checking Debug Ring output..."
|
||||
if grep -q "remote_drain" /tmp/hakmem_crash.log; then
|
||||
echo "✓ remote_drain events found (Fix is working!)"
|
||||
else
|
||||
echo "✗ NO remote_drain events (confirms diagnosis)"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "[Step 5] Checking for remote_push events..."
|
||||
if grep -q "remote_push" /tmp/hakmem_crash.log; then
|
||||
echo "✓ remote_push events found (cross-thread frees happening)"
|
||||
else
|
||||
echo "✗ NO remote_push events (unexpected)"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "[Step 6] Testing with FAST_CAP=64 (should PASS)..."
|
||||
HAKMEM_TINY_FAST_CAP=64 \
|
||||
HAKMEM_LARSON_TINY_ONLY=1 \
|
||||
HAKMEM_TINY_USE_SUPERSLAB=1 \
|
||||
timeout 5 ./larson_hakmem 2 8 128 1024 1 12345 4 && echo "✓ PASSED" || echo "✗ FAILED (unexpected!)"
|
||||
echo ""
|
||||
|
||||
echo "============================================"
|
||||
echo "Verification Complete"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
echo "Expected results:"
|
||||
echo " - Single-thread: PASS"
|
||||
echo " - Multi-thread FAST_CAP=0: CRASH (no remote_drain)"
|
||||
echo " - Multi-thread FAST_CAP=64: PASS"
|
||||
echo ""
|
||||
echo "See /tmp/hakmem_crash.log for crash details"
|
||||
echo "See FAST_CAP_0_SEGV_ROOT_CAUSE_ANALYSIS.md for full analysis"
|
||||
Reference in New Issue
Block a user