Repository navigation
fix: cast floating inputs during policy device transfer - #2608
Merged
TATP-233 merged 1 commit intoNov 15, 2026
Merged
Conversation
coelhoaf
marked this pull request as ready for review
November 13, 2026 20:56
TATP-233
approved these changes
Nov 15, 2026
Merged
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.
Summary
When a CPU environment supplies float64 observations or rewards to an Apple MPS policy, the RSL-RL adapter transfers them before converting to float32 and raises
TypeError. Select float32 during the transfer so these inputs succeed, while preserving integer and boolean dtypes.The regression uses a small CPU test environment through the public adapter on actual MPS. It covers reset, actor/critic observations, rewards, timeout flags and a large int64 value that would be rounded by an unintended float32 conversion. A stock G1 float64-input failure is not claimed.
Linked Work
main(4065a61fef941c356a047ed8ac7a1bd32200f933)Validation
make test-allpassed on the final local headb4e60e187c9623cf886b85868f75ae04c287f526: 2,868 passed, 141 skipped, 378 deselected; Ruff, mypy and Pyright passed, with one existing Pyright warning. Import checks passed for 35 modules and 36 scripts.Commands actually run for the local gate:
The isolated environment uses Python 3.13.18, Torch 2.14.0 and MuJoCo 3.11.0 on macOS 27.0.1 arm64. A worktree-local stable Node bootstrap resolved an initial Pyright/nodeenv prerelease parsing failure; repository dependency pins are unchanged.
Both stock G1 comparison runs hit the same preexisting
env.close()failure after completing learning: a deferred command-metric tensor created in inference mode is cleared outside that mode. The uninstrumented official CLI reproduces it too. The comparison establishes bounded numerical parity, not a clean training-command exit or convergence equivalence. This separate cleanup issue is outside this PR.Remote CI route: base
main; CI and Docs are awaiting upstream maintainer approval for this fork contribution. Applicable current-head checks remain required before merge.Impact
Checklist