Skip to content

V123: typed errors, module decomposition, CI hardening, doc alignment #121

V123: typed errors, module decomposition, CI hardening, doc alignment

V123: typed errors, module decomposition, CI hardening, doc alignment #121

Workflow file for this run

name: neuralSpring Rust
on:
push:
branches: [main]
paths:
- 'src/**'
- 'metalForge/**'
- 'playGround/**'
- 'Cargo.toml'
- 'deny.toml'
- '.github/workflows/rust.yml'
pull_request:
branches: [main]
paths:
- 'src/**'
- 'metalForge/**'
- 'playGround/**'
- 'Cargo.toml'
- 'deny.toml'
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
# barraCuda is a standalone primal (path dep at ../barraCuda/crates/barracuda).
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- name: Build (workspace)
run: cargo build --workspace --all-targets
- name: Test (workspace, lib + unit)
run: cargo test --workspace --lib
- name: Test (workspace, integration)
run: cargo test --workspace --test '*'
- name: Clippy (pedantic + nursery, all features)
run: cargo clippy --workspace --all-targets --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery
- name: Format check (workspace)
run: cargo fmt --all -- --check
- name: Doc check (workspace)
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: "-D warnings"
ecobin-cross-check:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain with musl target
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl, aarch64-unknown-linux-gnu
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-musl-${{ hashFiles('Cargo.toml') }}
- name: ecoBin musl check (zero C deps)
run: cargo check --target x86_64-unknown-linux-musl
- name: ecoBin ARM check (cross-compile)
run: cargo check --target aarch64-unknown-linux-gnu
- name: Verify no banned C sys crates
run: |
if cargo tree --all-features 2>/dev/null | grep -qE "(openssl-sys|ring |aws-lc-sys|zstd-sys|lz4-sys|sysinfo )"; then
echo "FAIL: Banned C sys crate detected in dependency tree"
cargo tree --all-features | grep -E "(openssl-sys|ring |aws-lc-sys|zstd-sys|lz4-sys|sysinfo )"
exit 1
fi
echo "PASS: No banned C sys crates"
supply-chain:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-deny
run: cargo install --locked cargo-deny
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-deny-${{ hashFiles('Cargo.toml') }}
- name: Run cargo-deny (licenses, advisories, bans, sources)
run: cargo deny check
coverage:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-cov-${{ hashFiles('Cargo.toml') }}
- name: Collect coverage (workspace)
run: cargo llvm-cov --workspace --lib --json --output-path coverage.json
- name: Check coverage threshold (90%)
run: |
COV=$(python3 -c "import json; d=json.load(open('coverage.json')); print(f\"{d['data'][0]['totals']['lines']['percent']:.1f}\")")
echo "Library line coverage: ${COV}%"
python3 -c "
import json, sys
d = json.load(open('coverage.json'))
pct = d['data'][0]['totals']['lines']['percent']
if pct < 90:
print(f'FAIL: {pct:.1f}% < 90% target')
sys.exit(1)
print(f'PASS: {pct:.1f}% >= 90% target')
"
validate-native:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- name: Validate surrogate (15 checks)
run: cargo run --bin validate_surrogate
- name: Validate transformer (18 checks)
run: cargo run --bin validate_transformer
- name: Validate metrics (10 checks)
run: cargo run --bin validate_metrics
- name: Validate counterdiabatic (19 checks)
run: cargo run --bin validate_counterdiabatic
- name: Validate MODES (9 checks)
run: cargo run --bin validate_modes
- name: Validate eco dynamics (7 checks)
run: cargo run --bin validate_eco_dynamics
- name: Validate directed evolution (7 checks)
run: cargo run --bin validate_directed_evolution
- name: Validate HMM (17 checks)
run: cargo run --bin validate_hmm
- name: Validate game theory (8 checks)
run: cargo run --bin validate_game_theory
- name: Validate swarm robotics (7 checks)
run: cargo run --bin validate_swarm_robotics
- name: Validate SATé alignment (8 checks)
run: cargo run --bin validate_sate_alignment
- name: Validate introgression (13 checks)
run: cargo run --bin validate_introgression
- name: Validate regulatory network (5 checks)
run: cargo run --bin validate_regulatory_network
- name: Validate signal integration (8 checks)
run: cargo run --bin validate_signal_integration
- name: Validate spectral commutativity (8 checks)
run: cargo run --bin validate_spectral_commutativity
- name: Validate Anderson localization (8 checks)
run: cargo run --bin validate_anderson_localization
- name: Validate pangenome selection (8 checks)
run: cargo run --bin validate_pangenome_selection
- name: Validate meta-population (8 checks)
run: cargo run --bin validate_meta_population
- name: Validate LeNet-5 (22 checks)
run: cargo run --bin validate_lenet
- name: Validate transfer learning (11 checks)
run: cargo run --bin validate_transfer
- name: Validate isomorphic catalog (8 checks)
run: cargo run --bin validate_isomorphic
- name: Validate LSTM/GRU cell primitives
run: cargo run --bin validate_lstm
- name: Validate quantized inference
run: cargo run --bin validate_quantized
- name: Validate sequence (7 checks)
run: cargo run --bin validate_sequence
- name: Validate PINN (9 checks)
run: cargo run --bin validate_pinn
- name: Validate DeepONet (18 checks)
run: cargo run --bin validate_deeponet
validate-barracuda:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- name: Validate barracuda stats (13 checks)
run: cargo run --bin validate_barracuda_stats
- name: Validate barracuda linalg (17 checks)
run: cargo run --bin validate_barracuda_linalg
- name: Validate barracuda special (26 checks)
run: cargo run --bin validate_barracuda_special
- name: Validate barracuda optimize (10 checks)
run: cargo run --bin validate_barracuda_optimize
- name: Validate barracuda precision (12 checks)
run: cargo run --bin validate_barracuda_precision
- name: Validate barracuda tensor (unified WGSL + evolved ops, 86 checks)
run: cargo run --bin validate_barracuda_tensor
- name: Validate barracuda tensor f64 (SHADER_F64 GPU ops, 35 checks)
run: cargo run --bin validate_barracuda_tensor_f64
- name: Validate barracuda quantized (15 checks)
run: cargo run --bin validate_barracuda_quantized
- name: Validate barracuda linalg_ext (17 checks)
run: cargo run --bin validate_barracuda_linalg_ext
- name: Validate barracuda ml_inference (13 checks)
run: cargo run --bin validate_barracuda_ml_inference
- name: Validate barracuda FFT (12 checks)
run: cargo run --bin validate_barracuda_fft
validate-barracuda-cpu:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- name: Validate barracuda spectral (10 checks)
run: cargo run --bin validate_barracuda_spectral
- name: Validate barracuda anderson (7 checks)
run: cargo run --bin validate_barracuda_anderson
- name: Validate barracuda regulatory (6 checks)
run: cargo run --bin validate_barracuda_regulatory
- name: Validate barracuda signal (14 checks)
run: cargo run --bin validate_barracuda_signal
- name: Validate barracuda hmm (14 checks)
run: cargo run --bin validate_barracuda_hmm
- name: Validate barracuda introgression (11 checks)
run: cargo run --bin validate_barracuda_introgression
- name: Validate barracuda counterdiabatic (7 checks)
run: cargo run --bin validate_barracuda_counterdiabatic
- name: Validate barracuda modes (7 checks)
run: cargo run --bin validate_barracuda_modes
- name: Validate barracuda eco (6 checks)
run: cargo run --bin validate_barracuda_eco
- name: Validate barracuda directed (7 checks)
run: cargo run --bin validate_barracuda_directed
- name: Validate barracuda swarm (10 checks)
run: cargo run --bin validate_barracuda_swarm
- name: Validate barracuda sate (6 checks)
run: cargo run --bin validate_barracuda_sate
- name: Validate barracuda game (5 checks)
run: cargo run --bin validate_barracuda_game
- name: Validate barracuda pangenome (8 checks)
run: cargo run --bin validate_barracuda_pangenome
- name: Validate barracuda meta-population (8 checks)
run: cargo run --bin validate_barracuda_meta_pop
- name: Validate barracuda PINN (6 checks)
run: cargo run --bin validate_barracuda_pinn
- name: Validate barracuda DeepONet (9 checks)
run: cargo run --bin validate_barracuda_deeponet
- name: Validate barracuda logsumexp (5 checks)
run: cargo run --bin validate_barracuda_logsumexp
# Phase 3c: metalForge GPU shader validation
- name: Validate GPU HMM forward shader (13 checks)
run: cargo run --bin validate_gpu_hmm_forward
- name: Validate GPU batch fitness shader (20 checks)
run: cargo run --bin validate_gpu_batch_fitness
- name: Validate GPU RK4 shader (8 checks)
run: cargo run --bin validate_gpu_rk4
# Phase 3d: Pure GPU workload + StatefulPipeline + cross-dispatch
- name: Validate GPU StatefulPipeline (10 checks)
run: cargo run --bin validate_gpu_stateful_pipeline
- name: Validate GPU pure workload chain (7 checks)
run: cargo run --bin validate_gpu_pure_workload
- name: Validate cross-dispatch GPU vs CPU (8 checks)
run: cargo run --bin validate_cross_dispatch
- name: Validate GPU pangenome Jaccard (6 checks)
run: cargo run --bin validate_gpu_pangenome
- name: Validate GPU meta-population variance (7 checks)
run: cargo run --bin validate_gpu_meta_pop
- name: Validate cross-dispatch genomics (8 checks)
run: cargo run --bin validate_cross_dispatch_genomics
- name: Validate GPU game theory spatial payoff (5 checks)
run: cargo run --bin validate_gpu_game_theory
- name: Validate GPU Anderson IPR (5 checks)
run: cargo run --bin validate_gpu_anderson
- name: Validate GPU SATe Hamming distance (5 checks)
run: cargo run --bin validate_gpu_sate
- name: Validate cross-dispatch extended (12 checks)
run: cargo run --bin validate_cross_dispatch_extended
# Phase 3c expansion: additional GPU shader validators
- name: Validate GPU modes pairwise_l2 (9 checks)
run: cargo run --bin validate_gpu_modes
- name: Validate GPU directed multi_obj_fitness (10 checks)
run: cargo run --bin validate_gpu_directed
- name: Validate GPU signal hill_gate (13 checks)
run: cargo run --bin validate_gpu_signal
- name: Validate GPU swarm nn_forward (8 checks)
run: cargo run --bin validate_gpu_swarm
# Phase 4b: Pure GPU end-to-end pipelines
- name: Validate GPU pipeline HMM (5 checks)
run: cargo run --release --bin validate_gpu_pipeline_hmm
- name: Validate GPU pipeline ecology (5 checks)
run: cargo run --release --bin validate_gpu_pipeline_ecology
- name: Validate GPU pipeline spectral (5 checks)
run: cargo run --release --bin validate_gpu_pipeline_spectral
- name: Validate GPU pipeline genomics (5 checks)
run: cargo run --release --bin validate_gpu_pipeline_genomics
- name: Validate GPU pipeline modes (7 checks)
run: cargo run --release --bin validate_gpu_pipeline_modes
- name: Validate GPU pipeline directed (8 checks)
run: cargo run --release --bin validate_gpu_pipeline_directed
- name: Validate GPU pipeline signal (8 checks)
run: cargo run --release --bin validate_gpu_pipeline_signal
# Phase 4e: cross-dispatch expansion
- name: Validate cross-dispatch Phase 4e (17 checks)
run: cargo run --release --bin validate_cross_dispatch_phase4e
# Phase 4c: GPU PRNG
- name: Validate GPU PRNG xoshiro128ss (5 checks)
run: cargo run --release --bin validate_gpu_prng
# Phase 4d: ToadStool issue resolution
- name: Validate eigh_accuracy S-12 (9 checks)
run: cargo run --release --bin validate_eigh_accuracy
- name: Validate MHA GPU head shaders S-03b (10 checks)
run: cargo run --release --bin validate_mha_gpu
# Phase 5a: BarraCUDA GPU Tensor validation
- name: Validate BarraCUDA GPU spectral (12 checks)
run: cargo run --release --bin validate_barracuda_gpu_spectral
- name: Validate BarraCUDA GPU eco (20 checks)
run: cargo run --release --bin validate_barracuda_gpu_eco
- name: Validate BarraCUDA GPU HMM (8 checks)
run: cargo run --release --bin validate_barracuda_gpu_hmm
- name: Validate BarraCUDA GPU fitness (8 checks)
run: cargo run --release --bin validate_barracuda_gpu_fitness
- name: Validate BarraCUDA GPU neural net (8 checks)
run: cargo run --release --bin validate_barracuda_gpu_nn
- name: Validate BarraCUDA GPU pairwise (8 checks)
run: cargo run --release --bin validate_barracuda_gpu_pairwise
- name: Validate BarraCUDA GPU Anderson (8 checks)
run: cargo run --release --bin validate_barracuda_gpu_anderson
cross-validate:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install -r control/requirements.txt
pip install pytest
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-xval-${{ hashFiles('Cargo.toml') }}
- name: Run Python unit tests
run: python3 -m pytest tests/ -v --tb=short
- name: Validate cross-language parity (Rust vs Python)
run: |
cargo run --bin validate_surrogate
cargo run --bin validate_transformer
cargo run --bin validate_metrics
benchmarks:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- name: Run bench_phase0pp_kernels (Rust-only, no Python)
run: cargo run --release --bin bench_phase0pp_kernels
- name: Run bench_gpu_kernels (WGSL shader timing)
run: cargo run --release --bin bench_gpu_kernels
ipc-smoke-test:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
steps:
- uses: actions/checkout@v4
- name: Checkout barraCuda (standalone math primal)
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/barraCuda
path: ../barraCuda
sparse-checkout: crates/barracuda
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }}
- name: Install socat
run: sudo apt-get update && sudo apt-get install -y socat
- name: Build primal binary
run: cargo build --bin neuralspring --features primal
- name: IPC smoke test (health.liveness)
run: |
SOCKET_DIR=$(mktemp -d)
export BIOMEOS_SOCKET_DIR="${SOCKET_DIR}"
export FAMILY_ID=smoke
SOCKET_PATH="${SOCKET_DIR}/neural-spring-smoke.sock"
# Start primal in background (socket: $BIOMEOS_SOCKET_DIR/$CARGO_PKG_NAME-$FAMILY_ID.sock)
cargo run --bin neuralspring --features primal -- serve &
PRIMAL_PID=$!
# Wait for socket to appear (up to 10s)
for i in $(seq 1 20); do
if [ -S "${SOCKET_PATH}" ]; then
echo "Socket ready after $((i * 500))ms"
break
fi
sleep 0.5
done
if [ ! -S "${SOCKET_PATH}" ]; then
echo "FAIL: Socket not created within 10s"
kill $PRIMAL_PID 2>/dev/null || true
exit 1
fi
# Send JSON-RPC health.liveness probe
RESPONSE=$(echo '{"jsonrpc":"2.0","method":"health.liveness","params":{},"id":1}' | socat - UNIX-CONNECT:"${SOCKET_PATH}")
echo "Response: ${RESPONSE}"
# Verify response contains result (not error)
if echo "${RESPONSE}" | python3 -c "import sys,json; r=json.load(sys.stdin); assert 'result' in r, f'No result: {r}'; print('PASS: health.liveness')"; then
echo "IPC smoke test passed"
else
echo "FAIL: Invalid response"
kill $PRIMAL_PID 2>/dev/null || true
exit 1
fi
# Clean shutdown
kill $PRIMAL_PID 2>/dev/null || true
wait $PRIMAL_PID 2>/dev/null || true
rm -rf "${SOCKET_DIR}"