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.1

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.1
File Actions
lockstep_train-0.6.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for lockstep_train-0.6.1-cp311-abi3-win_amd64.whl
lockstep_train-0.6.1-cp311-abi3-manylinux_2_39_x86_64.whl CPython 3.11 abi3 Linux glibc 2.39+ x86-64 Details for lockstep_train-0.6.1-cp311-abi3-manylinux_2_39_x86_64.whl
lockstep_train-0.6.1-cp311-abi3-manylinux_2_39_aarch64.whl CPython 3.11 abi3 Linux glibc 2.39+ ARM64 Details for lockstep_train-0.6.1-cp311-abi3-manylinux_2_39_aarch64.whl
lockstep_train-0.6.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for lockstep_train-0.6.1-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 71.9 MB

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

Download URL lockstep_train-0.6.1-cp311-abi3-win_amd64.whl
Size 17.6 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4e6ac4c095f3e2982d97e52bc2f9dd5ba4abb4ae85cbaa73cf6e849756560a7d
BLAKE2b-256 checksum
How to use checksums
ba0c7f87d602a168fc14d0855979af994631eda49630a602657ea21daa6eaa42
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 10, 2026.

Transparency log

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

Download URL lockstep_train-0.6.1-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
298c0f4b3d776cc13fa2f36c25ba16bc938099405fece6643402e2d75e179bdb
BLAKE2b-256 checksum
How to use checksums
43266e5dbd6d86c517db7cb12def04d34d526b77fd42fc05782e6027ddf35505
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 10, 2026.

Transparency log

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

Download URL lockstep_train-0.6.1-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
90c8a2570aabf5bd2b2350b376b1956404fa3966e122b78f925d232f0164581a
BLAKE2b-256 checksum
How to use checksums
3d364570f35b3d543752bd963e48d242750f29df38a158c3cc2cd8c1df6fd349
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 10, 2026.

Transparency log

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

Download URL lockstep_train-0.6.1-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
2961fdcd35d4593cf85cbcb99c9b5913c809fd2cf5be360d95eb90693b5e5722
BLAKE2b-256 checksum
How to use checksums
cdea7014a5bc5ced20e14ee03c6640972c670c8a6d9b166597abbc057984d1f5
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 10, 2026.

Transparency log

Security for lockstep-train 0.6.1

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.1-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 10, 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