Files
foxhunt/scripts/archive/test_binary_validation.sh
jgrusewski e61e8f54da feat(ml): Complete hyperopt infrastructure + documentation
Changes:
- CLAUDE.md: Update OOM fix validation status
- Add comprehensive documentation (30+ markdown reports)
- LSTM encoder varmap bug fix (tft/lstm_encoder.rs:290)
- Quantized LSTM layer matching fix (tft/quantized_lstm.rs)
- Hyperopt paths module (ml/src/hyperopt/paths.rs)
- Training path tests for all adapters (DQN, MAMBA-2, PPO, TFT)
- Checkpoint integrity tests
- Script cleanup: Remove 29 obsolete deployment scripts
- Archive old scripts to scripts/archive/
- New deployment utilities: check_gpu_availability.py, monitor_hyperopt.sh

Validation:
- OOM fixes validated: 5/5 trials successful (pod b6kc3mc5lbjiro)
- Batch-size-max 256 tested successfully
- All hyperopt adapters working correctly

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 19:52:21 +01:00

97 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
# Test binary validation system
set -e
echo "========================================"
echo "Binary Validation System Test Suite"
echo "========================================"
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$PROJECT_ROOT"
# Test 1: Validate existing binary
echo ""
echo "Test 1: Validate hyperopt_mamba2_demo binary"
echo "----------------------------------------"
if [ ! -f "target/release/examples/hyperopt_mamba2_demo" ]; then
echo "⚠️ Binary not found, building first..."
cargo build -p ml --example hyperopt_mamba2_demo --release --features cuda
fi
./scripts/validate_binary.sh hyperopt_mamba2_demo
echo "✅ Test 1 passed: Validation script works"
# Test 2: Local binary smoke test
echo ""
echo "Test 2: Smoke test binary functionality"
echo "----------------------------------------"
if target/release/examples/hyperopt_mamba2_demo --help | grep -q "base-dir"; then
echo "✅ Test 2 passed: Binary has correct CLI arguments"
else
echo "❌ Test 2 failed: Binary missing --base-dir argument"
exit 1
fi
# Test 3: Checksum comparison
echo ""
echo "Test 3: Checksum calculation"
echo "----------------------------------------"
LOCAL_SHA=$(sha256sum target/release/examples/hyperopt_mamba2_demo | awk '{print $1}')
echo "Local SHA256: $LOCAL_SHA"
if [ -n "$LOCAL_SHA" ] && [ ${#LOCAL_SHA} -eq 64 ]; then
echo "✅ Test 3 passed: Checksum calculated correctly (64 chars)"
else
echo "❌ Test 3 failed: Invalid checksum format"
exit 1
fi
# Test 4: Python validation integration
echo ""
echo "Test 4: Python script integration"
echo "----------------------------------------"
if python3 -c "
import subprocess
import os
project_root = os.getcwd()
result = subprocess.run(
[os.path.join(project_root, 'scripts/validate_binary.sh'), 'hyperopt_mamba2_demo'],
capture_output=True,
text=True,
cwd=project_root
)
if result.returncode == 0:
print('✅ Test 4 passed: Python can call validation script')
exit(0)
elif 'VALIDATION: LOCAL_ONLY' in result.stdout:
print('✅ Test 4 passed: Validation works (local-only mode)')
exit(0)
else:
print('❌ Test 4 failed: Python integration broken')
print(result.stdout)
print(result.stderr)
exit(1)
"; then
:
else
exit 1
fi
echo ""
echo "========================================"
echo "✅ All validation tests passed"
echo "========================================"
echo ""
echo "Validation system is ready for production use."
echo ""
echo "Next steps:"
echo "1. Test deployment with: python3 scripts/runpod_deploy.py --dry-run"
echo "2. Review SAFE_DEPLOYMENT_CHECKLIST.md for full workflow"