Skip to content

Keep constant extrapolation gradients finite - #9243

Open
sylvesterkaczmarek wants to merge 2 commits into
isaac-sim:mainfrom
sylvesterkaczmarek:fix/linear-interpolation-boundary-gradients
Open

sylvesterkaczmarek wants to merge 2 commits into
isaac-sim:mainfrom
sylvesterkaczmarek:fix/linear-interpolation-boundary-gradients

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Description

Mask coincident-bound intervals before dividing to prevent NaN gradients during constant extrapolation. Preserve existing forward values and slopes within sampled intervals.

Fixes #9242.

Type of change

  • Bug fix

Validation

  • Two focused tests failed on main and passed after the fix, covering extrapolation and single-sample curves.
  • Changelog and diff checks passed.
  • GPU, simulator integration and full formatting checks were not run.

Checklist

  • Added regression coverage and a changelog fragment.
  • Added contributor name.
  • Full formatting and integration checks.

Fixes isaac-sim#9242.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team November 26, 2026 00:14
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Nov 26, 2026

@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

Needs attention: Style consistency (1), Test quality (1). Other reviewed categories look good.

  • PR description: The title and body match the four-file gradient fix, distinct regression cases, changelog, and contributor entry; reported validation and omitted checks are explicit, with no measurable performance claim requiring evidence.
  • 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: The test-module docstring only repeats the filename and regression purpose; delete it to remove redundant prose.
  • Test quality: The two regressions protect distinct multi-sample and single-sample behavior, but missing kitless marker text excludes the file from kitless CI selection; add pytest.mark.kitless alongside pytest.mark.unit.

Minor fixes needed. Posted 2 inline findings.

Automated review; human maintainers own approval decisions.

#
# SPDX-License-Identifier: BSD-3-Clause

"""Regression coverage for piecewise linear interpolation."""

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.

🟡 Warning · Style Consistency — Remove the redundant module docstring

The docstring restates the filename and test purpose without documenting a contract or constraint. Delete it.


from isaaclab.utils.interpolation import LinearInterpolation

pytestmark = pytest.mark.unit

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.

🟡 Warning · Test Quality — Mark the tests kitless

Both tests run without Isaac Sim, but kitless CI selects files by marker text and will miss this file. Add pytest.mark.kitless alongside pytest.mark.unit.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Updates LinearInterpolation.compute to mask coincident bounds before division.

  • Linear interpolation keeps query gradients finite for boundary and one-point queries.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "Keep constant extrapolation gradients fi..." · Reviewed by Greptile

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Removed the redundant module docstring and added the kitless marker alongside unit in feaf934, so both interpolation regressions are selected by simulator-free CI. Python syntax and diff checks passed; runtime tests were not rerun locally.

This branch has not been deployed

No deployments
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.

[Bug Report] LinearInterpolation produces NaN gradients during constant extrapolation

1 participant