Skip to content

Claude/prtree baseline profiling 011 c untbwyj4 bz zaragfw zyk #21

Claude/prtree baseline profiling 011 c untbwyj4 bz zaragfw zyk

Claude/prtree baseline profiling 011 c untbwyj4 bz zaragfw zyk #21

Workflow file for this run

name: Sanitizer and Performance Checks
# Phase 0: Mandatory sanitizer builds (TSan, ASan, UBSan)
# These checks are REQUIRED and will block merges if they fail
on:
push:
branches:
- main
- 'claude/**' # Claude's working branches
pull_request:
branches:
- main
jobs:
thread_sanitizer:
name: ThreadSanitizer (MANDATORY)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential clang
- name: Build with TSan
run: |
mkdir -p build_tsan
cd build_tsan
cmake -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DENABLE_TSAN=ON \
-DBUILD_BENCHMARKS=ON \
..
make -j$(nproc)
- name: Run stress tests with TSan
run: |
cd build_tsan
./stress_test_concurrent
env:
TSAN_OPTIONS: "halt_on_error=1 history_size=7"
- name: Check for TSan warnings
if: failure()
run: |
echo "❌ ThreadSanitizer detected data races!"
echo "This is a MANDATORY check - fix all data races before merging."
exit 1
address_sanitizer:
name: AddressSanitizer (MANDATORY)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential clang
- name: Build with ASan
run: |
mkdir -p build_asan
cd build_asan
cmake -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DENABLE_ASAN=ON \
-DBUILD_BENCHMARKS=ON \
..
make -j$(nproc)
- name: Run benchmarks with ASan
run: |
cd build_asan
./benchmark_construction small_uniform
./benchmark_query small_uniform
env:
ASAN_OPTIONS: "halt_on_error=1 detect_leaks=1"
- name: Run stress tests with ASan
run: |
cd build_asan
timeout 60 ./stress_test_concurrent
env:
ASAN_OPTIONS: "halt_on_error=1 detect_leaks=1"
undefined_behavior_sanitizer:
name: UndefinedBehaviorSanitizer (MANDATORY)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential clang
- name: Build with UBSan
run: |
mkdir -p build_ubsan
cd build_ubsan
cmake -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DENABLE_UBSAN=ON \
-DBUILD_BENCHMARKS=ON \
..
make -j$(nproc)
- name: Run benchmarks with UBSan
run: |
cd build_ubsan
./benchmark_construction small_uniform
./benchmark_query small_uniform
env:
UBSAN_OPTIONS: "halt_on_error=1 print_stacktrace=1"
benchmark_baseline:
name: Performance Baseline Check
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Build benchmarks
run: |
mkdir -p build_benchmark
cd build_benchmark
cmake -DCMAKE_BUILD_TYPE=Release \
-DENABLE_PROFILING=ON \
-DBUILD_BENCHMARKS=ON \
..
make -j$(nproc)
- name: Run benchmarks
run: |
cd build_benchmark
./benchmark_construction small_uniform > construction_results.txt
./benchmark_query small_uniform > query_results.txt
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results-${{ github.sha }}
path: |
build_benchmark/construction_results.txt
build_benchmark/query_results.txt
build_benchmark/*.csv
- name: Check for performance regressions
run: |
# Placeholder for future regression checking
# Will compare against Phase 0 baseline once established
echo "✓ Benchmarks completed successfully"
echo "TODO: Compare against Phase 0 baseline"
concurrent_stress_long:
name: Long-Running Stress Test (10 min)
runs-on: ubuntu-latest
timeout-minutes: 15
# Only run on main branch and manual triggers to save CI time
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential clang
- name: Build with TSan
run: |
mkdir -p build_tsan_long
cd build_tsan_long
cmake -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DENABLE_TSAN=ON \
-DBUILD_BENCHMARKS=ON \
..
make -j$(nproc)
- name: Run 10-minute torture test
run: |
cd build_tsan_long
# Run for 10 minutes (600 seconds)
timeout 600 ./stress_test_concurrent || {
if [ $? -eq 124 ]; then
echo "✓ Stress test ran for full 10 minutes"
exit 0
else
echo "❌ Stress test failed before timeout"
exit 1
fi
}
env:
TSAN_OPTIONS: "halt_on_error=1 history_size=7"
build_status_summary:
name: Build Status Summary
runs-on: ubuntu-latest
needs: [thread_sanitizer, address_sanitizer, undefined_behavior_sanitizer, benchmark_baseline]
if: always()
steps:
- name: Check build status
run: |
echo "==================================="
echo " Sanitizer Build Status Summary "
echo "==================================="
echo ""
echo "ThreadSanitizer: ${{ needs.thread_sanitizer.result }}"
echo "AddressSanitizer: ${{ needs.address_sanitizer.result }}"
echo "UBSanitizer: ${{ needs.undefined_behavior_sanitizer.result }}"
echo "Benchmarks: ${{ needs.benchmark_baseline.result }}"
echo ""
# Fail if any mandatory check failed
if [ "${{ needs.thread_sanitizer.result }}" != "success" ] || \
[ "${{ needs.address_sanitizer.result }}" != "success" ] || \
[ "${{ needs.undefined_behavior_sanitizer.result }}" != "success" ]; then
echo "❌ MANDATORY SANITIZER CHECKS FAILED"
echo "All sanitizer checks must pass before merging."
exit 1
fi
echo "✓ All mandatory checks passed"