Apply shifted line-search costs to island solver#1403
Merged
adenzler-nvidia merged 1 commit intoJun 3, 2026
Merged
Conversation
The island line search was the last solver path still comparing absolute constraint costs. When absolute costs are large, the accepted improvement can fall below float32 resolution, so previous_cost - current_cost rounds to zero and the line search refuses an otherwise-valid step. Evaluate line-search candidates as deltas from alpha=0, matching the monolithic iterative and parallel kernels: drop the constant gauss cost, make the alpha=0 point the zero-cost reference, evaluate each constraint contribution as cost(alpha) - cost(0) via the shifted helpers, and compare candidate costs against zero. Gradient and hessian are offset-free and are left unchanged, so the Newton step and bracketing logic are untouched. Add a direct island line-search unit test that drives the kernel on a single island whose large gauss cost hides a sub-resolution improvement.
3ba64d8 to
0335201
Compare
thowell
approved these changes
Jun 3, 2026
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.
Follow-up to #1374, which fixed line-search cost precision for the monolithic iterative and parallel kernels but left the island solver on absolute cost bookkeeping. This applies the same shifted-improvement treatment to
linesearch_island.When absolute constraint costs are large, the accepted improvement can fall below float32 resolution, so
previous_cost - current_costrounds to zero and the line search refuses an otherwise-valid step.This evaluates line-search candidates as deltas from the current point: drop the constant gauss cost, make the
alpha = 0point the zero-cost reference, evaluate each constraint contribution ascost(alpha) - cost(0)via the existing shifted helpers, and compare candidate costs against zero. Gradient and hessian are offset-free and left unchanged, so the Newton step and bracketing logic are untouched.Adds a direct island line-search unit test that drives the kernel on a single island whose large gauss cost hides a sub-resolution improvement: it returns
alpha = 0(no step) without the fix and the correct step with it. This mirrors the direct unit test #1374 used for the non-island path. An end-to-end parity test cannot detect this bug, because the Newton step and bracketing are gradient-driven (offset-free) and still convergeqaccto within float32 resolution; the cost-precision loss only rejects a step once the remaining improvement is already sub-resolution.Verified locally with:
uv run --extra dev pytest mujoco_warp/_src/solver_test.pyuv run pre-commit run --files mujoco_warp/_src/solver.py mujoco_warp/_src/solver_test.py