Skip to content

Avoid bad RLlib logs on init#322

Merged
Mark2000 merged 1 commit intodevelopfrom
bugfix/rllib-logging
Nov 19, 2025
Merged

Avoid bad RLlib logs on init#322
Mark2000 merged 1 commit intodevelopfrom
bugfix/rllib-logging

Conversation

@Mark2000
Copy link
Copy Markdown
Contributor

@Mark2000 Mark2000 commented Nov 4, 2025

Description

RLlib logging wrapper logs some weird data immediately after starting RLlib. This code avoids those logs. I don't love this code, but it's better than nothing.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this pull request be reviewed?

  • By commit
  • All changes at once

How Has This Been Tested?

RLlib code not covered by tests.

Future Work

None.

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation and release notes
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copilot AI review requested due to automatic review settings November 4, 2025 17:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a mechanism to skip initial logging during environment resets to prevent unwanted log entries on the first reset. The implementation uses a counter that decrements on each reset until reaching zero, after which normal logging resumes.

  • Introduces a logs_to_skip counter initialized to 3 to suppress logging on initial resets
  • Modifies the reset() method to conditionally call log_data_on_reset() based on the counter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mark2000 Mark2000 force-pushed the bugfix/rllib-logging branch from 66c5f96 to 759935c Compare November 4, 2025 17:42
@Yume27 Yume27 self-requested a review November 19, 2025 18:47
Copy link
Copy Markdown
Contributor

@Yume27 Yume27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any reason why you chose 3 for that?

@Mark2000
Copy link
Copy Markdown
Contributor Author

Trial and error. Tried to find a more robust way of telling reset() calls during algorithm initialization from calls during training, but there wasn't an obvious way of distinguishing them and–at least for PPO–3 is the magic number.

@Mark2000 Mark2000 merged commit db81c21 into develop Nov 19, 2025
12 of 14 checks passed
@Mark2000 Mark2000 deleted the bugfix/rllib-logging branch November 19, 2025 19:34
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.

3 participants