Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 214 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
name: Betti-RDL CI/CD

on:
push:
branches: [ main, develop, "feat-*" ]
pull_request:
branches: [ main, develop ]

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
build-type: [Release, Debug]
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libatomic1 python3-dev nodejs npm

- name: Configure CMake (C++ Kernel)
working-directory: src/cpp_kernel
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}

- name: Build C++ Kernel
working-directory: src/cpp_kernel/build
run: cmake --build . --config ${{ matrix.build-type }}

- name: Run Unit Tests
working-directory: src/cpp_kernel/build
run: ctest --output-on-failure

- name: Run Benchmark Harness
working-directory: src/cpp_kernel/build
run: |
echo "Running Benchmark Harness (Firehose, Deep Dive, Swarm)..."
./benchmark_harness --firehose --deep-dive --swarm --format=all

- name: Upload Benchmark Reports
if: always()
uses: actions/upload-artifact@v3
with:
name: benchmark-reports-${{ matrix.build-type }}
path: src/cpp_kernel/build/benchmark_results.*

- name: Run Stress Test
working-directory: src/cpp_kernel/build
run: ./stress_test

sanitizer-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libatomic1

- name: Configure CMake with Sanitizers
working-directory: src/cpp_kernel
run: |
mkdir -p build-asan
cd build-asan
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=ON

- name: Build with Sanitizers
working-directory: src/cpp_kernel/build-asan
run: cmake --build . --config Release

- name: Run mega_demo with ASAN/LSAN
working-directory: src/cpp_kernel/build-asan
run: |
echo "Running mega_demo with AddressSanitizer and LeakSanitizer..."
timeout 60 ./mega_demo_asan || true

- name: Run parallel_scaling_test with ASAN/LSAN
working-directory: src/cpp_kernel/build-asan
run: |
echo "Running parallel_scaling_test with AddressSanitizer and LeakSanitizer..."
timeout 60 ./parallel_scaling_test_asan || true

- name: Run betti_rdl_stress_test with ASAN/LSAN
working-directory: src/cpp_kernel/build-asan
run: |
echo "Running betti_rdl_stress_test with AddressSanitizer and LeakSanitizer..."
timeout 60 ./betti_rdl_stress_test_asan || true

python-bindings:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential python3-dev python3-pip libatomic1

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Build Python bindings
working-directory: python
run: |
pip install setuptools wheel
python setup.py build_ext --inplace

- name: Smoke test Python bindings
working-directory: python
run: python example.py

nodejs-bindings:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libatomic1

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install Node.js dependencies
working-directory: nodejs
run: npm install

- name: Build Node.js bindings
working-directory: nodejs
run: npm run build

- name: Smoke test Node.js bindings
working-directory: nodejs
run: node example.js

benchmark-comparison:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libatomic1

- name: Build Benchmark Suite
working-directory: src/cpp_kernel
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release

- name: Run Full Benchmark Suite
working-directory: src/cpp_kernel/build
run: |
echo "Running comprehensive benchmark suite..."
./benchmark_harness --firehose --deep-dive --swarm --format=all
echo ""
echo "Benchmark Results:"
echo "=================="
if [ -f benchmark_results.txt ]; then cat benchmark_results.txt; fi

- name: Generate Benchmark Report Summary
working-directory: src/cpp_kernel/build
if: always()
run: |
echo "# Benchmark Results" > /tmp/benchmark_summary.md
echo "" >> /tmp/benchmark_summary.md
if [ -f benchmark_results.csv ]; then
echo "## CSV Report" >> /tmp/benchmark_summary.md
echo '```' >> /tmp/benchmark_summary.md
cat benchmark_results.csv >> /tmp/benchmark_summary.md
echo '```' >> /tmp/benchmark_summary.md
fi

- name: Comment PR with Benchmark Results
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const benchmarkPath = 'src/cpp_kernel/build/benchmark_results.csv';
if (fs.existsSync(benchmarkPath)) {
const results = fs.readFileSync(benchmarkPath, 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '## 📊 Benchmark Results\n```\n' + results + '\n```'
});
}

- name: Upload Benchmark Results
if: always()
uses: actions/upload-artifact@v3
with:
name: benchmark-results-full
path: src/cpp_kernel/build/benchmark_results.*
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Build artifacts
build/
build-*/
build-asan/
*.exe
*.dll
*.lib
Expand All @@ -10,19 +12,34 @@ build/
*.pyd
*.node

# Benchmark outputs
benchmark_results.*
perf.txt
perf.data
perf.data.old

# Language specific
__pycache__/
*.pyc
node_modules/
target/ # Rust
vendor/ # Go
*.egg-info/
dist/
*.whl

# IDEs
.vscode/
.idea/
*.swp
*.swo

# Logs
*.log
log/

# OS specific
.DS_Store
Thumbs.db

output/
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,43 @@ Zero-overhead integration for embedded use.
betti-rdl = "1.0"
```

## Comprehensive Benchmarking & CI/CD

### Benchmark Harness

The project includes a comprehensive benchmarking harness that validates the three killer scenarios:

- **The Firehose**: Raw throughput measurement (target: >1M EPS)
- **The Deep Dive**: Memory stability under deep recursion (O(1) validation)
- **The Swarm**: Parallel scaling efficiency (target: >80% scaling efficiency)

**Quick Start**:
```bash
cd src/cpp_kernel
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
./benchmark_harness --format=all
```

See [**Benchmark Harness Documentation**](docs/BENCHMARK_HARNESS.md) for detailed usage and interpretation.

### CI/CD Pipeline

Automated testing on every commit ensures code quality and performance:

- **Build & Test**: Compiles kernel, runs unit tests (Release & Debug)
- **Sanitizer Checks**: Validates memory safety with AddressSanitizer/LeakSanitizer
- **Python Bindings**: Smoke tests Python FFI bindings
- **Node.js Bindings**: Smoke tests Node.js N-API bindings
- **Benchmarks**: Full harness with performance tracking and PR comments

See [**CI/CD Workflow Documentation**](docs/CI_CD_WORKFLOW.md) for setup and troubleshooting.

## Roadmap

- [x] **v1.0**: Core Runtime, O(1) Validation, Multi-language Bindings.
- [x] **v1.0.1**: Comprehensive Benchmarking Harness & CI/CD Hardening.
- [ ] **v1.1**: Go Bindings, Distributed Network Clustering.
- [ ] **v2.0**: "COG Cloud" (Serverless Platform).

Expand Down
Loading
Loading