perf: optimize issue 673 reset_done paths#674
Merged
Conversation
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
Fixes #673.
get_body_pose_w_rows(env_ids, body_ids)in G1 motion-tracking reset observation so reset only reads the sparse rows being reset instead of materializing full-batch body pose.SceneDatareset slice when refreshing link-pose cache, avoiding a secondself._data[mask]in the reset path.Performance Notes
The detailed report was posted to #673: #673 (comment)
Same-process A/B attribution before removing the temporary harness showed:
Overall collector throughput is intentionally not claimed as a PR result because
backend_physics_msdrifted between baseline and optimized runs. The supported claim is limited to the local reset paths above.Validation
uv run ruff check src/unilab/base/backend/motrix/backend.py src/unilab/envs/motion_tracking/g1/tracking.py tests/envs/test_env_configs.py tests/dr/test_manager.py benchmark/benchmark_offpolicy_collector_active.pyuv run pytest tests/envs/test_env_configs.py::test_g1_motion_tracking_reset_observation_uses_sparse_body_pose_rows tests/base/test_motrix_backend_options.py tests/dr/test_manager.py tests/benchmark/test_offpolicy_collector_active_benchmark.py -qgit diff --checkmake test-all