stable-envs-v1: Fast and Reproducible Environments with Controllable Variations
Abstract: Training World Models (WMs) relies on processing large amounts of high-dimensional data, which typically needs to be stored, read into memory, and moved from memory to compute units. In principle, GPU-native rendering avoids this movement of large image tensors from memory to compute cores, allowing for better GPU utilization, and training speed-ups. Rendering on-demand also allows to control perceptual appearance through the application of visual variations on-the-fly, allowing for higher diversity in training. To this end, we introduce stable-envs, an open-source library for fast, GPU-native rendering allowing to apply controllable variations on multiple simulation environments. By rendering image observations directly on GPU, stable-envs allows end-to-end training speed-ups of up to 1.33x, with no loss of performance. Besides faster training runs, stable-envs also enables reproducible, large-scale evaluations through batched physics while maintaining full determinism. stable-envs currently supports 80 simulation environments across multiple CPU- and GPU-backends, and is openly available at: https://github.com/galilai-group/stable-envs
Paper Prompts
Sign up for free to create and run prompts on this paper.
Explain it Like I'm 14
1. What is this paper about?
This paper introduces stable-envs, a free software library for creating and displaying simulated environments quickly.
A simulated environment is a computer-made world, such as:
- A robot pushing a block
- A character moving through a maze
- A robotic arm reaching for an object
Researchers use these worlds to train world models. A world model is an artificial intelligence system that learns how the world works by watching images and predicting what will happen next.
The main problem is that working with millions of images can be slow. The paper presents a way to create these images directly on the computerโs graphics processor, or GPU, instead of repeatedly moving them between different parts of the computer.
2. What questions are the researchers asking?
The researchers mainly wanted to find out:
- Can simulated environments be made faster? They wanted to reduce the time needed to run simulations and create images.
- Can images be created directly on the GPU? This could avoid moving large image files between the computerโs CPU and GPU.
- Can the same physical situation be shown with different appearances? For example, can the color of an object or the background be changed while keeping the objectโs position and movement exactly the same?
- Will the faster system still be accurate? The researchers needed to check that stable-envs produces the same physics and nearly the same images as the original simulation programs.
- Does faster simulation lead to faster AI training? They tested whether world models could learn more quickly without becoming worse at planning.
3. How did the researchers do it?
Running many environments at once
Instead of running one simulation at a time, stable-envs can run many copies together. This is called batched simulation.
For example, rather than simulating one robot, it might simulate 256 robots at the same time. This is similar to baking 256 pizzas in several ovens at once instead of baking them one by one.
The library can run both:
- The physics, which describes how objects move and collide
- The rendering, which creates the picture showing what the environment looks like
Rendering images on the GPU
The researchers designed stable-envs so that the GPU can create image frames directly.
A GPU is a computer component that is very good at doing many similar calculations at once. This makes it useful for drawing many images or simulating many environments in parallel.
Normally, images may be created on the CPU and then copied to the GPU for AI training. Since images can be very large, this copying takes time. stable-envs tries to avoid that extra movement.
Saving states instead of images
A simulationโs state is the information needed to describe what is happening. For example, it might include:
- The position of each object
- The speed and direction of movement
- The position of a robotโs joints
- Random information used by the simulation
Instead of saving every image, stable-envs can save these smaller states and create the images later when they are needed. This is like saving the instructions for a scene rather than saving every photograph of the scene.
This can save storage space and also allows researchers to render the same state:
- At different image sizes
- With different colors or visual appearances
- Using different visual settings
Checking accuracy
The researchers compared stable-envs with the original versions of the environments. They used the same starting state and the same actions, then checked:
- Whether the objects moved in the same way
- Whether the rendered images looked the same
- Whether AI systems trained with stable-envs performed just as well
They tested 80 environments from several groups, including robot control, navigation, classic control tasks, and other simulated worlds.
4. What did they find?
The simulations became much faster
stable-envs improved simulation and rendering speed substantially.
In some tests:
- Rendering was up to 24 times faster
- Some combined simulation-and-rendering tasks were more than 13 times faster
- Across the full set of environments, the library achieved speedups of up to about 8.5 times compared with the original approaches
The exact improvement depended on the environment, the computer hardware, and how many environments were run together.
World-model training became faster
When the researchers trained a world model using images from stable-envs, training became between 1.16 and 1.33 times faster.
This means that a training process that took about 330 seconds with the older system took about 291 seconds with stable-envs in one example.
The GPU was also used more effectively. For example, GPU usage increased in several environments because the GPU spent less time waiting for images to arrive.
Accuracy was almost unchanged
The physics produced by stable-envs was nearly identical to the original simulations.
For several environments, the maximum difference in the object movements was zero. In another case, the difference was only about , which is so small that it has no practical importance.
The images were also almost identical. Most image differences were extremely small. One environment, Reacher, showed slightly larger differences, but the researchers described them as negligible.
The AIโs planning ability stayed similar
The researchers also checked whether faster training harmed the world modelโs ability to plan.
The results were very similar:
| Environment | Original system | stable-envs |
|---|---|---|
| TwoRoom | 88.7% | 88.0% |
| PushT | 94.0% | 93.3% |
| Reacher | 80.0% | 79.3% |
| Cube | 74.0% | 71.3% |
These small differences suggest that stable-envs makes training faster without seriously reducing the AIโs performance.
Visual changes can be controlled
stable-envs can change visual details while keeping the physical situation the same. For example, researchers can change the color of a block without changing its location or movement.
This is useful because it lets researchers test whether an AI has learned the important physics or has simply memorized colors and backgrounds.
5. Why is this important?
Training AI systems from images can require huge amounts of data. Storing and moving all those images can use a lot of time, computer memory, and electricity.
stable-envs offers several possible benefits:
- Faster experiments: Researchers can train and test AI systems more quickly.
- Less storage: They can save compact simulation states instead of large collections of images.
- More reproducible research: Saving the exact state makes it easier to repeat the same experiment.
- Fairer testing: Researchers can change colors, lighting, or other visual details to see whether an AI truly understands the task.
- Wider access: The library supports many environments and different computer setups.
- Lower computing costs: More efficient GPU use may reduce the resources needed for training.
Conclusion
The paper presents stable-envs as a faster and more flexible way to create training data for AI systems that learn from images. Its main idea is to run many simulations together and render their images directly on the GPU.
The experiments show that stable-envs can make rendering much faster and world-model training up to about 1.33 times faster, while keeping the physics, images, and AI planning performance almost the same.
In the future, tools like stable-envs could help researchers build better robots and other intelligent systems more quickly, with less storage and lower computational costs.
Practical Applications
Immediate Applications
- Faster pixel-based world-model and reinforcement-learning training โ Academia / AI software. Researchers can use
stable-envsas a drop-in simulation and rendering layer for training visual world models, offline RL agents, and model-predictive-control systems. GPU-native rendering avoids repeatedly transferring image tensors from CPU to GPU and produced up to 1.33ร faster end-to-end training in the reported experiments, with comparable planning performance.- Potential workflow: simulate batched trajectories, render only the required frames on the GPU, and feed them directly into a world-model training loop.
- Dependencies: performance depends on GPU support, batch size, environment type, rendering resolution, and whether the learning pipeline is otherwise bottlenecked by model computation rather than simulation.
- High-throughput reinforcement-learning experimentation โ Academia / software engineering. Laboratories can run larger hyperparameter sweeps, ablation studies, and random-seed evaluations within the same computational budget. The library supports 80 environments and batched physics stepping, making it suitable for comparing algorithms across classic control, navigation, manipulation, robotics, and other domains.
- Potential tools: reproducible benchmark runners, multi-seed experiment managers, and automated algorithm-comparison pipelines.
- Dependencies: experiments must use supported environments or require additional environment ports; results should still be validated against the original simulator.
- Reproducible simulation benchmarks โ Academia / industry R&D. Explicit simulator-state access, deterministic stepping, and exact state restoration enable researchers to replay identical physical trajectories while changing only the visual appearance. This can improve debugging, regression testing, and fair comparison between visual-control methods.
- Potential workflow: save low-dimensional states and action sequences rather than large image datasets, then regenerate observations on demand.
- Dependencies: reproducibility assumes that the environment version, simulator backend, hardware-relevant numerical behavior, random seeds, and state representation are controlled.
- On-demand synthetic dataset generation โ AI research / computer vision. Instead of storing high-dimensional RGB frames, teams can store simulator states, actions, and metadata, rendering observations during training at the required resolution. This can reduce dataset storage and eliminate lengthy video-decoding or frame-preprocessing stages.
- Potential products: state-based dataset formats, GPU data loaders, and synthetic-data generation services for visual representation learning.
- Dependencies: the approach is most effective when the visual observation is determined by the simulator state. It does not directly replace storage for real-world images or simulations whose hidden rendering state is not fully captured.
- Controlled visual-domain randomization โ Robotics / computer vision / reinforcement learning. The variation API can alter visual factors such as object colors while preserving the underlying physical state. Researchers can therefore train agents under randomized appearances and evaluate whether learned policies depend on robust physical features rather than incidental textures or colors.
- Potential workflow: generate matched datasets in which identical state-action trajectories are rendered with different colors, camera or scene parameters, or other supported variations.
- Dependencies: only the visual factors exposed by each environment can be changed. The paper demonstrates controllable variation but does not establish that every type of nuisance factorโsuch as lighting, sensor noise, or realistic materialsโis supported.
- Automated simulator and renderer regression testing โ Software development / robotics. Source implementations and optimized implementations can be tested from identical initial states and action sequences. Dynamics errors and rendering differences can be measured automatically, helping maintain correctness when kernels, hardware backends, or environment ports are modified.
- Potential tools: continuous-integration tests that compare trajectories, pixel-level metrics, and downstream task success.
- Dependencies: pixel-level equality may not be appropriate for all renderers; small numerical differences, such as those reported for Reacher, may be acceptable if task-level behavior remains consistent.
- GPU-efficient robotics simulation โ Robotics research and prototyping. Supported MuJoCo, Fetch, manipulation, navigation, and human-motion environments can be used for parallel policy training and visual imitation-learning experiments. Batched simulation and rendering can increase throughput for methods that require many simulated rollouts.
- Potential applications: simulated grasping, pushing, reaching, navigation, trajectory prediction, and visual servoing.
- Dependencies: simulation-to-real transfer is not demonstrated. Real-world deployment additionally requires accurate dynamics, sensor modeling, latency modeling, safety validation, and hardware-specific testing.
- More accessible teaching and laboratory infrastructure โ Education / academia. Universities can use a common API to teach reinforcement learning, world models, GPU programming, and reproducible experimentation across multiple environment families. Rendering and simulation can be run on supported consumer or workstation GPUs rather than relying exclusively on specialized simulator stacks.
- Potential workflow: students save seeds and states, reproduce assignments exactly, and compare CPU and GPU implementations.
- Dependencies: the available hardware must support the relevant backend, and course materials must account for differences between simulated and physical environments.
- Policy and infrastructure planning through reproducible synthetic experiments โ Public-sector research. Government or policy research groups can use deterministic simulation pipelines to evaluate algorithmic decision-making and robustness under controlled visual conditions, particularly where scenarios involve navigation or physical interaction.
- Potential uses: auditing whether an agentโs behavior changes under irrelevant visual changes and creating repeatable test cases for public research benchmarks.
- Dependencies: the supported environments are laboratory simulations, not validated models of real infrastructure or social systems. Policy conclusions would require domain-specific calibration and external validation.
- Interactive development and debugging of embodied agents โ Industry R&D. Developers can render selected frames only when needed, inspect intermediate simulator states, and replay failed trajectories without regenerating an entire dataset. This can shorten the iteration loop for perception, planning, and control systems.
- Potential product: a debugging dashboard showing state, action, rendered observation, and controlled visual variants side by side.
- Dependencies: useful diagnostics require integration with the organizationโs experiment tracking, model checkpoints, and simulator metadata.
Long-Term Applications
- Large-scale training of general-purpose embodied agents โ Robotics / autonomous systems. A scalable GPU-native environment layer could support training agents across many tasks, embodiments, and visual conditions, potentially reducing the cost of collecting and processing synthetic experience.
- Potential systems: distributed world-model training platforms, multi-task robot policies, and simulation-based foundation models.
- Dependencies: scaling beyond the demonstrated 80 environments requires broader environment coverage, multi-GPU or cluster orchestration, stable interfaces across physics engines, and validation that aggregate speedups persist at large scale.
- Simulation-to-real transfer with systematic visual and sensor variation โ Robotics / autonomous vehicles / drones. Controlled rendering could become part of a domain-randomization pipeline that varies object appearance, camera parameters, illumination, textures, and sensor artifacts while maintaining known physical trajectories.
- Potential workflow: train on many controlled renderings, select policies robust to visual shifts, and validate on real hardware.
- Dependencies: the paper mainly demonstrates visual-factor control and does not show real-robot transfer. Realism, camera calibration, dynamics mismatch, sensor noise, and unmodeled contact behavior remain major risks.
- State-centric, resolution-flexible data standards โ AI data infrastructure. The idea of storing simulator states rather than fixed-resolution frames could lead to compact datasets that generate multiple observation modalities or resolutions on demand. A single trajectory might support low-resolution pretraining, high-resolution evaluation, and different visual randomization regimes.
- Potential products: interoperable state-trajectory repositories, lazy-rendering data loaders, and storage systems for synthetic embodied-AI datasets.
- Dependencies: a common state schema, long-term simulator compatibility, versioned rendering functions, and sufficient metadata are needed. States from one simulator may not be portable to another.
- Differentiable or gradient-aware simulation pipelines โ Robotics / control / scientific computing. Combining fast batched rendering with differentiable physics or differentiable rendering could enable joint optimization of perception, dynamics models, and control policies.
- Potential applications: system identification, trajectory optimization, camera-placement optimization, and end-to-end visuomotor learning.
- Dependencies:
stable-envsitself is not presented as a differentiable simulator. Further work must address gradients through contacts, discontinuities, rendering, and stochastic transitions.
- Standardized robustness and fairness evaluations for visual agents โ Academia / industry governance. Matched physical states with independently varied appearances could support benchmark suites that measure whether an agentโs predictions or actions remain stable under irrelevant visual changes.
- Potential outputs: robustness certificates or scorecards for world models, robot policies, and visual planners.
- Dependencies: visual invariance is only one dimension of robustness. Benchmarks would need agreed variation taxonomies, task-specific metrics, and links between simulator performance and real-world safety.
- Synthetic-data-based testing for autonomous systems โ Automotive, drones, logistics, and industrial robotics. Deterministic replay combined with controlled visual changes could generate repeatable edge-case test suitesโfor example, identical trajectories under different object colors, scene layouts, or camera conditions.
- Potential workflow: reproduce a failure from a saved state, perturb visual factors, and determine whether the failure is physical, perceptual, or policy-related.
- Dependencies: safety-critical use requires high-fidelity scenario models, formal test coverage, validated sensor simulation, and certification processes. The reported benchmarks are not sufficient for direct deployment in safety-critical systems.
- Cloud simulation and training services โ AI infrastructure / industry. GPU-native rendering and low-dimensional state storage could underpin hosted services that provide parallel simulation, on-demand frame generation, and reproducible experiment snapshots.
- Potential product: an API for launching batches of environments, streaming rendered observations directly to GPU workloads, and restoring named simulator states.
- Dependencies: cloud deployment would require multi-tenant isolation, hardware portability, scheduling, checkpoint versioning, and predictable performance across GPU generations.
- Personalized and interactive educational environments โ Education / daily life. The same underlying task could be rendered with different visual themes, difficulty settings, or interfaces while preserving task dynamics. This could support adaptive teaching tools for control, robotics, and interactive problem-solving.
- Potential applications: virtual laboratories, visual-navigation exercises, and personalized reinforcement-learning tutoring environments.
- Dependencies: educational effectiveness is not evaluated in the paper; real products would require user studies, accessibility design, content authoring tools, and safeguards against confusing visual variation with changes in task difficulty.
Glossary
- Batched calls: Invoking an operation simultaneously across multiple environments or data items. โstable-envs implements higher-level factor-of-variations and batched calls to stepping methodsโ
- Batched physics: Computing the physical dynamics of many simulated environments in parallel. โstable-envs enables reproducible, large-scale evaluations through batched physics while maintaining full determinism.โ
- Batched rendering: Rendering observations for multiple environments or states in a single parallelized operation. โThrough optimizations such as batched rendering and custom GPU kernelsโ
- Bijective mapping: A one-to-one correspondence in which each element in one representation uniquely determines an element in another. โby exploiting the bijection between the environment's state and its visual outlook.โ
- Compute cores: Hardware units within a processor that execute computational instructions. โavoids this movement of large image tensors from memory to compute coresโ
- Continuous control: Control of a system using actions drawn from a continuous-valued space rather than a finite set of discrete actions. โPixel-based World Models (WMs) learn environmental dynamics solely from visual observations.โ
- Custom GPU kernels: Specialized GPU programs written to perform particular computational operations efficiently. โstable-envs achieves up to 8.5x higher environment throughput than CPU-native baselines.โ
- Data augmentation: Applying transformations or variations to data to increase its diversity during model training. โallowing for higher diversity in training.โ
- Determinism: The property that identical initial conditions and inputs produce identical computational results. โwhile maintaining full determinism.โ
- Dynamics stepping: Advancing a simulated system from one state to the next according to its physical or environment dynamics. โdynamics stepping (Code ex.~\ref{lst:simulate}), and rendering (Code ex.~\ref{lst:render}).โ
- Egocentric: Describing an observation or representation defined relative to an agentโs own viewpoint. โAll environments currently support batched physics stepping and rendering on the GPUโ
- End-to-end training: Training that includes all computational stages from input generation or preprocessing through model optimization. โstable-envs enables up to 1.33x faster training of WMs through stable-worldmodelโ
- Environment vectorization: Executing multiple instances of an environment in parallel, typically using batched data structures. โExisting libraries typically achieve high throughput through CPU-based environment vectorization and parallelizationโ
- Factor of variation: An independently controllable variable that changes the appearance or configuration of generated data. โenabling fully-reproducible experiments under controlled visual changes.โ
- Frame throughput: The rate at which image frames can be generated or processed. โHowever, rendering can itself become a training bottleneck, making frame throughput critical for efficient training.โ
- GPU utilization: The proportion of available GPU computation time or capacity being used by a workload. โAcross four environments (TwoRoom, PushT, Reacher and Cube), training runs are (1) 1.16--1.33 fasterโ
- High-dimensional data: Data represented by a large number of variables, coordinates, or features. โTraining World Models (WMs) relies on processing large amounts of high-dimensional dataโ
- Implicit state: A compact internal representation from which an explicit observation, such as an image, can be generated when needed. โstable-envs allows to store datasets using only implicit states that are then rendered on-the-flyโ
- Latent dynamics model: A model that represents system states in a learned hidden representation and predicts how those representations evolve. โLearning latent dynamics for planning from pixelsโ
- Low-dimensional state: A representation containing substantially fewer variables than the corresponding observation, such as an image. โstable-envs allows datasets to be stored as low-dimensional simulator statesโ
- MJX: A JAX-based implementation of MuJoCo physics designed to support accelerated, typically GPU-compatible, simulation. โwhereas on GPU it runs batched MuJoCo Warp, MJX or Pytorch kernelsโ
- MuJoCo: A physics engine for simulating articulated and rigid-body systems, commonly used in robotics and reinforcement learning. โOn GPU it runs batched MuJoCo Warp, MJX or Pytorch kernelsโ
- MuJoCo Warp: A GPU-accelerated implementation or integration of MuJoCo simulation operations. โstable-envs can render static scenes once per each configuration across the batchโ
- On-the-fly rendering: Generating visual observations during execution or training rather than storing them in advance. โFor WMs trained in simulation, rendering observations (1) on-the-fly and (2) directly on the GPUโ
- Perceptual appearance: The visual characteristics of an observation as perceived by a viewer or model. โRendering on-demand also allows to control perceptual appearance through the application of visual variations on-the-flyโ
- Pixel-space trajectory: A sequence of observations represented as image pixels, usually collected while an agent interacts with an environment. โopen-source libraries built for training models from pixel-space trajectoriesโ
- Pixel-based World Model: A predictive model that learns environmental dynamics from visual observations represented as pixels. โPixel-based World Models (WMs) learn environmental dynamics solely from visual observations.โ
- Physics backend: The underlying software implementation responsible for simulating physical dynamics. โthese frameworks often rely on specialized simulation backends and hardware requirementsโ
- Pinned cores: CPU cores reserved or explicitly assigned to a process to reduce scheduling variability and improve measurement consistency. โCPU & AMD EPYC 9354, 8 pinned coresโ
- Process pool: A collection of worker processes used to execute tasks concurrently, often for parallel CPU computation. โusing vectorized kernels or process pools for CPU renderingโ
- Reproducibility: The ability to obtain the same results when repeating an experiment under the same conditions. โstable-envs also enables reproducible, large-scale evaluations through batched physicsโ
- Rendering parity: Agreement between the visual output of two rendering implementations. โTo assess environment correctness, stable-envs tests next-state dynamics and rendering parity with source environments separately.โ
- Rigid-body simulation: Physical simulation of objects whose shapes do not deform under applied forces. โBrax--a differentiable physics engine for large scale rigid body simulationโ
- Semantic correctness: The property that an output preserves the intended meaning or content of the reference output. โFurther, we assess rendering's semantic correctness by testing source and stable-envs's~rendering of the same underlying stateโ
- Simulator state: The complete set of variables needed to describe the current condition of a simulated environment. โstable-envs allows datasets to be stored as low-dimensional simulator statesโ
- State restoration: Reconstructing a simulatorโs exact prior condition from a saved representation. โstable-envs also enables exact state restorationโ
- Static scenery: Visual elements of a scene that remain unchanged across frames or environments. โstable-envs can render static scenes once per each configuration across the batchโ
- Stochastic information: Information describing randomness or probability-dependent aspects of a system. โstate payloads store the low-level deterministic and stochastic information about the environmentโ
- Tensor: A multidimensional numerical array commonly used to represent data in machine-learning systems. โboth approaches typically still require transferring decoded frames from CPU to GPUโ
- Throughput: The amount of work completed per unit of time, such as environments stepped or frames rendered per second. โstable-envs achieves up to 8.5x higher environment throughput than CPU-native baselines.โ
- Visual variation: A controlled modification to the appearance of an observation while preserving the underlying simulated state. โstable-envs also provides access to controlled visual variations from the same underlying physical stateโ
- World Model: A learned model of an environmentโs dynamics used to predict outcomes and support planning. โTraining World Models (WMs) relies on processing large amounts of high-dimensional dataโ




