← 输入框|github.com|刷新
Skip to content

Verify ill-conditioned full-rank Jacobians in the redundancy check - #1818

Open
alken1t15 wants to merge 1 commit into
solvespace:masterfrom
alken1t15:fix/1723-redundant-constraints
Open

alken1t15 wants to merge 1 commit into
solvespace:masterfrom
alken1t15:fix/1723-redundant-constraints

Conversation

@alken1t15

@alken1t15 alken1t15 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Adding a parallel constraint to r00c/r010 in #1723 is accepted as independent on the first solve (2 DoF), then reported as redundant on the next solve (3 DoF). Nearly dependent Jacobians can be reported as full row rank by SparseQR's fill-reducing ordering, and the result changes after a small Newton step.

Keep SparseQR as the normal rank check. When it reports full row rank but its smallest R pivot is below 1e-6 times the largest, verify the rank with Eigen's Jacobi SVD. Normalize rows and columns of a copy first, then use a relative singular-value cutoff of 1e-9. The Newton matrix and least-squares step are unchanged; already rank-deficient QR results keep their existing path.

The verification detects both reported pairs immediately and keeps 3 DoF across repeated solves, without increasing SparseQR's threshold for every sketch.

Regression coverage includes the reporter's model, both pairs, 10 repeated solves, four rotations at three scales with translation, and small independent-column checks. Both model regression tests fail on the original rank check. The full headless Debug suite passes with sanitizers and OpenMP: 303 cases, 1,461 checks. Local sanitizer validation also includes the separate cleanup fix from #1817 to avoid that known shutdown leak. No interactive GUI testing was performed.

The fallback is more expensive: a synthetic -O2 probe (three repetitions) increased from about 2.3 ms to 22 ms at 128x128, and from 14 ms to 297 ms at 256x256. Well-conditioned cases retain the QR path. The cutoffs and large-matrix cost need review; these tests do not establish correct classification of every near-singular configuration.

Fixes #1723.

@alken1t15

Copy link
Copy Markdown
Contributor Author

@ruevs Could you review this proposed fix for #1723 when you have time? Both reported pairs are now detected as redundant on the first solve in the local tests, including rotated/scaled copies. I'd particularly appreciate your feedback on the numerical cutoffs and the cost of the SVD fallback before this is merged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unstable redundant constraints

1 participant