Skip to content

Add opt-in gauge_project_x0 to the imaging iterative warm start#632

Merged
Jammy2211 merged 1 commit into
mainfrom
fix/potential-correction-warm-start-imaging
Jul 17, 2026
Merged

Add opt-in gauge_project_x0 to the imaging iterative warm start#632
Jammy2211 merged 1 commit into
mainfrom
fix/potential-correction-warm-start-imaging

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Why

ad97e5fd5 (interferometer PR #626) switched the shared imaging LM engine's damping to mu*diag(H). Under scale-invariant damping, cold-starting IterFitDpsiSrcImaging from zeros no longer lands in the subhalo basin — the autolens_workspace_test regression subhalo_recovery.py collapsed from corr 0.78 to a deterministic 0.032 (failing on main, 3.12 & 3.13, env-independent).

#630 added an x0 warm start as the certified recipe, but no test exercised it, and warm-starting a gauge_constraints solve from the (un-gauged) one-shot solution left the gauge <dpsi,1> = <dpsi,x> = <dpsi,y> = 0 violated: each accepted LM step re-imposes the gauge on the updated state, but from a near-optimal un-gauged start the gauge-fixing move slides along the model-degenerate constant / deflection-drift modes and is not cost-decreasing, so the LM rejects it and stalls off the constraint surface.

What

  • New gauge_project_x0 parameter on IterFitDpsiSrcImaging.solve_joint_optimization (default False, behaviour unchanged). When True, projects x0's dpsi onto the gauge subspace before iterating, via the new _gauge_project_dpsi. The projected modes are the null space of the Hamiltonian dpsi -> dkappa map, so the recovered convergence correction is unchanged.
  • Two new unit tests: functional zeroing of _gauge_project_dpsi, and an un-gauged near-optimal warm start ending gauge-satisfied. Full test_autolens/potential_correction/ suite green (53 passed).

Companion

autolens_workspace_test branch of the same name switches subhalo_recovery.py to gauge_project_x0=True (corr 0.7822, gauge satisfied). Merge this library PR first.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V3MxfFWYP7cBPyLGE8MWAV

The Marquardt-scale LM damping (ad97e5f) made cold-starting
IterFitDpsiSrcImaging from zeros unreliable, and #630 added an x0 warm
start as the certified recipe — but warm-starting a gauge_constraints
solve from an un-gauged x0 (e.g. the one-shot FitDpsiSrcImaging solution)
leaves the gauge <dpsi,1> = <dpsi,x> = <dpsi,y> = 0 violated: each accepted
LM step re-imposes the gauge on the updated state, but from a near-optimal
un-gauged start the gauge-fixing move slides along the model-degenerate
constant / deflection-drift modes and is not cost-decreasing, so the LM
rejects it and stalls off the constraint surface.

Add gauge_project_x0 (default False, behaviour unchanged) which projects
x0's dpsi onto the gauge subspace before iterating, via _gauge_project_dpsi.
The projected modes are the null space of the Hamiltonian dpsi -> dkappa
map, so the recovered convergence correction is unchanged. Covered by two
new unit tests (functional zeroing + an un-gauged near-optimal warm start).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3MxfFWYP7cBPyLGE8MWAV
@Jammy2211
Jammy2211 merged commit 74bb13f into main Jul 17, 2026
4 of 5 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.

1 participant