Skip to content

Reset recurrent policies on viewer truncations and inspect reset signature - #1331

Closed
M-Colley wants to merge 1 commit into
mujocolab:mainfrom
M-Colley:fix/viewer-recurrent-policy-reset
Closed

M-Colley wants to merge 1 commit into
mujocolab:mainfrom
M-Colley:fix/viewer-recurrent-policy-reset

Conversation

@M-Colley

Copy link
Copy Markdown
Contributor

BaseViewer._execute_step previously read only step(actions)[2] (terminated), so 5-tuple environments that ended an episode via truncated never reset recurrent policy hidden states during playback, and zero-argument or required-mask policy.reset callables could fail depending on whether reset() was invoked at episode done or full environment reset. This PR combines terminated | truncated on 5-tuple step returns and caches inspect.signature(policy.reset) per policy instance (including across checkpoint hot-swaps) so optional-mask, required-mask, and zero-argument reset methods all work consistently.

Fixes #1305

…ature

Combine terminated and truncated masks when stepping 5-tuple environments in BaseViewer so recurrent policy state resets on episode timeouts as well as terminations. Also inspect policy.reset once per policy instance so zero-argument and required-mask signatures work alongside rsl-rl's optional-mask signature, including across policy hot-swaps.

Fixes mujocolab#1305
@kevinzakka kevinzakka closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correctly reset recurrent policies with viewer, Round 2

2 participants