Repository navigation
Preserve recurrent critic state during bootstrap queries - #405
Merged
Denys88 merged 1 commit intoNov 19, 2026
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #405 +/- ##
=========================================
Coverage ? 58.42%
=========================================
Files ? 70
Lines ? 8868
Branches ? 0
=========================================
Hits ? 5181
Misses ? 3687
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Denys88
approved these changes
Nov 19, 2026
Denys88
left a comment
Owner
There was a problem hiding this comment.
Verified the asymmetry: the policy's get_values passes rnn_states without storing them, but CentralValueTrain.get_value stored them on the bootstrap query, so a recurrent central value consumed the horizon endpoint twice. Opt-out flag on the bootstrap call is the minimal fix.
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.
Problem
At the end of each PPO rollout,
A2CBase.get_values()evaluates the next observation to bootstrap GAE. With a recurrent central value network,CentralValueTrain.get_value()also stores the returned hidden state. The next rollout then evaluates the same observation again from that advanced state.As a result, the critic consumes the horizon endpoint twice. Its subsequent values and GAE targets differ from a continuous observation stream even when there is no training or change to the model weights between rollouts. This also affects an episode ending at the horizon: the rollout has already cleared the terminated environment's critic state, but the bootstrap query fills it again before the next episode's first real query.
Changes
get_values()bootstrap queries. The value is still evaluated with the current state; the rollout's existing done handling remains responsible for clearing terminated environments.This is separate from #391's multi-agent done reordering and single-sequence reset fixes. It concerns the extra state advance caused by an endpoint value query.
Validation
git diff --checkpassed.The related suite includes
test_central_value_bootstrap,test_ppo_masking,test_release_correctness,test_perf_fixes,test_critical_fixes,test_mixed_precision,test_value_normalization_targets,test_ppo_dataset_sequences, andtest_multidiscrete.