Skip to content

Apply shifted line-search costs to island solver#1403

Merged
adenzler-nvidia merged 1 commit into
google-deepmind:mainfrom
adenzler-nvidia:adenzler/line-search-delta-island
Jun 3, 2026
Merged

Apply shifted line-search costs to island solver#1403
adenzler-nvidia merged 1 commit into
google-deepmind:mainfrom
adenzler-nvidia:adenzler/line-search-delta-island

Conversation

@adenzler-nvidia

Copy link
Copy Markdown
Collaborator

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_cost rounds 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 = 0 point the zero-cost reference, evaluate each constraint contribution as cost(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 converge qacc to 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.py
  • uv run pre-commit run --files mujoco_warp/_src/solver.py mujoco_warp/_src/solver_test.py

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.
@adenzler-nvidia adenzler-nvidia force-pushed the adenzler/line-search-delta-island branch from 3ba64d8 to 0335201 Compare June 3, 2026 11:39
@adenzler-nvidia adenzler-nvidia requested a review from thowell June 3, 2026 11:53
@adenzler-nvidia adenzler-nvidia merged commit 8f9ba2e into google-deepmind:main Jun 3, 2026
14 checks passed
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.

2 participants