Deterministic, fixed-point, high-throughput Breakout vector environment
Project description
🕹️ Blazing-fast, deterministic Breakout for Reinforcement Learning 🕹️
breakout-turbo-env is a Python library for reinforcement-learning researchers
and engineers who need many reproducible Breakout games behind one Gymnasium
vector-environment API. Install it from PyPI, create BreakoutVecEnv, and step
every lane with one NumPy action batch.
Fixed-point Rust physics owns game state and parallel stepping. Python exposes manual reset, policy-ready observations, native rendering, exact snapshots, and side-effect-free action branching.
Install
Requires Python 3.11+ on Apple-silicon macOS 11+ or x86-64 Linux with glibc 2.28+.
pip install breakout-turbo-env
Install optional tools only when needed:
pip install "breakout-turbo-env[play]" # interactive Pygame player
pip install "breakout-turbo-env[train]" # local PPO training with PyTorch
To work from source, install uv and a Rust toolchain, then run:
git clone https://github.com/tsilva/breakout-turbo-env.git
cd breakout-turbo-env
uv sync --frozen --extra dev --extra play --extra train
make develop-release
Use
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})
env.close()
Importing the package also registers BreakoutTurbo-v0, so callers may use
gymnasium.make_vec("BreakoutTurbo-v0", ...). The complete lifecycle,
configuration, snapshot, and branching contract is in the
environment documentation.
Commands
uv run --extra play breakout-turbo-env play # open the player
uv run --extra play breakout-turbo-env play --uncapped
uv run breakout-turbo-env benchmark # benchmark the policy path
uv run python scripts/compare_stable_retro.py # run live differential checks
uv run ruff check . # lint Python
uv run pytest -m "not stable_retro" # run regular Python tests
cargo test --lib # run Rust tests
make test-stable-retro # require live cartridge parity
uv run python train.py jerk # train a deterministic action tape
uv run --extra train python train.py ppo # train a PPO policy
uv run --extra play python play.py jerk # replay the newest JERK policy
uv run --extra play python play.py ppo # replay the newest PPO policy
Append --help to the player, benchmark, training, or replay command for its
options.
Notes
- Native actions are
0noop,1FIRE,2right, and3left. The default policy observation is grayscaleuint8, CHW, and shaped(num_envs, 4, 84, 84). - Rewards are score deltas using Atari row scoring. There is no life-loss or board-clear shaping, and clearing the bricks does not terminate an episode.
- Autoreset is disabled. Reset terminated lanes explicitly with a Boolean
reset_mask; unselected lanes remain byte-exact. - The
fullstart targets Stable Retro's native 160×210 Atari Breakout frame, lifecycle, physics, raster, rewards, collision behavior, and public trajectory values. In particular,ball_yuses the Atari RAM convention where zero means the serve is waiting for FIRE.render()returns the RGB frame separately from policy observations. - Live validation requires a separately obtained lawful ROM and a sibling
stable-retro-turbocheckout. No ROM, save state, or recorded reference frame is distributed by this project. - Only Apple-silicon macOS and x86-64 Linux are supported. See support, benchmarking, and release validation for exact boundaries.
- The project is a
0.xcommunity preview. Public changes are recorded in the changelog; snapshots are portable only within the same package version and compatible configuration.
Architecture
License
MIT. See third-party notices for Atari, Stable Retro, ROM, and trademark boundaries.
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 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.3.1.tar.gz.
File metadata
- Download URL: breakout_turbo_env-0.3.1.tar.gz
- Upload date:
- Size: 10.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39fbe74da30f193a4c60d38e1c4ccee610f0fdc39e293985b56e8202f405090f
|
|
| MD5 |
bd05807f53e8103efa1fac1ca29f6cdf
|
|
| BLAKE2b-256 |
27bab5a49d7c24ec3741a5aa6b39b4af7c63dccb31a53187bed070e4838d69d3
|
Provenance
The following attestation bundles were made for breakout_turbo_env-0.3.1.tar.gz:
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.3.1.tar.gz -
Subject digest:
39fbe74da30f193a4c60d38e1c4ccee610f0fdc39e293985b56e8202f405090f - Sigstore transparency entry: 2205519919
- Sigstore integration time:
-
Permalink:
tsilva/breakout-turbo-env@4e9dbbc08cfa6dc3b4344902a8953d5b1a4c1bcf -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/tsilva
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4e9dbbc08cfa6dc3b4344902a8953d5b1a4c1bcf -
Trigger Event:
push
-
Statement type:
File details
Details for the file breakout_turbo_env-0.3.1-cp311-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: breakout_turbo_env-0.3.1-cp311-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 295.4 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.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cfe45a8d9a68ac21b8e9f9a4b1885f5dc5245c69db4b7e1aa2e043243d6c71a
|
|
| MD5 |
db17668c1b2b1d34f8eade1c9ef85acd
|
|
| BLAKE2b-256 |
ea7435fa87759caf0a56e265bc7c8b74160753888a4c4632da50e2808a9c716e
|
Provenance
The following attestation bundles were made for breakout_turbo_env-0.3.1-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.3.1-cp311-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
6cfe45a8d9a68ac21b8e9f9a4b1885f5dc5245c69db4b7e1aa2e043243d6c71a - Sigstore transparency entry: 2205519952
- Sigstore integration time:
-
Permalink:
tsilva/breakout-turbo-env@4e9dbbc08cfa6dc3b4344902a8953d5b1a4c1bcf -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/tsilva
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4e9dbbc08cfa6dc3b4344902a8953d5b1a4c1bcf -
Trigger Event:
push
-
Statement type:
File details
Details for the file breakout_turbo_env-0.3.1-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: breakout_turbo_env-0.3.1-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 265.9 kB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb972f62c3ed3702e32c7116d3323efc0f2187026fb9e2c09fadd99efd2d37e8
|
|
| MD5 |
2ef1ffd2f8de33cfda51178c958d0afb
|
|
| BLAKE2b-256 |
02f0e2a200c1219e0a3463bac21db4f303688c4cad27d6b98ffe962769838de8
|
Provenance
The following attestation bundles were made for breakout_turbo_env-0.3.1-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.3.1-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
bb972f62c3ed3702e32c7116d3323efc0f2187026fb9e2c09fadd99efd2d37e8 - Sigstore transparency entry: 2205519933
- Sigstore integration time:
-
Permalink:
tsilva/breakout-turbo-env@4e9dbbc08cfa6dc3b4344902a8953d5b1a4c1bcf -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/tsilva
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4e9dbbc08cfa6dc3b4344902a8953d5b1a4c1bcf -
Trigger Event:
push
-
Statement type: