Composable safety-filter interfaces for parallel robot learning.
Project description
ParallelCBF
Composable safety filters, deterministic test fixtures, and auditability tools for parallel robot-learning pipelines.
v0.2 cycle complete: 2D ParallelCBF archive. See tags for the exact code
state matching our arXiv preprint. The v0.2 release keeps the full
experiment-record audit trail in experiment_records_log/, including negative
results, spec defects, amendment history, and KF-001 through KF-005 telemetry.
While Isaac Lab provides massive parallel UAV simulation, OmniSafe and safe-control-gym provide constrained-RL benchmarks, and CBFKit provides control-barrier-function synthesis tooling, no existing framework unifies these capabilities for end-to-end safety-constrained training. ParallelCBF is the first framework to unify (i) tensor-parallel UAV environments, (ii) hard-gate CBF safety filters, (iii) sharded BC-to-RL pipelines, and (iv) first-class operational auditability — pre-registration, watchdog registries, failure forensics, and dataset audits as composable APIs rather than user-implemented scripts.
Why ParallelCBF?
ParallelCBF is a small, simulator-agnostic framework for composing:
- safety-aware environments;
- control barrier function safety filters;
- SB3/CleanRL-style algorithms;
- watchdogs, pre-registration artifacts, atomic checkpoints, and failure forensics.
The v0.1 scope is intentionally narrow: pure Python/NumPy/PyTorch CPU examples, strict type hints, property tests, and reusable contracts. Isaac Lab adapters, Mamba policies, and PPO training integrations are deferred to v0.2.
Capability Comparison
| Capability | ParallelCBF | Isaac Lab | OmniSafe | safe-control-gym | CBFKit |
|---|---|---|---|---|---|
| Simulator-agnostic safety API | ✅ | ❌ | ❌ | ❌ | ❌ |
| Extends Gymnasium-style envs | ✅ | ✅ | ✅ | ✅ | ❌ |
| Composable safety wrapper | ✅ | ❌ | ❌ | ❌ | ❌ |
| CBF safety-filter abstraction | ✅ | ❌ | ❌ | ❌ | ✅ |
| PyTorch batched CBF reference | ✅ | ❌ | ❌ | ❌ | ❌ |
| Strict broadcast-shape tests | ✅ | ❌ | ❌ | ❌ | ❌ |
| Property tests for invariance | ✅ | ❌ | ❌ | ❌ | ❌ |
| CPU-only reference environment | ✅ | ❌ | ✅ | ✅ | ❌ |
| Parallel/vectorized toy fixture | ✅ | ✅ | ✅ | ❌ | ❌ |
| Watchdog registry | ✅ | ❌ | ❌ | ❌ | ❌ |
| Failure-forensics rolling buffer | ✅ | ❌ | ❌ | ❌ | ❌ |
| Atomic checkpoint helper | ✅ | ❌ | ❌ | ❌ | ❌ |
| Pre-registration artifact commit | ✅ | ❌ | ❌ | ❌ | ❌ |
| Dataset audit as plugin | ✅ | ❌ | ❌ | ❌ | ❌ |
| MLOSS-oriented packaging/docs | ✅ | ✅ | ✅ | ✅ | ❌ |
Installation
python -m pip install -e ".[test]"
ParallelCBF v0.1 supports Python >=3.10,<3.14.
Quickstart
import numpy as np
from parallelcbf.algorithms import RandomActionAlgorithm
from parallelcbf.envs import Toy2DAvoidanceEnv
from parallelcbf.ops import DefaultWatchdogRegistry, ThresholdWatchdog
from parallelcbf.safety import NaiveDistanceCBF
from parallelcbf.api import SafetyWrapper
env = SafetyWrapper(Toy2DAvoidanceEnv(), NaiveDistanceCBF())
watchdogs = DefaultWatchdogRegistry()
watchdogs.register(ThresholdWatchdog("h_hard_violation", 0.0))
algo = RandomActionAlgorithm(seed=7)
obs, _ = env.reset(seed=7)
algo.learn(env, total_timesteps=20, callback=watchdogs)
assert obs.shape == (8,)
assert not watchdogs.should_halt()
Development
pytest tests
mypy --strict parallelcbf tests
pytest --cov=parallelcbf --cov-report=term-missing tests
The test suite pins CPU execution in tests/conftest.py to avoid accidental GPU
allocation in shared training environments.
Citation
If you use ParallelCBF, please cite the repository metadata in CITATION.cff.
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parallelcbf-0.1.1.tar.gz.
File metadata
- Download URL: parallelcbf-0.1.1.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99add70dd4455fcadaa67f0e7a2c155af8e471e7674b0155fcf3a19ad22a2d48
|
|
| MD5 |
38a85e01ef36472a719e982274ef7ab3
|
|
| BLAKE2b-256 |
62395bec56099100d294216ff5fe32dbdeb01e6b9c2dc9dbfbfdbfe0e0073c4c
|
File details
Details for the file parallelcbf-0.1.1-py3-none-any.whl.
File metadata
- Download URL: parallelcbf-0.1.1-py3-none-any.whl
- Upload date:
- Size: 66.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48298ed4ccd6db30fe24674bb24a99327226011c108efc202f70742f91d5d20f
|
|
| MD5 |
44578338ad91163f0233aa3580808dde
|
|
| BLAKE2b-256 |
24a7411456cabd7dfd51d87bbad9aef5af67a7c7016fbd4c35a9ef27eba8289b
|