Releases: Achronus/envrax
Release list
v0.1.10
New Features
- Added
BatchedEnvABC class — acts as the contract for any environment that producesNindependent agent results per step.VecEnvis one example being the base implementation that uses it. Any downstream packages can ship their own (e.g., composite multi-agent scenes) and slot them intoMultiVecEnvwithout the need forenvraxchanges. - Added
nameproperty toJaxEnv(defaults to subclass name);Wrapperwhich delegates to inner environment. Required byMultiEnv/MultiVecEnvfor automatic creation of dictionary keys. MultiEnvandMultiVecEnvnow accept either a list (keys auto-derived fromenv.namewith_0/_1suffixes on duplicates) or a custom dictionary with personalised keys.
Breaking Changes
MultiVecEnvis rewritten as a JAX-native, dict-keyed container. State is nowDict[str, chex.ArrayTree]to represent a proper pytree. The cross-env-type (vectorized envs) dispatch loop runs inside a singlejax.jitboundary, eliminating per-call Python overhead.MultiEnvrefactored to match the dict-keyed pattern (dispatch stays Python-loop based — each inner env keeps its own compile cycle).make_multiandmake_multi_vecnow take pre-built env instances (List | Dict) instead of registered names. Construct envs viamake/make_vecfirst, then bundle.- Removed:
reset_at,step_at,class_groups— access inner envs directly viamulti.envs[key]. - Renamed:
num_envs→n_envs,total_envs→total_slots,vec_envs→envs(onMultiVecEnv). VecEnv.render(state, index=0)is nowrender_slot(state, slot_idx=0); addedslot_state(state, slot_idx)for raw single-slot state extraction.
Improvements/Adjustments
VecEnvauto-reset is replaced withjax.lax.condand ajnp.wheremask. Same semantics, half the HLO size for faster compilation.VecEnv.compile()now warms both the typical anddone=Truereset branches, so the first real episode termination doesn't pay a fresh compile cost.- Documentation updated to match the new API surface.
v0.1.9
v0.1.8
v0.1.7
Tweaks
- Default XLA complication cache directory now set to
<cwd>/.jax_cachefor greater project flexibility and monitoring. Path can be overridden by settingENVRAX_CACHE_DIR
Bug Fixes
- Fixed
make_vecandmake_multi_vecsilently bypassing the persistent cache whenpre_warm=False. Cache is now configured wheneverjit_compile=True, regardless ofpre_warm
v0.1.6
New Features
Spacenow declaresshapeanddtypeas part of its contract. Custom spaces with computed shapes use thefield(init=False)+__post_init__pattern (see the custom spaces tutorial).- New properties on
MultiEnvandMultiVecEnv:observation_shapes/action_shapes,observation_sizes/action_sizes,observation_dtypes/action_dtypes(plussingle_*variants onMultiVecEnv), and apad_dims()method returning(max_action_size, max_observation_size)across the fleet.
v0.1.5
v0.1.4 — First Usable Release
v0.1.4 — First Usable Release
This release marks the first version of Envrax that's practically usable end-to-end as an API standard. Earlier releases established the shape of the package, but several rough edges in the public surface have been cleaned up so that you can actually pick it up, build your environments and use them without issues.
What's New
Documentation
We've introduced a comprehensive documentation suite to guide you through using the package and getting the most out of it. It includes:
- An Essentials track - this walks you through the key parts of the standard. From understanding the key building blocks, through to building your first environment, vectorizing it, and more!
- An Advanced track for more complicated use cases and customization options
- A "Getting Started" guide with
uv/pip/poetryinstall paths
API Reform
Several breaking changes were made to fix design issues that would have been painful to live with longer-term. Here's some key highlights:
JaxEnvis now generic with four type parameters. Subclasses now declareJaxEnv[ObsSpaceT, ActSpaceT, StateT, ConfigT](e.g.BallEnv[Box, Discrete, BallState, BallConfig]), giving full IDE autocomplete and static type-checking onenv.observation_space,env.action_space,env.config, and theEnvStatereturned byreset/step. Previously these returned untyped values, forcing horrible hacky overrides or# type: ignorerequirements. As engineers, we are huge fans of clean, easily readable and maintainable code - hacky overrides be damned!make()andmake_vec()no longer return tuples. Previously they returned(env, config)even thoughenv.configalready exposed the resolved config. Now they just return the environment, matchingmake_multi()/make_multi_vec()for a consistent factory surface and aligning more with the Gymnasium API structure.make_multi()/make_multi_vec()lost their config parameter. The old sharedconfigparameter was either silently broken or misleading on heterogeneous fleets. Different environments have different config types so trying to pass a single config across varying environment doesn't make sense!- They're now true "suite builders" in that they use each environment's registered default config. Per-env overrides are still possible but now handled through manual
MultiEnv([make(...), ...])composition or pre-registered variants. RecordVideonow fails fast under JAX transforms. Previously, using it insidejax.jit/jax.vmap/jax.lax.scanwould silently produce empty MP4s or confusing trace-time errors. It now detects tracers and raises a clearRuntimeErrorwhen first called to catch this issue faster.
Migration
The biggest difference from the previous release is the environment creation:
# Before
class BallEnv(JaxEnv):
...
env, config = envrax.make("BallEnv-v0")
vec_env, config = envrax.make_vec("BallEnv-v0", n_envs=64)
# After
class BallEnv(JaxEnv[Box, Discrete, BallState, BallConfig]):
...
env = envrax.make("BallEnv-v0") # config is on env.config
vec_env = envrax.make_vec("BallEnv-v0", n_envs=64)For per-env config in multi factories, register the variants ahead of time or build MultiEnv / MultiVecEnv manually with make().
Further Development
With this release we are satisfied that the API standard is in a good state without the intention for any further major updates (for now at least). We built Envrax so that we could use it for our own experiments and environment suites, so we'll be doing our own extensive development to really get a feel for it and help weed out any "clunkiness".
We've tried to keep it as lightweight and flexible as possible so you, as the developer, have full control over building your own JAX-native environments that you can share to the world and use for your own research.
If you experience any bugs or want to discuss some potential additions/changes, feel free to open a ticket. Feedback is always welcome!