[Bug]: Emitter reset preserves partial-droplet state across episodes
Bug Description
When droplet_length is omitted and the length accumulated during a step is below one particle size, Emitter.emit stores that partial length in _acc_droplet_len. Emitter.reset resets _next_particle but does not clear the accumulator. A scene reset therefore starts the next episode with emission time carried over from the previous episode.
With substep length 0.04 and particle size 0.1, two calls leave 0.08 accumulated without emitting. After reset, one 0.04 call adds the old 0.08, crosses the threshold, and emits immediately. A fresh emitter at the same point would have 0.04 accumulated and no emitted particle.
Steps to Reproduce
- Check out
c27875eb56947808b3105d25d3c09b6dd96484b3and install the repository environment. - Download the package from
emitter-reset-accumulator-poc.zip
- Run
uv run python reproducer.py. - Observe that one call after reset emits using the previous episode's 0.08 partial length.
The script calls the production Emitter.emit and Emitter.reset methods. It patches only the sphere sampler to count when an emission occurs.
Expected Behavior
Emitter.reset should clear all episode-local emitter progress. After reset, the first 0.04 call should leave _acc_droplet_len == 0.04 and emit nothing.
Screenshots/Videos
Not applicable.
Relevant log output
before_reset accumulated=0.08 emitted=0
after_reset accumulated=0.00 emitted=1Environment
- OS: Ubuntu 24.04.5 LTS, Linux 7.0.0-28-generic x86_64
- GPU/CPU: CPU backend used for the deterministic proof
- GPU-driver version: N/A for reproduction
- CUDA / CUDA-toolkit version: N/A for reproduction
- Python 3.12.13, PyTorch 2.11.0
Release version or Commit ID
Genesis World 1.4.1, main commit c27875eb56947808b3105d25d3c09b6dd96484b3.
Additional Context
Sources:
- https://github.com/Genesis-Embodied-AI/genesis-world/blob/c27875eb56947808b3105d25d3c09b6dd96484b3/genesis/engine/entities/emitter.py#L48-L55
- https://github.com/Genesis-Embodied-AI/genesis-world/blob/c27875eb56947808b3105d25d3c09b6dd96484b3/genesis/engine/entities/emitter.py#L108-L120
Issue #1280 concerns scene rebuilding and state APIs, not emitter-local temporal state. I have a tested patch that resets the accumulator and adds focused regression coverage; after this issue is numbered, I will open and link a pull request.
Source: Genesis-Embodied-AI/genesis-world