Expose exact MyoChallenge P2 model preprocessing for accelerated backends - #405
Draft
mindorigin150 wants to merge 2 commits into
Draft
Expose exact MyoChallenge P2 model preprocessing for accelerated backends#405mindorigin150 wants to merge 2 commits into
mindorigin150 wants to merge 2 commits into
Conversation
|
|
1 similar comment
|
|
Collaborator
|
@mindorigin150 this is a fantastic addition. Can you ping me on slack . Would like to discuss integration on the newest version of myosuite |
mindorigin150
force-pushed
the
feature/mjx-table-tennis-p2
branch
from
August 24, 2026 08:35
b595796 to
ed2694b
Compare
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
MjSpectransformation into the publicpreprocess_table_tennis_specfunctionTableTennisEnvV0and external accelerated backends on the same official model transformationMotivation
Accelerated backends currently have to duplicate the private
TableTennisEnvV0._preprocess_specimplementation to compile the official P2 model. Exposing the existing transformation lets them consume the same cylindrical paddle geometry and collision model without maintaining a downstream copy.P2 randomizes model arrays before each episode. Seeding only in the base reset happens after those samples are drawn, so repeated
reset(seed=...)calls are not reproducible. Mutatingbody_massalso requiresmj_setConstso derived quantities such as subtree mass match the sampled model.This PR deliberately does not add an accelerated environment, change the official geometry or tolerances, or change MyoSuite's MuJoCo dependency range. Backend-specific simulation and training code remain downstream.
Verification
Tested with both MuJoCo 3.6.0 and 3.12.0:
The tests cover the official P2 model contract and deterministic reset-time domain randomization, including recomputed derived mass.