Skip to main content

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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parallelcbf-0.1.0.tar.gz (31.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parallelcbf-0.1.0-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file parallelcbf-0.1.0.tar.gz.

File metadata

  • Download URL: parallelcbf-0.1.0.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parallelcbf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8664fde6abe092eea76c13ff33a3a4a7173714d4434788540478ba011c0129b
MD5 730bebbecfed4edb3bc8e00a11a07a97
BLAKE2b-256 26a90042bb0644168e0178559ba9237ba788b06ccb72efaaa4d8612f3cd76587

See more details on using hashes here.

File details

Details for the file parallelcbf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: parallelcbf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parallelcbf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e9873029dddb6dc8417d6ad0d3b018e36ef0b87436af926f590f467997d4915
MD5 212046e60fc587cec45d6627e003af6a
BLAKE2b-256 5bb36ac9d3299774f4f75ff59852556651936e9770cfe10276fab03b31836ec8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page