fix(gfootball): only increment elapsed_step when episode is not done#418
fix(gfootball): only increment elapsed_step when episode is not done#418hobostay wants to merge 1 commit into
Conversation
13d68c7 to
9920efd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13d68c779b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if self._step >= self._max_episode_steps: | ||
| done = True | ||
|
|
||
| self._elapsed_step += 1 | ||
| else: | ||
| self._elapsed_step += 1 |
There was a problem hiding this comment.
Increment elapsed_step on horizon terminal step
elapsed_step is intended to track the number of external step() calls, but this change skips the increment when _step >= _max_episode_steps. On episodes that end by time limit, the terminal transition is still a real action step, so the oracle now reports an elapsed_step that is one too small on the last step. That creates an off-by-one mismatch against EnvPool’s step-count semantics and can break gfootball alignment checks for tasks that truncate at horizon.
Useful? React with 👍 / 👎.
|
I checked this against the pinned upstream Google Research Football source. Upstream So the terminal transition is supposed to count toward EnvPool’s public I also verified this locally by restoring the unconditional increment and running: bazel test --test_output=errors --config=test --spawn_strategy=local -- //envpool/gfootball:gfootball_align_testResult: Recommendation: do not merge this as-is. Either close it, or replace it with a small comment documenting the upstream step-counting semantics so this does not look like an off-by-one bug later. |
Fix the elapsed_step counter in GfootballOracle to only increment when the episode is still active, not after the episode is already done. Previously elapsed_step was incremented on every step including the done step, causing it to be one higher than expected at episode end.