Skip to content

[Tests] add recurrent integration coverage - #3793

Merged
vmoens merged 3 commits into
pytorch:mainfrom
theap06:feat/lstm-lifecycle-integration-test
May 30, 2026
Merged

[Tests] add recurrent integration coverage#3793
vmoens merged 3 commits into
pytorch:mainfrom
theap06:feat/lstm-lifecycle-integration-test

Conversation

@theap06

@theap06 theap06 commented May 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3746

Summary

Adds a focused integration test for recurrent state handling across trajectory boundaries. The test exercises an LSTM policy with SyncDataCollector on a deterministic environment that terminates mid-batch, verifies is_init propagation, and confirms that recurrent hidden state does not leak across trajectories after the replay-buffer / recurrent-loss-side path.

Complements #3792 (the docs and rnn.py docstring portion of the recurrent-state lifecycle work) with the missing integration-level coverage. Unit-level recurrent paths are already covered in test/modules/test_rnn.py; value-function-side recurrent coverage lives in test/objectives/test_values.py::TestValues::test_gae_recurrent. Neither exercises the full policy → collector → buffer integration this PR fills.

Notes

  • SyncDataCollector is deprecated as of v0.13 in favor of Collector. This PR uses SyncDataCollector to match the wording of the original issue; a trivial follow-up swaps the import when the deprecation lands.

@pytorch-bot

pytorch-bot Bot commented May 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/3793

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ PR Title Label Error

PR title must start with a label prefix in brackets (e.g., [BugFix]).

Current title: add recurrent integration coverage

Supported Prefixes (case-sensitive)

Your PR title must start with exactly one of these prefixes:

Prefix Label Applied Example
[BugFix] BugFix [BugFix] Fix memory leak in collector
[Feature] Feature [Feature] Add new optimizer
[Doc] or [Docs] Documentation [Doc] Update installation guide
[Refactor] Refactoring [Refactor] Clean up module imports
[CI] CI [CI] Fix workflow permissions
[Test] or [Tests] Tests [Tests] Add unit tests for buffer
[Environment] or [Environments] Environments [Environments] Add Gymnasium support
[Data] Data [Data] Fix replay buffer sampling
[Performance] or [Perf] Performance [Performance] Optimize tensor ops
[BC-Breaking] bc breaking [BC-Breaking] Remove deprecated API
[Deprecation] Deprecation [Deprecation] Mark old function
[Quality] Quality [Quality] Fix typos and add codespell

Note: Common variations like singular/plural are supported (e.g., [Doc] or [Docs]).

@theap06 theap06 changed the title add recurrent integration coverage [Tests] add recurrent integration coverage May 24, 2026
@github-actions github-actions Bot added the Tests Incomplete or broken unit tests label May 24, 2026
@theap06

theap06 commented May 29, 2026

Copy link
Copy Markdown
Collaborator Author

@vmoens feel free to leave some feedback when ur free. also lmk if there is anything I can do to help with general maintainance of the library

@vmoens vmoens left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM
Moved to an existing file

@vmoens
vmoens merged commit e50553d into pytorch:main May 30, 2026
56 of 81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Modules Tests Incomplete or broken unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc] Improve navigability for new contributors

2 participants