Files
zeekay c9980fbb25 ci/Makefile/scripts/docs: drop pkg/cpp refs — C++ lives in luxcpp/
Migration follow-up after a6a06c00 moved pkg/cpp/ → luxcpp/consensus/.
Stale refs in CI workflows, Makefile, scripts, README, .gitignore would
have left the next CI run red and the test/build instructions wrong.

  .github/workflows/ci.yml         delete test-cpp job
  .github/workflows/sdk-verification.yml
                                   delete cpp-sdk job + drop from summary.needs
  Makefile                         delete examples-cpp target + clean ref
  scripts/test-all.sh              drop dead pkg/cpp branch
  benchmarks/run_all_backends.sh   drop dead pkg/cpp branch
  test/e2e/README.md               repoint cpp build to ~/work/luxcpp/consensus
  .gitignore                       drop pkg/cpp/build/
2026-05-21 14:29:39 -07:00

76 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
# Comprehensive multi-backend benchmark suite
# Runs benchmarks on all available backends and generates comparison report
set -e
RESULTS_DIR="./results"
mkdir -p "$RESULTS_DIR"
echo "═══════════════════════════════════════════════════"
echo " Lux Consensus - Multi-Backend Benchmark Suite"
echo "═══════════════════════════════════════════════════"
echo ""
# Detect platform
PLATFORM=$(uname -s)
ARCH=$(uname -m)
echo "Platform: $PLATFORM $ARCH"
echo ""
# 1. Go Benchmarks
echo "━━━ Running Pure Go Benchmarks ━━━"
cd ../ai
go test -bench=. -benchmem -benchtime=3s -run=^$ > "../benchmarks/$RESULTS_DIR/go_benchmark.txt" 2>&1
echo "✓ Go benchmarks complete"
echo ""
# 2. Check for CGO/C backend
if [ -d "../pkg/c" ]; then
echo "━━━ Running C Backend Benchmarks ━━━"
cd ../pkg/c
make bench > "../../benchmarks/$RESULTS_DIR/c_benchmark.txt" 2>&1 || echo "⚠ C benchmarks skipped (not available)"
echo "✓ C benchmarks complete"
echo ""
fi
# 3. Check for MLX backend (Apple Silicon only)
if [ "$ARCH" = "arm64" ] && [ "$PLATFORM" = "Darwin" ]; then
if [ -d "../pkg/mlx" ]; then
echo "━━━ Running MLX Backend Benchmarks (Apple Silicon) ━━━"
cd ../pkg/mlx
make bench > "../../benchmarks/$RESULTS_DIR/mlx_benchmark.txt" 2>&1 || echo "⚠ MLX benchmarks skipped (not available)"
echo "✓ MLX benchmarks complete"
echo ""
fi
else
echo "⚠ MLX benchmarks skipped (requires Apple Silicon)"
echo ""
fi
# 5. Check for Rust backend
if [ -d "../pkg/rust" ]; then
echo "━━━ Running Rust Backend Benchmarks ━━━"
cd ../pkg/rust
cargo bench > "../../benchmarks/$RESULTS_DIR/rust_benchmark.txt" 2>&1 || echo "⚠ Rust benchmarks skipped (not available)"
echo "✓ Rust benchmarks complete"
echo ""
fi
# Generate comparison report
echo "━━━ Generating Comparison Report ━━━"
cd ../../benchmarks
python3 generate_comparison.py || echo "⚠ Comparison generation skipped (Python not available)"
echo ""
echo "═══════════════════════════════════════════════════"
echo " Benchmark Suite Complete!"
echo "═══════════════════════════════════════════════════"
echo ""
echo "Results saved to:"
ls -lh "$RESULTS_DIR"/*.txt 2>/dev/null || echo " (no results found)"
echo ""
echo "View comparison report:"
echo " cat $RESULTS_DIR/comparison.md"
echo ""