Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix envpool bug with missing mask key #3026

Merged
merged 1 commit into from
Aug 15, 2022
Merged

Conversation

arjun-kg
Copy link
Contributor

Description

There is a bug when using latest gym (v0.25.1) with envpool. See #3021.

This arises since gym requires _X mask key to be present in infos to indicate if element i in infos[X] exists. But this is not a requirement in envpool. However as mentioned in the issue thread, for truncated, when terminated=True, we don't care about the value of truncated, therefore we can practically treat the key not existing to be the same as the key existing and being set to False. The compatibility function is changed to reflect this. truncated is set to False when this occurs, even in list infos (old vector infos api) for consistency. This leads to slight loss of information, but again practically should not affect anything. And this is only through compatibility functions, when using new API exclusively, this problem does not occur, terminated=True, truncated=True can occur together as these are independent events.

Fixes #3021

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@pseudo-rnd-thoughts
Copy link
Contributor

LGTM

@jkterry1 jkterry1 merged commit 3da6b6e into openai:master Aug 15, 2022
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.

[Bug Report] gym normalize wrappers are incompatible with envpool
3 participants