Repository navigation
feat(play): add advance_physics hook and external-checkpoint playback support - #2592
Merged
Merged
Conversation
… support - TorchEnv.advance_physics: public override hook for owners to drive one control interval with an already validated control (default delegates to _step_physics), enabling high/low-rate control interleaving while the outer step lifecycle keeps rewards, counters, and resets. - sim2sim: playback-visualization-only action fields (log_goal, show_rays) are exempt from the env.actions contract comparison; contract and tests are updated together. - play_interactive: interactive.sim2sim=false skips the sim2sim preflight for external checkpoints without a run_config.json snapshot; a task-owned play_key_hook consumes teleop keys before global bindings. - visualization: add the line debug primitive kind for ray overlays. Commands: make check; uv run pytest tests/training/test_sim2sim_resolver.py tests/base/test_torch_env.py tests/visualization/test_interactive_playback.py -q (144 passed) Co-authored-by: Cursor <cursoragent@cursor.com>
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
TorchEnv.advance_physics(ctrl): new public override hook so task owners can drive one control interval with an already validated control (e.g. interleaving a converted low-rate ONNX low-level policy inside a longer control interval). Owners advance exactlysim_substepsvia public backend APIs and may refresh the control between chunks; rewards, episode counters, and resets stay in the outer step lifecycle. The default delegates to_step_physics, so the substep feedback machinery merged earlier keeps working unchanged.log_goal,show_rays) are now exempt from theenv.actionscontract comparison. Toggling them for interactive play is not a policy-defining change. The contract andtests/training/test_sim2sim_resolver.pyare updated together.play_interactive:interactive.sim2sim=falseskips the sim2sim preflight for external checkpoints (converted from other training stacks) that have no UniLabrun_config.jsonsnapshot; a task-ownedplay_key_hookconsumes teleop keys (arrows/Enter) before global bindings.linedebug primitive kind (plain straight segment viamjv_connector) for ray overlays; the offline renderer has no line channel, so this is UniLab-side only.conf/ppo/config.yaml: adds theinteractive.sim2sim: truedefault.Motivation: these are the UniLab-core pieces needed to host the perceptive navigation playback flow (task owners land in a downstream repository); no task code or assets are included here.
Linked Work
mainValidation
make test-all— 40 pre-existing environment failures verified identical on a cleanorigin/maincheckout (see below)Commands actually run:
make test-allfails with 40 MuJoCo-runtime / asset-loading / CUDA-IPC errors (OSError: [Errno 9] Bad file descriptor, assetError opening file, CUDA IPC teardown). The same representative test fails identically on a cleanorigin/mainhead, so these failures are environmental (asset hub / sandbox restrictions), not introduced by this change. Remote CI onmainis the authoritative gate.Remote CI route:
main: will run on this PR's head.Impact
advance_physicsdefault is behavior-preserving)Artifacts
Checklist
test_sim2sim_resolver.pycovers the visualization-field exemption)play_key_hook)Made with Cursor