ruvector/examples/edge-net/benches/run_benchmarks.sh
rUv e9dcc778fa feat(edge-net): add comprehensive security audit and battle testing
- Security audit identified 5 CRITICAL, 10+ HIGH severity issues
- Added 85 passing tests: adversarial scenarios, economic edge cases, RAC axioms
- Added economics module for RAC sustainability and treasury management
- Enhanced learning module with self-learning intelligence
- Fixed hooks configuration (--silent → 2>/dev/null || true)

Key security findings:
- CRITICAL: Weak PBKDF in Pi-Key (SHA-256 only, needs Argon2id)
- CRITICAL: Private key exposure via export_secret_key
- CRITICAL: Signature verification unimplemented in RAC
- HIGH: Session key derivation weakness
- HIGH: No memory zeroization for sensitive data

Architecture assessment: ~60% production ready (B+ rating)
All 85 tests pass: 18 adversarial + 38 economic + 29 RAC axioms

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 05:13:16 +00:00

69 lines
2.1 KiB
Bash
Executable file

#!/bin/bash
# Comprehensive Benchmark Runner for Edge-Net
set -e
echo "=========================================="
echo "Edge-Net Comprehensive Benchmark Suite"
echo "=========================================="
echo ""
# Create benchmark output directory
BENCH_DIR="benchmark_results"
mkdir -p "$BENCH_DIR"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
REPORT_FILE="$BENCH_DIR/benchmark_report_$TIMESTAMP.md"
echo "Running benchmarks..."
echo "Results will be saved to: $REPORT_FILE"
echo ""
# Check if we're in the right directory
if [ ! -f "Cargo.toml" ]; then
echo "Error: Must be run from the edge-net directory"
exit 1
fi
# Run benchmarks with the bench feature
echo "Building with bench feature..."
cargo build --release --features bench
echo ""
echo "Running benchmark suite..."
echo "This may take several minutes..."
echo ""
# Run specific benchmark categories
echo "1. Spike-Driven Attention Benchmarks..."
cargo bench --features bench -- spike_encoding 2>&1 | tee -a "$BENCH_DIR/spike_encoding.txt"
cargo bench --features bench -- spike_attention 2>&1 | tee -a "$BENCH_DIR/spike_attention.txt"
echo ""
echo "2. RAC Coherence Benchmarks..."
cargo bench --features bench -- rac_ 2>&1 | tee -a "$BENCH_DIR/rac_benchmarks.txt"
echo ""
echo "3. Learning Module Benchmarks..."
cargo bench --features bench -- reasoning_bank 2>&1 | tee -a "$BENCH_DIR/learning_benchmarks.txt"
cargo bench --features bench -- trajectory 2>&1 | tee -a "$BENCH_DIR/trajectory_benchmarks.txt"
echo ""
echo "4. Multi-Head Attention Benchmarks..."
cargo bench --features bench -- multi_head 2>&1 | tee -a "$BENCH_DIR/attention_benchmarks.txt"
echo ""
echo "5. Integration Benchmarks..."
cargo bench --features bench -- integration 2>&1 | tee -a "$BENCH_DIR/integration_benchmarks.txt"
cargo bench --features bench -- end_to_end 2>&1 | tee -a "$BENCH_DIR/e2e_benchmarks.txt"
echo ""
echo "=========================================="
echo "Benchmark Suite Complete!"
echo "=========================================="
echo ""
echo "Results saved to: $BENCH_DIR/"
echo ""
echo "To view results:"
echo " cat $BENCH_DIR/*.txt"
echo ""