Repository navigation
Roll the Newton contact sensor's force-matrix history one thread per filter object - #9297
Conversation
…filter object The update kernel ran one thread per sensor looping over the filter objects, so its history copies strided through memory. For the G1's self-contact sensor (30 x 30 bodies, history 4) at 4096 envs it took 2.2 ms per physics substep; with a thread per filter object it takes 0.5 ms.
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Compatibility and deprecation (1). Other reviewed categories look good.
- PR description: Title and scope match; supplied G1/RTX timings need reproducible baseline/candidate revisions, commands, backend/environment versions, warmup, timing methods, and kernel/substep/step metrics; retain supplied hardware/environment counts and template sections, and remove the repeated launch snippet.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: Breaking changes: update_contact_sensor_kernel now requires three-dimensional launches, breaking its documented two-dimensional contract without a functional bridge, targeted warning, migration and removal guidance, or transition coverage.
- Implementation: Implementation looks good.
- Style consistency: Style consistency looks good.
- Test quality: Test quality looks good.
Minor fixes needed. Posted 1 inline finding.
Automated review; human maintainers own approval decisions.
| force-matrix histories of its filter object, and the first one of each sensor rolls the rest. | ||
| """ | ||
| env, sensor = wp.tid() | ||
| env, sensor, f = wp.tid() |
There was a problem hiding this comment.
🟡 Warning · Compatibility — Preserve documented two-dimensional launches
Unpacking three thread indices breaks callers using the kernel's previously documented two-dimensional launch. Keep that launch functional through deprecation and use a separate three-dimensional kernel, with migration guidance and transition coverage.
[Medium impact] The change affects Newton contact-sensor updates whenever those sensors run. The PR appears safe to merge, with a non-blocking request to test history rolling and timers with multiple filters. Findings
SummaryMoves contact-history updates to one thread per sensor and filter object.
Reviews (1) · Last reviewed commit: "Roll the Newton contact sensor's force-m..." · Reviewed by Greptile |
| wp.launch( | ||
| update_contact_sensor_kernel, | ||
| dim=(2, 1), | ||
| dim=(2, 1, 1), |
There was a problem hiding this comment.
Multiple filters remain untested
The updated history test still launches only f == 0, so it never checks history rolling across filter objects—the behavior this PR changes. The other two-filter test uses history_length=0, so it cannot check older samples. A regression that leaves later filters' histories stale or advances timers once per filter could pass.
Extend this test to use at least two filters with different values and enable air-time tracking. Check that each filter keeps its own history, masked environments stay unchanged, and timers advance once per update.
|
run-ci |
…ct history fix (#9362) ## Description Backport #9297, #9112, and #9323 to `release/3.1.0`. These merged to `main` after the release branch was cut. The first MDP2 parts (#9016, #9120) are already on the release branch. - #9297: Newton contact sensor rolls its force-matrix history with one thread per filter object. - #9112: MDP2 resets: reset MDP2 episodes to stored reset states, which can be generated, recorded during training, pinned, and saved, all inside the captured step. Its prerequisite, the reset-state API from #8872, is already on the release branch. - #9323: MDP2 tracked tasks (`TaskCfg.tracked`) and per-occurrence events (`MDP2RLEnv.episode_events()`, opt-in with `record_episode_events`), for Arena's tracked events. Cherry-picked with `-x`, in merge order, from `121fc8113`, `880939cae`, and `5fa33d124`. All three applied without conflicts or manual edits, and their stable patch IDs match the original commits. The original changelog fragments are included. ## Type of change - Release backport: features, a bug fix, tests, and documentation ## Validation - Pre-commit hooks pass on all changed files, with `ISAACLAB_CHANGELOG_BASE_REF=upstream/release/3.1.0`. - The changelog check against `upstream/release/3.1.0` passes, and so does `git diff --check`. - Every touched test file passes locally on this branch: - `isaaclab_experimental`: `test_mdp2.py` 63 passed, `test_mdp2_env.py` 31 passed, `test_mdp2_reset_states.py` 19 passed - `isaaclab_tasks_experimental`: `test_lift_kuka_allegro.py` 6 passed - `isaaclab`: `test_reset_state_sampler.py` 11, `test_reset_states.py` 8, `test_dict.py` 12, `test_yaml_io.py` 5 passed - `isaaclab_newton`: `test_contact_sensor_history.py` 2 passed - Hardware: RTX PRO 6000 Blackwell, Linux. Full CI has not run yet. ## Checklist - [x] Read the contribution guidelines - [x] Run formatting and lint checks - [x] Keep the original documentation, tests, and changelog fragments - [x] Verify the cherry-picks match the original patches --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ates Move the PR description evidence rules into the contribution guide and route the PR workflow skill to them. The SPRI skill now scales with the change, keeps the number or name that is the point, keeps per-section openings for long documents only, treats inferences as invented facts, and uses merged PR descriptions (isaac-sim#9283, isaac-sim#9297, isaac-sim#9167) as examples. The issue skill stops when issues are disabled or a duplicate exists, and checks permalinks instead of every link.
Description
update_contact_sensor_kernelran one thread per (env, sensor) and looped over the filter objects, so the force-matrix history copies strided through memory. It now launches one thread per (env, sensor, filter object); thef == 0thread of each sensor rolls the per-sensor buffers and air/contact times as before.Sensors without filter objects launch one thread per sensor, as before.
Performance
G1 self-contact sensor (30 bodies × 30 filter bodies,
history_length=4), 4096 envs, RTX PRO 6000:The sensor updates every substep (4 per env step), so the task's env step drops by about 7 ms.
Tests
test_contact_sensor_history.py: launch dim updated to(2, 1, 1); newest-first ordering and env mask still checked.test_contact_sensor.py: 28 passed, 3 skipped.test_resting_object_contact_force[kamino*]fails locally onmainwithout this change too.Type of change
Checklist
pre-commitchecks on the changed files