Deterministic, fixed-point, high-throughput Breakout vector environment
Project description
🕹️ Blazing-fast, deterministic Breakout for Reinforcement Learning 🕹️
breakout-turbo-env is a Python environment for running many deterministic Breakout games at once. It is for reinforcement-learning researchers and engineers who need reproducible transitions, fixed observations, and a Gymnasium vector-environment API. Build the native extension, create BreakoutVecEnv, and step it from Python; the repository also includes a playable window, benchmark, and two small training paths.
Fixed-point Rust physics owns game state and parallel stepping. Python exposes the Gymnasium lifecycle, rendering, snapshots, and branching helpers.
Install
Requirements: Python 3.11+, uv, and a Rust toolchain.
git clone https://github.com/tsilva/breakout-turbo-env.git
cd breakout-turbo-env
uv sync --extra dev
uv run maturin develop --release
Use BreakoutVecEnv from the repository root or an environment where the extension has been installed.
import numpy as np
from breakout_turbo_env import BreakoutVecEnv
env = BreakoutVecEnv(num_envs=4096, num_threads=8)
obs, infos = env.reset()
obs, rewards, terminated, truncated, infos = env.step(
np.zeros(env.num_envs, dtype=np.uint8)
)
done = terminated | truncated
if done.any():
obs, reset_infos = env.reset(options={"reset_mask": done})
Commands
uv run breakout-turbo-env play # open the interactive player
uv run breakout-turbo-env benchmark # measure the fixed 16-lane policy path
uv run pytest # run Python contract and regression tests
cargo test --lib # run Rust library tests
uv run python train.py jerk # train a deterministic JERK action tape
uv run python train.py ppo # train a PPO policy
uv run python play.py jerk # replay the newest JERK policy
uv run python play.py ppo # replay the newest PPO policy
make release # validate, tag, and publish a release
For player, benchmark, training, and replay options, append --help to the corresponding command.
Notes
- The standard observation batch is grayscale
uint8, CHW, and defaults to(num_envs, 4, 84, 84). Actions are0(noop),1(left), and2(right). - The environment is manual-reset only: after a terminal lane, call
reset(options={"reset_mask": mask})before stepping that lane again. Built-in layouts arefull,checker,tunnel, andsparse. render()returns the raw 96×96 RGB game frame; training observations use the processed grayscale stack. The interactive player accepts Left/Right or A/D, Space or R to reset, P to pause, and Escape to quit.- Training outputs live in
runs/<algorithm>/<timestamp>/. JERK policies usepolicy.json; PPO policies usepolicy.npz. make releaserequires a clean branch synchronized with its upstream. The release workflow builds and audits macOS arm64 and Linux x86_64 wheels before publishing to PyPI.
Architecture
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 Distributions
Built Distributions
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 breakout_turbo_env-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: breakout_turbo_env-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 288.7 kB
- Tags: CPython 3.11+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56dd173e9ffa0a9c919fdec6ba2eaf2eb0afba39eab755686ddbf6c587e8df0a
|
|
| MD5 |
8166b1cb00d76fe08ed18d563fefbd12
|
|
| BLAKE2b-256 |
01018eb9533d62ae7ea059587d0629e535de2908b8cd793f1f19a8a1ac3a35e3
|
Provenance
The following attestation bundles were made for breakout_turbo_env-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on tsilva/breakout-turbo-env
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
breakout_turbo_env-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
56dd173e9ffa0a9c919fdec6ba2eaf2eb0afba39eab755686ddbf6c587e8df0a - Sigstore transparency entry: 2169243112
- Sigstore integration time:
-
Permalink:
tsilva/breakout-turbo-env@e8db69e9eff4522b573a8807605576b152e2bbaa -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tsilva
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e8db69e9eff4522b573a8807605576b152e2bbaa -
Trigger Event:
push
-
Statement type:
File details
Details for the file breakout_turbo_env-0.2.0-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: breakout_turbo_env-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 258.1 kB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e17e95eab55e2ee0d32287d2a6cd4dc2aae4ecdaa86e63783bddc524c0fde520
|
|
| MD5 |
59604149fae928242a1a91113f979b07
|
|
| BLAKE2b-256 |
f7500c1d51c8602a1dcfef1e4f43cbdd69fa39b93481fd7cc0cc8b2ce97459c4
|
Provenance
The following attestation bundles were made for breakout_turbo_env-0.2.0-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on tsilva/breakout-turbo-env
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
breakout_turbo_env-0.2.0-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
e17e95eab55e2ee0d32287d2a6cd4dc2aae4ecdaa86e63783bddc524c0fde520 - Sigstore transparency entry: 2169243003
- Sigstore integration time:
-
Permalink:
tsilva/breakout-turbo-env@e8db69e9eff4522b573a8807605576b152e2bbaa -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tsilva
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e8db69e9eff4522b573a8807605576b152e2bbaa -
Trigger Event:
push
-
Statement type: