Skip to content

feat: matrix-free interferometer positivity via primal-dual interior point with active-set polish (phase 4 of #638) - #652

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/matrix-free-interferometer-phase4
Oct 21, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/matrix-free-interferometer-phase4

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes #648. Phase 4 of #638. Community proposal: PyAutoLabs/.github#39 (@HRSAstro), reference snippet section 6.

Summary

Positivity for the matrix-free interferometer path without an n×n factorisation: reconstruction_positive_via_interior_point_from solves (F + H)x = D, x ≥ 0 by a Mehrotra predictor-corrector primal-dual interior point method (Jacobi start; each Newton step a CG solve preconditioned by the sparse LU of the Powell preconditioner plus the barrier diagonal, refactorised per step; CG tolerance tied to the duality gap; centring σ = (μ_aff/μ)³; fraction-to-boundary 0.99). Once the active set settles the free pixels are solved exactly by CG with the free-set sub-preconditioner, so held pixels are exact zeros, with primal-dual active-set corrections (Hintermüller, Ito & Kunisch 2002) if negatives appear. Returns a PositiveReconstructionResult (reconstruction, support, step counts, final gap/residual, converged). The module docstring lists the remaining phase-5 work (wiring, Pulse profiling note, workspace example, uncertainty maps, linear light profiles / multiple mappers).

API Changes

Additive only: reconstruction_positive_via_interior_point_from(...) and PositiveReconstructionResult in inversion_interferometer_matrix_free_util.
See full details below.

Test Plan

test_matrix_free_util.py (26 tests in the file), data-dominated case (500 visibilities), MaternSparse on a 10×10 mesh:

case pixels at zero support mismatch vs NNLS value error (rel max) IP steps polish diff vs sparse positive-only path
weak, coefficient 0.01 72% 0 1.5e-10 8 1 1.5e-10
strong, coefficient 1e4 33% 0 5.8e-13 10 1 5.8e-13

NNLS reference = scipy.optimize.nnls on the Cholesky-whitened dense system; sparse path = InversionInterferometerSparse positive-only (use_edge_zeroed_pixels=False so both solve the same problem). All-positive case matches the unconstrained PCG to 4.9e-10. 6×6 sweep over coefficients 1e-4 to 1e7: support mismatch 0 everywhere, 7–22 steps. Forcing an early stop after 2 interior-point steps exercises 3 polish solves and still recovers the NNLS support and values. JAX-blocked subprocess test extended. Worktree run: pytest test_autoarray/inversion -q → 1067 passed, 4 xfailed.

Heart YELLOW acknowledged by the human on 2026-10-21 (manifest drift 1 mismatch; release validation stale: source moved since rehearsal (PyAutoArray)).

Full API Changes (for automation & release notes)

Added

  • inversion_interferometer_matrix_free_util.reconstruction_positive_via_interior_point_from(operator, regularization_matrix_sparse, coefficient, max_steps=60, tol=1e-9, cg_rtol_min=1e-8, cg_rtol_max=1e-2, polish_rtol=1e-10, max_polish=10, maxiter=5000) → PositiveReconstructionResult(reconstruction, support, n_steps, n_polish, gap, residual, converged)

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits October 21, 2026 14:05
…point with active-set polish

Phase 4 of #638 (#648). reconstruction_positive_via_interior_point_from solves
(F + lambda H) s = D, s >= 0 with a Mehrotra predictor-corrector interior point
whose Newton systems are CG-solved with the Powell preconditioner plus the
barrier diagonal (sparse LU per step), then an exact free-set CG solve with
primal-dual active-set corrections so held pixels are exact zeros. Module
docstring lists the remaining phase-5 work.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… sparse positive-only path

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 086c727 into main Oct 21, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/matrix-free-interferometer-phase4 branch October 21, 2026 13:10
@Jammy2211 Jammy2211 added pending-release PR queued for the next release build and removed pending-release PR queued for the next release build labels Oct 21, 2026
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.

feat: matrix-free interferometer inversion phase 4 — interior-point positivity with active-set polish

1 participant