Skip to content

Add unit tests for ppo_continuous_action GAE computation - #560

Open
YangNuoCheng wants to merge 2 commits into
vwxyzjn:masterfrom
YangNuoCheng:add-ppo-continuous-gae-test
Open

Add unit tests for ppo_continuous_action GAE computation#560
YangNuoCheng wants to merge 2 commits into
vwxyzjn:masterfrom
YangNuoCheng:add-ppo-continuous-gae-test

Conversation

@YangNuoCheng

Copy link
Copy Markdown

Description

Towards #252, and a follow-up to the GAE unit tests for ppo.py. Adds logic unit tests for the GAE computation in cleanrl/ppo_continuous_action.py.

  • test_ppo_continuous_action_gae_matches_explicit_sum — cross-checks the reverse in-place recurrence in ppo_continuous_action.py against an independent explicit discounted-sum reference A_t = Σ_{k≥t} (γλ·nnt)^… · δ_k, on randomized rollouts (with terminations). Same precedent as tests/test_jax_compute_gae.py.
  • test_ppo_continuous_action_gae_terminal_masking — a hand-computed example that specifically exercises the episode-termination masking path: a done must zero out nextnonterminal and stop advantage propagation across the boundary. Expected advantages [1.25, 1.0, 1.0] are reviewer-verifiable by hand.

This targets the issue's goal of verifying logic correctness rather than black-box outputs, and the terminal-masking case adds coverage for the boundary behavior that is easy to break silently.

Types of changes

  • Bug fix
  • New feature
  • New tests
  • Documentation

Checklist

  • New tests pass locally: pytest tests/test_ppo_continuous_action_gae.py (2 passed)
  • No changes to existing files; only a new test module is added
  • Lint-clean (black --line-length=127, isort --profile=black)

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

@YangNuoCheng is attempting to deploy a commit to the Costa Huang's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant