Skip to content

Fix least_squares result when xtol is reached - #3418

Merged
copybara-service[bot] merged 1 commit into
google-deepmind:mainfrom
winklemad:fix/minimize-xtol-accepted-candidate
Jul 22, 2026
Merged

Fix least_squares result when xtol is reached#3418
copybara-service[bot] merged 1 commit into
google-deepmind:mainfrom
winklemad:fix/minimize-xtol-accepted-candidate

Conversation

@winklemad

Copy link
Copy Markdown
Contributor

Summary

  • accept the Armijo-approved candidate before terminating on xtol
  • add a regression test ensuring least_squares returns that accepted candidate

Problem

When an accepted step satisfies the relative step-size tolerance, least_squares sets DX_TOL and exits before assigning xnew and rnew. It therefore returns the previous, higher-objective iterate and records that stale iterate in the final trace.

Testing

  • focused test_xtol_returns_accepted_candidate: passed
  • complete python/mujoco/minimize_test.py module: 16 tests passed
  • trailing-whitespace: passed
  • end-of-file-fixer: passed
  • git diff --check: passed

@kevinzakka
kevinzakka requested a review from yuvaltassa July 22, 2026 03:46

@kevinzakka kevinzakka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

@kevinzakka
kevinzakka removed the request for review from yuvaltassa July 22, 2026 15:29
@copybara-service
copybara-service Bot merged commit c214e81 into google-deepmind:main Jul 22, 2026
21 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