Skip to content

Validation and QA

Python tests

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -p hypothesis.extra.pytestplugin tests/ -q

Coverage gate (matches CI threshold):

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -p hypothesis.extra.pytestplugin -p pytest_cov tests/ --cov=scpn_control --cov-report=term --cov-fail-under=99

Rust workspace checks

cd scpn-control-rs
cargo build --workspace
cargo clippy --workspace -- -D warnings
cargo test --workspace

Rust/Python interop checks (PyO3 + maturin)

python -m venv .venv
. .venv/bin/activate  # On Windows PowerShell: .\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip maturin pytest hypothesis
cd scpn-control-rs/crates/control-python
python -m maturin develop --release
cd ../../..
python -m pip install -e .
python -c "import importlib.util; from scpn_control.core._rust_compat import _rust_available; assert importlib.util.find_spec('scpn_control_rs') and _rust_available()"
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -p hypothesis.extra.pytestplugin tests/test_rust_python_parity.py tests/test_rust_compat_wrapper.py tests/test_snn_pyo3_bridge.py -v

Local acceptance campaigns

Free-boundary tracking acceptance on the real FusionKernel path:

python validation/free_boundary_tracking_acceptance.py

The acceptance report covers nominal tracking, external coil-current kicks, topology-aware X-point/divertor tracking under kick disturbance, measurement-fault exposure and correction for both generic shape tracking and topology-aware X-point/divertor tracking, supervisor/fallback safety under a large kick, and severity sweeps for generic disturbance, topology-aware disturbance, generic measurement faults, delayed-measurement latency and latency compensation, topology-aware measurement faults, and actuator limits, topology-aware measurement-plus-latency scenarios, plus combined topology disturbance-and-calibration-fault scenarios including actuator-constrained supervisor/fallback lanes and their measurement-severity sweeps.

This writes:

  • validation/reports/free_boundary_tracking_acceptance.json
  • validation/reports/free_boundary_tracking_acceptance.md

CI workflows

  • Core CI: .github/workflows/ci.yml
  • Docs and Pages deployment: .github/workflows/docs-pages.yml
  • PyPI publish workflow: .github/workflows/publish-pypi.yml

CI quality gates in .github/workflows/ci.yml

  • python-tests (3.10/3.11/3.12/3.13/3.14 Ubuntu + 3.12 Windows + 3.12 macOS; mypy + coverage on 3.12)
  • python-lint (ruff check + ruff format)
  • python-security (bandit SAST)
  • python-audit (pip_audit)
  • python-benchmark (E2E control latency)
  • notebook-smoke (executes CI notebook set; full neuro notebook only if sc_neurocore is available)
  • package-quality (build + twine check)
  • rmse-gate (SPARC GEQDSK + synthetic DIII-D regression bounds)
  • e2e-diiid (end-to-end mock DIII-D shot test)
  • real-diiid (17 real DIII-D disruption shots)
  • jax-parity (JAX transport, neural equilibrium, GS solver parity tests)
  • nengo-loihi (LIF+NEF SNN wrapper emulator tests)
  • rust-tests (cargo test --workspace + clippy + fmt)
  • rust-python-interop (maturin build + PyO3 parity)
  • rust-benchmarks (Criterion, uploads bench-results artifact)
  • rust-audit (cargo-audit vulnerability scan)
  • cargo-deny (license + advisory supply-chain policy)