Repository navigation
Fix backtracking step, first iteration, and default decrease in jax_fixed_point - #2964
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_1031645164
branch
from
December 1, 2026 11:39
5c98dc9 to
2b01a1b
Compare
…ixed_point Three bugs affected `jax_fixed_point.fixed_point` when `use_backtracking=True`: 1. After `linesearch.backtracking_linesearch` accepted a damped iterate `ls_state.x`, `body()` ran an extra undamped `f_x = func(ls_state.x, *args)` and returned `(f_x, ||R(ls_state.x)||^2, count)`. This defeated damping on stiff oscillating modes (`f'(x) < -1`), checked convergence against the stale residual of `ls_state.x` rather than `f_x`, and wasted two extra `func` evaluations per iteration. 2. In `'tolerance'` mode, initialization seeded `while_loop` with `(f_x0, ||R(x0)||^2, 1)`, bypassing backtracking on iteration 1 (inconsistent with `'max_iterations'`) and mismatching the carried iterate and residual. 3. The default `sufficient_decrease = 0.5` (`fixed_point_sufficient_decrease` in `SolverConfigBase`) cannot be satisfied for any step size when the local Picard contraction factor exceeds 0.5, stalling slowly contracting modes once the undamped extra step is removed. Return `(ls_state.x, ls_state.residual, ls_state.residual_norm, count + 1)` directly in the backtracking loop, seed `(x0, r0, ||r0||, 0)` in `'tolerance'` mode when backtracking is enabled, and lower the default `sufficient_decrease` to 1e-4 (matching `jax_root_finding.root_newton_raphson`). PiperOrigin-RevId: 1033415402
copybara-service
Bot
force-pushed
the
test_1031645164
branch
from
December 1, 2026 11:59
2b01a1b to
09e9504
Compare
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.
Fix backtracking step, first iteration, and default decrease in jax_fixed_point
Three bugs affected
jax_fixed_point.fixed_pointwhenuse_backtracking=True:linesearch.backtracking_linesearchaccepted a damped iteratels_state.x,body()ran an extra undampedf_x = func(ls_state.x, *args)and returned(f_x, ||R(ls_state.x)||^2, count). This defeated damping on stiff oscillating modes (f'(x) < -1), checked convergence against the stale residual ofls_state.xrather thanf_x, and wasted two extrafuncevaluations per iteration.'tolerance'mode, initialization seededwhile_loopwith(f_x0, ||R(x0)||^2, 1), bypassing backtracking on iteration 1 (inconsistent with'max_iterations') and mismatching the carried iterate and residual.sufficient_decrease = 0.5(fixed_point_sufficient_decreaseinSolverConfigBase) cannot be satisfied for any step size when the local Picard contraction factor exceeds 0.5, stalling slowly contracting modes once the undamped extra step is removed.Return
(ls_state.x, ls_state.residual, ls_state.residual_norm, count + 1)directly in the backtracking loop, seed(x0, r0, ||r0||, 0)in'tolerance'mode when backtracking is enabled, and lower the defaultsufficient_decreaseto 1e-4 (matchingjax_root_finding.root_newton_raphson).