Skip to content

[atari] Fix frame_skip=1 max-pool ghosting#370

Merged
Trinkle23897 merged 1 commit into
mainfrom
jiayi/fix-atari-frameskip1-maxpool
Apr 2, 2026
Merged

[atari] Fix frame_skip=1 max-pool ghosting#370
Trinkle23897 merged 1 commit into
mainfrom
jiayi/fix-atari-frameskip1-maxpool

Conversation

@Trinkle23897
Copy link
Copy Markdown
Collaborator

Summary

  • Problem: frame_skip=1 Atari steps were max-pooling the current frame with stale data from maxpool_buf_[0], which leaves bright ball/paddle trails in RGB observations.
  • Scope: Fix the Step() frame-buffer indexing and skip max-pool when there is only one frame to pool; no intended behavior change for frame_skip>1.
  • Outcome: frame_skip=1 now emits the current frame without stale-frame ghosting, while frame_skip>=2 keeps the existing max-pool behavior.

This is a minimal Atari-only fix for the one-frame max-pool edge case.

Technical Details

  • Approach: Use min(frame_skip_, 2) as the number of pooled frames, write the sole frame into maxpool_buf_[0] when frame_skip=1, and only call PushStack(..., maxpool=true) when frame_skip_ > 1.
  • Code pointers: envpool/atari/atari_env.h
  • Notes: Reset-time stack fill is unchanged.

Test Plan

Automated

  • git diff --check: passed
  • make bazel-pip-requirement-dev && USE_BAZEL_VERSION=8.6.0 BAZEL_RULES_QT_DIR=/opt/homebrew/opt/qt@5 bazelisk test --test_output=errors --config=test --spawn_strategy=local --action_env=PATH=/Users/jiayi/.virtualenvs/openai/lib/python3.12/site-packages/cmake/data/bin:/Users/jiayi/.virtualenvs/openai/bin:/opt/homebrew/bin:/bin:/usr/bin:/usr/local/bin //envpool/atari:atari_env_test: passed

Suggested Manual

  • Run a frame_skip=1 Atari RGB rollout and inspect a few frames/video to verify the ball and paddle no longer leave one-step trails.

@Trinkle23897 Trinkle23897 merged commit 3985ae2 into main Apr 2, 2026
8 of 9 checks passed
@Trinkle23897 Trinkle23897 deleted the jiayi/fix-atari-frameskip1-maxpool branch April 2, 2026 16:36
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.

1 participant