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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| lockstep_train-0.6.3-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for lockstep_train-0.6.3-cp311-abi3-win_amd64.whl |
| lockstep_train-0.6.3-cp311-abi3-manylinux_2_39_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.39+ x86-64 | Details for lockstep_train-0.6.3-cp311-abi3-manylinux_2_39_x86_64.whl |
| lockstep_train-0.6.3-cp311-abi3-manylinux_2_39_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.39+ ARM64 | Details for lockstep_train-0.6.3-cp311-abi3-manylinux_2_39_aarch64.whl |
| lockstep_train-0.6.3-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for lockstep_train-0.6.3-cp311-abi3-macosx_11_0_arm64.whl |
Total release size: 72.0 MB
Release files / lockstep_train-0.6.3-cp311-abi3-win_amd64.whl
| Download URL | lockstep_train-0.6.3-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 17.7 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5539689fb96b36c8e3afdc0e6471886a7209ec0c3ef7c869bd8bd0fb34e8fa3f
|
|
BLAKE2b-256 checksum How to use checksums |
30433085a37e0fdaa55810f12769e407360c088d00c94a416e9de6572f0d7c8e
|
| 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 15, 2026.
Transparency logRelease files / lockstep_train-0.6.3-cp311-abi3-manylinux_2_39_x86_64.whl
| Download URL | lockstep_train-0.6.3-cp311-abi3-manylinux_2_39_x86_64.whl |
|---|---|
| Size | 19.3 MB |
| Tags | CPython 3.11 Linux glibc 2.39+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1db5e17987a338162d7d261a07e5d27ce77fd44398a6253e169f6cd9e92e6c33
|
|
BLAKE2b-256 checksum How to use checksums |
a4042849b520aead3bb040276383ad626056734c5414318f117964b88348308b
|
| 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 15, 2026.
Transparency logRelease files / lockstep_train-0.6.3-cp311-abi3-manylinux_2_39_aarch64.whl
| Download URL | lockstep_train-0.6.3-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 |
a71cd564a48d6fed992ec0780e4edfd79bcf31640da41775cb60ef3a3c113e63
|
|
BLAKE2b-256 checksum How to use checksums |
b754e12fa4ef6cabb09d91a2d16d620f25d085325c3d375e2a6a2ad4129b9b5f
|
| 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 15, 2026.
Transparency logRelease files / lockstep_train-0.6.3-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | lockstep_train-0.6.3-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 16.3 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ff0011ed5065408ae76ff369af677577938024b83574924a66e0e71267aa8ef1
|
|
BLAKE2b-256 checksum How to use checksums |
f789ac02a9f9a189240c4b6c6dafabfd6fbf2a9ed70819ef92bde46dc1fb87cd
|
| 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 15, 2026.
Transparency logSecurity for lockstep-train 0.6.3
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.
Attestation for lockstep_train-0.6.3-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 15, 2026.
Transparency logA 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.