Repository navigation
Conversation
The Newton undistortion loop selects a zero step when its Jacobian determinant is too small, but computes a division by the original determinant in the unused branch of `torch.where`. Forward output is finite while coordinate and calibration gradients become NaN at a singular Jacobian.
This branch has not been deployed
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.
Problem
Radial/tangential undistortion skips a Newton update when the local Jacobian is singular. An unused singular solve can still contaminate backward gradients with nonfinite values.
Change
Guard the inactive singular Newton path so the skipped point retains its original value and has finite identity/zero derivatives, without changing the regular Newton update for other points in a batch.
Regression coverage
New CPU regressions cover one and three iterations, float32/float64, gradients with respect to points and distortion parameters, and mixed singular/regular batches checked against an explicit regular Newton solve. Historical focused baseline/fix validation was prepared on this branch but was not rerun today.
The repository's required Core/Docker gates have not been verified as passing for this pending PR. CUDA and the full rendering pipeline are untested.