Skip to content

Keep DelayBuffer state unchanged after invalid lag updates - #7274

Open
sylvesterkaczmarek wants to merge 3 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/delay-buffer-invalid-lag-state
Open

Keep DelayBuffer state unchanged after invalid lag updates#7274
sylvesterkaczmarek wants to merge 3 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/delay-buffer-invalid-lag-state

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Description

Fixes DelayBuffer.set_time_lag() leaving an invalid lag configuration active after raising a validation error.

The method currently writes the requested lag values into _time_lags first and validates the resulting minimum and maximum afterwards. If the request is negative or larger than history_length, it raises ValueError but the invalid values remain in the live buffer state and can affect later compute() calls.

This change builds and validates the requested lag state on a clone first, then commits it with copy_() only after validation succeeds. Keeping copy_() also preserves the identity of the public time_lags tensor.

Type of change

  • Bug fix

Validation

  • Added regression coverage for both a negative lag and a lag above history_length.
  • The test verifies rejected updates preserve time_lags, min_time_lag, and max_time_lag.
  • It also verifies subsequent delayed output is unchanged by the rejected update.
  • Added the required isaaclab changelog fragment.

Checklist

  • I have read and understood the contribution guidelines
  • I have added a regression test
  • I have added the required changelog fragment
  • No new dependencies

@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team August 21, 2026 15:17
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 21, 2026
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes DelayBuffer.set_time_lag() transactional so rejected lag updates preserve the active configuration and subsequent delayed output.

  • Builds and validates proposed lag values on a cloned tensor before committing them.
  • Preserves the identity of the publicly exposed lag tensor through in-place copy_().
  • Adds regression coverage for negative and above-history lag values and documents the fix in a changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The proposed lag state is fully validated before any live fields are changed, while successful updates retain existing tensor identity and assignment behavior.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/utils/buffers/delay_buffer.py Validates a cloned lag configuration before atomically committing it, preventing failed updates from corrupting live buffer state.
source/isaaclab/test/utils/test_delay_buffer_invalid_lag_state.py Verifies rejected lower- and upper-bound updates preserve lag metadata and subsequent delayed output.
source/isaaclab/changelog.d/sylvesterkaczmarek-fix-delay-buffer-invalid-lag-state.rst Accurately records the externally observable state-preservation fix.

Reviews (1): Last reviewed commit: "Add DelayBuffer validation changelog" | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Reviewed the transactional update to DelayBuffer.set_time_lag, its regression coverage, and the Isaac Lab changelog fragment. The changed failure path now preserves active lag state after validation errors.

  • Design and architecture: Validating a cloned candidate tensor before committing with copy_() keeps _time_lags and its cached minimum and maximum consistent while preserving tensor identity. The additional clone is a localized tradeoff on each lag update.
  • API: Valid updates retain existing type, device, indexing, and validation behavior. Rejected updates now leave time_lags, min_time_lag, and max_time_lag unchanged, while copy_() preserves references obtained through the public time_lags property.
  • Implementation: The integer and tensor update paths both stage changes before calculating bounds, and neither active lags nor cached bounds are committed until validation succeeds. The regression test covers negative and excessive lags and verifies subsequent delayed output; it is placed in a new test file rather than extending the closest existing delay-buffer test suite, but this does not undermine the fix itself.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review disclosure: This review was produced with assistance from multiple AI systems.

Thank you for putting this PR together.

Assessment: Candidate lags are validated before commit, and copy_ preserves the public tensor identity.

Findings: No unit-test CI result is attached.

Requested changes: Run the two focused DelayBuffer test modules, then merge.

Test scope: Coverage is sufficient; run only the focused DelayBuffer tests.

Documentation / AI skills: No additional documentation update is required: changelog fragment is sufficient. No AI-skill update is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants