feat: consume unisim 1.7.5 physics-state playback contract in interactive rendering - #1637
Merged
Merged
Conversation
…tive rendering Downstream adaptation for unilabsim/unisim#291: - play_interactive/play_viser precheck supports_physics_state_playback at startup and name the available rendering paths in the error instead of failing on the first snapshot fetch inside the viewer loop - new unilab.visualization.playback_state owns the contract touchpoints: PhysicsStateApplier splits snapshots through the physics-state layout contract (no more hardcoded mjSTATE_FULLPHYSICS / 1+nq+nv) and replays mocap geometry through the contract get_playback_mocap_state entrypoint - EnvPlayCapabilities gains supports_mocap_playback; NpEnv exposes get_physics_state_layout/get_playback_mocap_state passthroughs - bump unisim-core to >=1.7.5 (playback contract release) and mjbatch-uni to ~=0.2.4 (streaming VariantPack builder required by unisim 1.7.5) Affects the MuJoCo playback-shell rendering path only; physics ownership is unchanged.
This was referenced Sep 24, 2026
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
play_interactive/play_visernow prechecksupports_physics_state_playbackat startup and fail with an actionable message (naming the backend and its available rendering paths) instead of surfacingNotImplementedErrorfrom the first snapshot fetch inside the viewer loop.unilab.visualization.playback_state:PhysicsStateAppliersplits snapshots through the contractphysics_state_layout().split_state()— the hardcodedmjSTATE_FULLPHYSICS/1+nq+nvslicing is gone from both entrypoints — and replays mocap geometry through the contractget_playback_mocap_stateentrypoint (aligned with the playback model; falls back to the snapshot tail only when the backend declares no mocap capability but the layout carries the columns).EnvPlayCapabilitiesgainssupports_mocap_playback;NpEnvexposesget_physics_state_layout()/get_playback_mocap_state()passthroughs with fail-closed gating.unisim-core>=1.7.4→>=1.7.5(playback contract release) andmjbatch-uni~=0.2.3→~=0.2.4(streamingVariantPack.builder, required by unisim-core 1.7.5's fixed-variant check — without ittests/base/test_entity_scene_consumer.pyfails closed).User-facing impact: backends without the playback contract (genesis/isaacgym) now get a clear startup error pointing at alternatives; mocap-body tasks render correctly in interactive viewers instead of crashing on
mj_setStatesize mismatch. No training-path behavior change.Linked Work
mainValidation
make test-allpassed on the final local head before this PR was created or updatedCommands actually run:
Focused suites on the final head (unisim-core 1.7.5 + mjbatch-uni 0.2.4):
Remote CI route:
main: current-head (fb0347e0) CI all green — https://github.com/Motphys/UniLab/actions/runs/35863164309 (ruff-format 3m15s, ruff-lint 1m58s, mypy 40s, pyright 1m25s, test (ubuntu-slim) 5m29s, benchmark-smoke 3m44s) and https://github.com/Motphys/UniLab/actions/runs/35863164396 (Build Sphinx 38s).Impact
mujoco(MuJoCo playback-shell rendering path consumed byplay_interactive/play_viser; mjwarp/newton/drake/superdex snapshots flow through the same contract entrypoints)Artifacts
Checklist
tests/visualization/test_playback_state.py,tests/base/test_np_env_playback_contract.py)test_playback_session.py→test_mjwarp_playback.pytest-isolation bug and the stale-benchmark-output docs-check sensitivity are pre-existing issues observed during validation and left untouched.