Reject a malformed BASELINE_SYNC instead of ignoring it - #533
Open
josephdviviano wants to merge 1 commit into
Open
Reject a malformed BASELINE_SYNC instead of ignoring it#533josephdviviano wants to merge 1 commit into
josephdviviano wants to merge 1 commit into
Conversation
_apply_baseline_sync read the payload with .get and skipped the assignment when it came back None. A sync with a missing, null or non-finite value left the manager on its shard-local threshold with no signal, so it filtered against a different cutoff from its siblings — the state the message exists to remove. The test that pinned the old behaviour is replaced by one that covers a missing key, a null value, a non-finite value and a non-dict payload.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #533 +/- ##
==========================================
+ Coverage 75.62% 75.64% +0.01%
==========================================
Files 62 62
Lines 11329 11335 +6
Branches 1670 1672 +2
==========================================
+ Hits 8568 8574 +6
Misses 2234 2234
Partials 527 527
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_apply_baseline_syncread the payload with.getand skipped the assignment when it returnedNone:A
BASELINE_SYNCwith a missing key, a null value, or a non-finite value left the manager on its shard-local threshold and returned normally. The adopted value gates what every assigned worker sends, so that manager filters against a different cutoff from its siblings — the state the message exists to remove — and nothing in the run says so.It now raises
ValueErroron a non-dict payload, on a missing or nullglobal_baseline_log_reward, and on a non-finite one. A non-finite baseline keeps every trajectory or none.testing/test_replay_buffer.py::test_manager_baseline_sync_ignores_missing_payloadasserted the old behaviour, so it is replaced rather than added to. The new test is parametrized over all four malformed payloads and checks_global_baselineis untouched.testing/test_replay_buffer.pyandtesting/test_dependency_free.py: 100 passed, 1 skipped. Each new case verified to fail against the previous implementation. black, isort and flake8 clean.