Skip to main content

lockstep-train

Every Lockstep environment — a robot, a fraud desk, a market, a jetpack duel — as a standard Gymnasium or PettingZoo environment. One package for all of them: each environment's engine declares its own observations, actions, reward and scoring, and lockstep-train turns that declaration into spaces.

It runs the same engine the platform's ranked matches and assessments run, so what you train against locally is exactly what you will be scored on.

Install

pip install lockstep-train               # Gymnasium
pip install "lockstep-train[pettingzoo]" # + multi-agent

Python 3.11+, prebuilt wheels for macOS (Apple silicon), Linux (x86_64, aarch64) and Windows (x86_64).

Quick start

import gymnasium as gym
import lockstep_train.env  # registers Lockstep/Env-v0
from lockstep_train.fetch import fetch

engine = fetch("jetpack-joust", mode="default", out="engines/jetpack-joust")["engine.wasm"]
env = gym.make("Lockstep/Env-v0", engine_source=str(engine))
obs, info = env.reset(seed=0)
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())

fetch downloads an environment's current release (its engine, plus any data it ships) once; engine_source takes that path, any other local engine.wasm, or an http(s) URL. Observations are a Dict of named arrays and actions a Box with per-element bounds, both straight from the engine's declaration. Browse the environments at exhibitions.lockstep.it.

Works with Stable-Baselines3, CleanRL, TorchRL or your own loop.

Seeds. reset(seed=s) fixes the session seed, and every later reset without a seed (each autoreset included) continues deterministically from s, so one seed reproduces a whole run, not just its first episode. An env that was never seeded draws each episode's seed from the OS.

Vectorized training

from lockstep_train.env import LockstepVectorEnv

envs = LockstepVectorEnv(num_envs=8, engine_source=str(engine))
obs, infos = envs.reset(seed=0)
obs, rewards, terminations, truncations, infos = envs.step(envs.action_space.sample())

N sessions step on native threads with the GIL released — no worker processes. gym.make_vec("Lockstep/Env-v0", num_envs=8, engine_source=...) works too. Autoreset is SAME_STEP: an ended episode's last observation is in infos["final_obs"].

Multi-agent

LockstepEnv drives one seat; any other seats play the engine's declared neutral action. To train every seat:

from lockstep_train.env import LockstepParallelEnv  # needs lockstep-train[pettingzoo]

env = LockstepParallelEnv(engine_source=str(engine))
observations, infos = env.reset(seed=1)  # agents: seat_0, seat_1, ...
observations, rewards, terminations, truncations, infos = env.step(
    {agent: env.action_space(agent).sample() for agent in env.agents}
)

Command line

python -m lockstep_train.info --env jetpack-joust [--mode M] [--json]
python -m lockstep_train.fetch --environment jetpack-joust [--mode M] [--out DIR]

info prints an environment's brief — the goal, what earns reward, what ends an episode, how you are scored, and every observation and action with its units and bounds. fetch is the command-line form of fetch() above.

Assessment environments

Environments a company invited you to are assessment-only: their releases download only with your API key. Mint one on the Authorization page at lockstep.it and set it before fetching:

export LOCKSTEP_API_KEY=<your key>          # PowerShell: $env:LOCKSTEP_API_KEY = "<your key>"

Going further

The lockstep-template wraps all of this in a complete workflow — create an agent, train it, run local matches, watch replays, and upload.

Metadata

Release files for lockstep-train 0.6.2

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

Built distributions (wheels)

Table of built distributions (wheels) for lockstep-train 0.6.2
File Actions
lockstep_train-0.6.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for lockstep_train-0.6.2-cp311-abi3-win_amd64.whl
lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_x86_64.whl CPython 3.11 abi3 Linux glibc 2.39+ x86-64 Details for lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_x86_64.whl
lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_aarch64.whl CPython 3.11 abi3 Linux glibc 2.39+ ARM64 Details for lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_aarch64.whl
lockstep_train-0.6.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for lockstep_train-0.6.2-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 71.9 MB

Release files / lockstep_train-0.6.2-cp311-abi3-win_amd64.whl

Download URL lockstep_train-0.6.2-cp311-abi3-win_amd64.whl
Size 17.6 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ee5cf1d90c9b6166cef19d48d0615bdbe98232abae3e8d043008645d512d71fa
BLAKE2b-256 checksum
How to use checksums
5d5cf236e795dcbc39bbcc91a238410576d8ac1a32956b9c62af8700ab864f34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Release files / lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_x86_64.whl

Download URL lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_x86_64.whl
Size 19.2 MB
Tags CPython 3.11 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
739845909657a2943e61aab2bf9333b21e9aa5902fc4d216feed9c0ac964ccf2
BLAKE2b-256 checksum
How to use checksums
39f57b5972838ad0c4c5b70b066c538bffc8834ae4465f97d071cba7f3b45f56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Release files / lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_aarch64.whl

Download URL lockstep_train-0.6.2-cp311-abi3-manylinux_2_39_aarch64.whl
Size 18.8 MB
Tags CPython 3.11 Linux glibc 2.39+ ARM64 abi3
SHA-256 checksum
How to use checksums
aeccb2a40c81e932b1566d2eeefefad3ec253124c4fef691afe4136c4dee4d40
BLAKE2b-256 checksum
How to use checksums
7e097f5cb6d3ab211adb248419990b93879c9d9a80d99b07fb0de322994761d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Release files / lockstep_train-0.6.2-cp311-abi3-macosx_11_0_arm64.whl

Download URL lockstep_train-0.6.2-cp311-abi3-macosx_11_0_arm64.whl
Size 16.2 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
09a19d296d51fe3593ffdbaf0d92ea9e1147c9efe3da3cd93ccbee7eda7bc1d6
BLAKE2b-256 checksum
How to use checksums
a6fcd0122b401716c340f2f2d69a329654d7b18e4003a0339513eba1f9f148d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Security for lockstep-train 0.6.2

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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for lockstep_train-0.6.2-cp311-abi3-win_amd64.whl

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 Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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