Repository navigation
feat(reset): support ResetSelection in built-in model-field DR terms (#2623) - #2630
Merged
Merged
Conversation
…2623) Fixed-shape autoreset (env.autoreset_cuda_graph) negotiates ResetSelection support with every reset-mode event term; the built-in model-field DR terms (geom friction, joint armature, PD gains, rigid-body CoM, encoder bias) previously had no declaration and blocked tasks such as G1 motion tracking. Masked path: sample at full width from device-staged immutable tables (sampling ranges, field defaults, gain defaults, CoM ranges, joint columns), merge through the packed reset transaction via the new entity tensor-mask gateways, and publish value validity through the env's deferred verdict channel (env.require) instead of the eager host check. Sampling tables are staged once on the cold path so captured resets stay sync-free. ResetStateTransaction now caches the per-field full-width device default table used by write_randomization_tensor_mask, clearing the cache when the packed reset device is redeclared. Remaining reset DR terms (randomize_rigid_body_mass, randomize_body_mass_inertia, randomize_physics_scene_gravity) are follow-ups.
This was referenced Nov 19, 2026
Open
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
GeomFriction,DofArmature,PdGains,RandomizeRigidBodyCom,RandomizeEncoderBias) now declaresupports_reset_selectionand accept aResetSelectionmask, so tasks carrying them can run the default-on fixed-shape autoreset path (autoreset_cuda_graph=true) instead of failing startup asreset_selection_blockers.Entitymirror the existingwrite_actuator_gains_tensor_mask:write_geom_friction_tensor_mask,write_joint_armature_tensor_mask,write_body_ipos_tensor_mask(local-id normalization → backend ids →write_randomization_tensor_mask). No private-interface workarounds needed anymore.ResetStateTransaction._materialize_tensor_randomization_defaultnow caches the immutable per-field full-width default table on the packed reset device: previously everywrite_randomization_tensor_maskcall re-rantorch.as_tensor(np.array(...), device=...)(pageable H2D + sync); KP/KD also paid this per call despite their host-side cache. Cache is cleared when the packed reset device is (re)declared._ModelFieldRandomizerand friends routes through the env's existingrequire/deferred-verdict channel instead of a host read, and_sample_axisstaging plusRandomizeEncoderBiascolumn indexing moved from per-call H2D to cold-path device staging.8-sync_free_autoreset.mdgains a "Reset-mode DR replay cannot be disabled" behavior note (backends that restore model-field defaults on reset — e.g. MJWarp — diverge obs from physics in step 1 if replay is dropped).RandomizeRigidBodyMass,RandomizeBodyMassInertia,RandomizePhysicsSceneGravityremain row-index-only reset terms.Linked Work
mainValidation
make test-allpassed on the final local head before this PR was created or updatedCommands actually run (final head
5446d703):Impact
Artifacts
Checklist