Skip to main content

SuperMarioBrosNes-turbo logo
🍄 More Mario rollouts. Less waiting. ⚡

CI status PyPI version Python 3.9 or newer MIT license

SuperMarioBrosNes-turbo is a Python environment for reinforcement-learning researchers running Super Mario Bros NES experiments. Collect rollouts through a deterministic Gymnasium vector API, with independent environments and reusable state snapshots.

15.4–17.3× the environment-step throughput of Stable Retro in matched benchmarks of v0.6.4 against Stable Retro v1.0.1 on a Ryzen 5 7600X. See workloads, methodology, and results.

Bring your own supported ROM. Start playing in two commands, or use the Python API below.

Quick start

Prebuilt wheels support Python >=3.9 on Apple-silicon macOS and x86-64 Linux. Install the CLI with uv and launch Level 1-1 with your local ROM:

uv tool install env-supermariobrosnes-turbo-emu
smb-turbo play --rom /absolute/path/to/SuperMarioBros.nes

Playback requires a discoverable SDL2 runtime. Use the arrow keys or A/D to move, X/J/Space to jump, Z/K/Shift to run, and Escape to quit.

Use from Python

Add the package to a uv-managed project:

uv add env-supermariobrosnes-turbo-emu
import gymnasium as gym

from env_supermariobrosnes_turbo_emu import Actions, action_batch

env = gym.make_vec(
    "env_supermariobrosnes_turbo_emu:EnvSuperMarioBrosNesTurboEmu-v0",
    game="SuperMarioBros-Nes-v0",
    state="Level1-1",
    rom_path="/absolute/path/to/SuperMarioBros.nes",
    num_envs=16,
    use_restricted_actions=Actions.ALL,
)

try:
    observations, infos = env.reset(seed=123)
    observations, rewards, terminated, truncated, infos = env.step(
        action_batch("right", env.num_envs)
    )

    done = terminated | truncated
    if done.any():
        observations, reset_infos = env.reset(
            options={"reset_mask": done.copy()},
        )
finally:
    env.close()

The module-qualified ID registers the vector-only factory; game is required. The native EnvSuperMarioBrosNesTurboEmuVecEnv constructor is also public.

What it provides

  • Collect experience across independent, seeded environments with native batched emulation and observation processing.
  • Repeat exact starts using saved states or live snapshots.
  • Reset or restore selected environments without disturbing the others.
  • Choose actions, observations, and game signals to suit your experiment.

See API.md for action tables, preprocessing options, state and snapshot controls, playback, and research-info contracts.

Compared with Stable Retro

Stable Retro is the broader choice for multiple games and emulators, multiplayer, RAM observations, and BK2 movie recording. Turbo specializes in one-player Super Mario Bros NES on mapper 0/NROM, with native vector execution, selective resets, image observations, state catalogs, snapshots, and separately available batched RAM. It is not a drop-in Stable Retro replacement.

Train with GradLab

Training implementations and recipes live in GradLab, outside this repository. Run either published, version-pinned recipe from any directory with your local ROM.

# Short PPO demonstration
uvx --python 3.14 gradlab@0.2.2 train SuperMarioBros-Nes-v0/Level1-1/turbo-demo --rom-path /absolute/path/to/SuperMarioBros.nes

# Go-Explore trajectory discovery capped at 20 million transitions
uvx --python 3.14 gradlab@0.2.2 train SuperMarioBros-Nes-v0/Level1-1/go-explore-20m --rom-path /absolute/path/to/SuperMarioBros.nes

GradLab verifies the ROM, shows live progress, writes a playable final_model.zip below ./runs, and prints a version-pinned playback command.

Register your ROM

Register the ROM once to use later commands without its path:

export RETRO_DATA_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/retro"
smb-turbo import /absolute/path/to/SuperMarioBros.nes
smb-turbo play
smb-turbo play Level2-1 --fps max  # choose a state and run uncapped

ROM files are never included in this repository or its distributions.

Notes

  • Imported ROMs use <RETRO_DATA_PATH>/stable/SuperMarioBros-Nes-v0/rom.nes.
  • The canonical ROM SHA-256 is f61548fdf1670cffefcc4f0b7bdcdd9eaba0c226e3b74f8666071496988248de.
  • Source builds, tests, parity checks, and contribution instructions are in CONTRIBUTING.md.
  • This unofficial research project is not affiliated with or endorsed by Nintendo. See NOTICE.md.

Architecture

SuperMarioBrosNes-turbo architecture diagram

See ARCHITECTURE.md for the native component boundaries and verification hooks.

License

Code is licensed under the MIT License. Third-party names, marks, and user-supplied content are excluded; see NOTICE.md.

Metadata

Release files for env-supermariobrosnes-turbo-emu 0.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for env-supermariobrosnes-turbo-emu 0.7.4
File Size Uploaded
env_supermariobrosnes_turbo_emu-0.7.4.tar.gz 17.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for env-supermariobrosnes-turbo-emu 0.7.4
File Interpreter ABI Platform
env_supermariobrosnes_turbo_emu-0.7.4-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
env_supermariobrosnes_turbo_emu-0.7.4-cp39-abi3-macosx_14_0_arm64.whl CPython 3.9 abi3 macOS 14.0+ ARM64 Details

Total release size: 18.5 MB

Release files / env_supermariobrosnes_turbo_emu-0.7.4.tar.gz

Download URL env_supermariobrosnes_turbo_emu-0.7.4.tar.gz
Size 17.5 MB
Tags Source
SHA-256 checksum
How to use checksums
24065f5540778a55b1fcbace5fc3c638edbecbc552f1a3a04d55896b24be8e09
BLAKE2b-256 checksum
How to use checksums
183e5de3a14eb45ca13b5dff6f0514a852e5992ef43151eb06ff1541bb49f720
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / env_supermariobrosnes_turbo_emu-0.7.4-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL env_supermariobrosnes_turbo_emu-0.7.4-cp39-abi3-manylinux_2_28_x86_64.whl
Size 532.2 kB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
8619113b2533d05a06deec1db1a36c0447032d9358982dc241f2a2002fc43ef6
BLAKE2b-256 checksum
How to use checksums
29e212d9b30688c3e58edac92a02ff68b94fd09aef3694a56f904956f14a912c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / env_supermariobrosnes_turbo_emu-0.7.4-cp39-abi3-macosx_14_0_arm64.whl

Download URL env_supermariobrosnes_turbo_emu-0.7.4-cp39-abi3-macosx_14_0_arm64.whl
Size 488.4 kB
Tags CPython 3.9 abi3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
bd0702f789b5ff1af5484b6e4a7bb918165e77a4ddc9c4ea2080e00b582504ac
BLAKE2b-256 checksum
How to use checksums
0e0eb894b7908b3571ab0811cc173a6539a48db2fbd9b7102d7b5f7ce9fc77e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.4 This release

3 release files

0.7.3

3 release files

0.7.2

3 release files

0.7.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page