Skip to content

Results viewer: two-pass episode rendering so frame encoding cannot perturb the policy - #164

Merged
merlerm merged 2 commits into
viewer-env-teardownfrom
viewer-two-pass-render
Sep 2, 2026
Merged

Results viewer: two-pass episode rendering so frame encoding cannot perturb the policy#164
merlerm merged 2 commits into
viewer-env-teardownfrom
viewer-two-pass-render

Conversation

@merlerm

@merlerm merlerm commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Render jobs used to call the policy with per-step env.render() and GIF encoding inside the rollout loop. That slows the episode ~18x, and generated policies with wall-clock planning gates then fail episodes they actually solved: in transport3d run 6a69a949/replicate_24, every recorded success (168-396 steps) rendered as a spurious run-to-horizon failure because the policy's 40 s internal deadline fired under render overhead (bare replays reproduce the recorded results exactly; the failure brackets between 1.3x and 1.5x slowdown).

The worker now rolls the policy out once without rendering, recording the action tape — this pass supplies the reported metrics — then replays the tape into an identically seeded env for the GIF, so the policy's clock never sees frame encoding. A step-count mismatch between the passes logs a divergence warning without failing the job. Re-rendered, the four transport3d episodes come out at exactly recorded-steps+1 frames, and files shrink ~6x since divergent full-horizon renders are gone.

@merlerm merlerm changed the title Results viewer: render episode replays from a recorded action tape Results viewer: two-pass episode rendering so frame encoding cannot perturb the policy Aug 20, 2026
@merlerm
merlerm requested a review from yichao-liang August 21, 2026 08:49
@merlerm
merlerm force-pushed the viewer-two-pass-render branch from a46ce3b to e6d6f66 Compare August 21, 2026 10:05
Capturing a frame per step and encoding it into the GIF adds seconds to a
rollout, and a generated policy that gates its behaviour on the wall clock
then misses its own deadlines and fails an episode it solves during
evaluation. A replay now rolls the policy out with rendering off and records
its actions, and a second pass replays that tape into an identically seeded
environment with rendering on. The reported metrics come from the first
pass; a step-count mismatch between the two is logged as a divergence.
The recorder and playback shims implement the reset/step/update protocol
run_episode drives, without inheriting BaseApproach's constructor state;
the casts keep the annotation satisfied.
@merlerm
merlerm force-pushed the viewer-two-pass-render branch from e6d6f66 to 9c486b0 Compare September 2, 2026 09:14
@merlerm
merlerm merged commit c2bbd9b into main Sep 2, 2026
4 checks passed
@merlerm
merlerm deleted the viewer-two-pass-render branch September 2, 2026 10:43
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.

2 participants