Repository navigation
Fix stale OVPhysX and PhysX contact sensor data after reset - #8608
Merged
hujc7 merged 2 commits intoOct 17, 2026
Merged
Conversation
Reading ContactSensor data after scene.reset(env_ids) and before the next physics step, as the observation after ManagerBasedRLEnv._reset_idx does, refilled the reset envs from the pre-reset contact buffers on two paths that isaac-sim#5782 did not guard: - OVPhysX: update_net_forces_ovphysx_kernel received the timestamp but never checked it, and unpack_contact_buffer_data had none, so forces, force histories and contact points came from the previous episode. - PhysX: unpack_contact_buffer_data was not guarded, so contact points and, on Isaac Sim 6.1, the filtered friction forces and their history came from the previous episode. Skip envs whose timestamp is 0 in these kernels too, so they keep their reset values until the sensor's next update. The PhysX kernel stays in the captured CUDA graph: the timestamp is the sensor's device array.
NeoZng
requested review from
AntoineRichard,
huidongc,
kellyguo11,
marcodiiga,
ooctipus,
pbarejko and
rilei-nvidia
as code owners
October 15, 2026 16:23
Contributor
[Medium impact] The PR appears safe to merge. SummaryPrevents contact sensors from copying pre-reset physics data back into reset environments.
No actionable issues found. Simulation tests were not run during this review. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Reset selected environments"] --> B["Clear forces and histories; set contact points to NaN"]
B --> C["Read sensor data"]
C --> D{"Environment timestamp is zero?"}
D -- Yes --> E["Keep reset values"]
D -- No --> F["Copy current physics contact data"]
E --> G["Physics step and sensor update advance timestamp"]
G --> C
Reviews (1) · Last reviewed commit: "Fix stale OVPhysX and PhysX contact sens..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
Isaac Lab Review Bot
All reviewed code categories look good.
- PR description: The body accurately matches the changed kernels, affected buffers, backend differences, CUDA graph constraint, test scope, and reported baseline-versus-fix validation.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: Style consistency looks good.
- Test quality: Test quality looks good.
No blocking issues. No inline findings.
Automated review; human maintainers own approval decisions.
This was referenced Oct 16, 2026
AntoineRichard
approved these changes
Oct 16, 2026
AntoineRichard
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the fix @NeoZng!
Collaborator
|
run-ci |
Collaborator
|
run-ci |
hujc7
approved these changes
Oct 17, 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.
Description
Reading
ContactSensordata afterscene.reset(env_ids)and before the next physics step, as the observation rightafter
ManagerBasedRLEnv._reset_idxdoes, refilled the reset environments from the pre-reset contact buffers on thepaths #5782 did not guard:
update_net_forces_ovphysx_kernelreceived the timestamp but never checked it, andunpack_contact_buffer_datahad none, so forces, force histories and contact points came from the previous episode.unpack_contact_buffer_datawas not guarded, so contact points and, on Isaac Sim 6.1, the filteredfriction forces and their history came from the previous episode.
These kernels now also skip environments whose timestamp is 0, so the reset values (zero forces and histories, NaN
contact points) stay until the sensor's next update. The PhysX kernel stays in the captured CUDA graph: the timestamp is
the sensor's device array.
Fixes #8607
Type of change
Release backport
developScreenshots
Repro script from the issue, env 0 read right after
scene.reset(env_ids)(Isaac Sim 6.1, OVPhysX 0.6.4):Checklist
Docker and GPU tests run on demand. Push the commits you want tested, then
comment
run-cion the pull request.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists thereTests
The existing reset tests of both backends now cover the missed buffers (Isaac Sim 6.1, OVPhysX 0.6.4):
isaaclab_physx/test/sensors/test_contact_sensor.py::test_contact_sensor_no_stale_data_after_resetslides the cubeand also tracks contact points and filtered friction. It fails on
develop(stale contact point) and passes with thefix on cuda:0, where the read replays the captured graph, and on cpu.
isaaclab_ov/test/sensors/test_contact_sensor.py::test_friction_reportingreadsdataafter its partial reset, asan observation does. It fails on
developin all four cases and passes with the fix.isaaclab_ov/test/sensors/test_contact_sensor_kernels.pypasses the new timestamp argument.With the fix: PhysX
test_contact_sensor.py23 passed, 1 skipped (needs Isaac Sim 6.2); OVPhysXtest_contact_sensor.py36 passed;test_contact_sensor_kernels.py2 passed.