Skip to content

Fix backtracking step, first iteration, and default decrease in jax_fixed_point - #2964

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1031645164
Dec 1, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1031645164

Conversation

@copybara-service

Copy link
Copy Markdown

Fix backtracking step, first iteration, and default decrease in jax_fixed_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).

…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
copybara-service Bot merged commit 09e9504 into main Dec 1, 2026
16 checks passed
@copybara-service
copybara-service Bot deleted the test_1031645164 branch December 1, 2026 11:59
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.

1 participant