Expand description
Batched simulation engine for vectorized RL training.
BatchedEngine owns N LockstepWorlds and steps them all in a
single call, eliminating per-world FFI overhead. Observation extraction
uses ObsPlan::execute_batch() to fill a contiguous output buffer
across all worlds.
§Design
The hot path is step_and_observe: step all worlds sequentially, then
extract observations in batch. The GIL is released once at the Python
layer, covering the entire operation. This reduces 2N GIL cycles (the
current MurkVecEnv approach) to exactly 1.
Parallelism (rayon) is deferred to v2. The GIL elimination alone is
the dominant win; adding par_iter_mut later is a 3-line change.
Structs§
- Batch
Result - Result of stepping a batch of worlds.
- Batched
Engine - Batched simulation engine owning N lockstep worlds.
Enums§
- Batch
Error - Error from a batched operation, annotated with the failing world index.