Keep DelayBuffer state unchanged after invalid lag updates - #7274
Keep DelayBuffer state unchanged after invalid lag updates#7274sylvesterkaczmarek wants to merge 3 commits into
Conversation
Greptile SummaryThe PR makes
Confidence Score: 5/5The 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
Reviews (1): Last reviewed commit: "Add DelayBuffer validation changelog" | Re-trigger Greptile |
There was a problem hiding this comment.
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_lagsand 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, andmax_time_lagunchanged, whilecopy_()preserves references obtained through the publictime_lagsproperty. - 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.
There was a problem hiding this comment.
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.
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_lagsfirst and validates the resulting minimum and maximum afterwards. If the request is negative or larger thanhistory_length, it raisesValueErrorbut the invalid values remain in the live buffer state and can affect latercompute()calls.This change builds and validates the requested lag state on a clone first, then commits it with
copy_()only after validation succeeds. Keepingcopy_()also preserves the identity of the publictime_lagstensor.Type of change
Validation
history_length.time_lags,min_time_lag, andmax_time_lag.isaaclabchangelog fragment.Checklist