Skip to content

fix: al.FitInterferometer sparse path uses the profile-subtracted dirty image (PyAutoArray#575) - #750

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/interferometer-mge-w-tilde-route
Sep 26, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/interferometer-mge-w-tilde-route

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

This applies the sparse-interferometer dirty-image fix from PyAutoGalaxy to al.FitInterferometer. When the dataset has a sparse operator and the tracer has ordinary light profiles (for example a lens Sersic with a source MGE or pixelization), the inversion now forms D from the profile-subtracted data via d~ − W~ i_p. Before this fix it used the unsubtracted cached dirty image. Lens Sersic + source MGE gave logL −27.094 sparse against −24.291 dense; the test fails on the old code and passes with the fix.

Stacked on PyAutoLabs/PyAutoArray#576 and PyAutoLabs/PyAutoGalaxy#629 (PyAutoArray#575); merge those first.

API Changes

  • New cached property al.FitInterferometer.profile_image, the tracer's ordinary-light image on grids.lp. profile_visibilities is built from it.
  • tracer_to_inversion passes sparse_dirty_image (from autogalaxy's sparse_dirty_image_from) to the inversion.
    See full details below.

Test Plan

  • test_autolens full suite: 757 passed, 1 xfailed
  • New: lens Sersic + Isothermal with a source MGE Basis, sparse vs dense to 1e-8. The no-lens-light control keeps the cached image, and a consistency check confirms profile_image transforms to tracer.visibilities_from.
  • alma under CPU jit: MGE + lens Sersic takes 1.30 s sparse against 13.8 s dense, with identical logL.
  • Workspace smoke: 24/24 targeted interferometer scripts pass (details in the Heart RED override section)
Full API Changes (for automation & release notes)

Added

  • al.FitInterferometer.profile_image (cached property)

Changed Behaviour

  • FitInterferometer.tracer_to_inversion supplies sparse_dirty_image when the dataset has a sparse operator and the tracer has ordinary light profiles.
  • FitInterferometer.profile_visibilities is computed from profile_image. The values are unchanged.

Migration

  • None required.

Heart RED override (development only)

The human authorized the AUTONOMY.md "Human override for Heart RED (development only)" for this task (PyAutoArray#575, branch feature/interferometer-mge-w-tilde-route) on 2026-09-26. When asked how to proceed with the three library PRs, they chose "Override, open PRs". The override covers commit, push and opening pending-release PRs only. Merging needs a separate /prm with every required check green. This branch does not claim to fix Heart.

Exact RED reasons at ship time:

  • release validation FAILED (stage integrate)
  • workspace validation not passing (4 failed, cloud#35579888156: autolens notebooks/cluster/modeling.ipynb, autolens notebooks/weak/a2744.ipynb, autolens scripts/cluster/modeling.py, +1 more)
  • manifest drift: hub organism blurb (organs present) — 7 mismatch(es) vs PyAutoMind/repos.yaml
  • manifest drift: organism-map blocks (generated) — 1 mismatch(es) vs PyAutoMind/repos.yaml

Branch gates passed: 24/24 targeted interferometer smoke scripts pass on the branch (autolens_workspace 11, autogalaxy_workspace 5, autolens_workspace_test 5, autogalaxy_workspace_test 3: MGE, pixelization, linear light profiles, sparse-operator JAX assertions and likelihood pins). autolens_workspace_test/.../jax_likelihood/mge.py first failed identically on the branch and on the mains because the local dataset was stale (2026-08-06, older than the 09-18 simulator change); after regenerating it, the script passes on both. Unit suites: PyAutoArray 1706 passed, PyAutoGalaxy 1240 passed, PyAutoLens 757 passed + 1 xfailed. My own diff review is in-session only; the human reviews at merge.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits September 26, 2026 11:53
…cted visibilities (PyAutoArray#575)

FitInterferometer.tracer_to_inversion passes sparse_dirty_image via
autogalaxy's sparse_dirty_image_from over the tracer galaxies. Test: lens
Sersic + source MGE, sparse vs dense to 1e-8, with an all-linear control.

Refs PyAutoLabs/PyAutoArray#575

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…T (PyAutoArray#575)

tracer_to_inversion passes the cached ordinary light-profile image to
autogalaxy's sparse_dirty_image_from (d~ - W~ i_p); profile_visibilities is
built from the same cached image. Test asserts profile_image transforms to the
fit's profile_visibilities.

Refs PyAutoLabs/PyAutoArray#575

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dinary light (PyAutoArray#575)

profile_visibilities uses autogalaxy's Basis-aware
_has_light_profile_non_linear over tracer.galaxies and returns zeros for an
all-linear (e.g. MGE source, mass-only lens) tracer instead of forward-NUFFTing
an all-zero image. Test: profile_visibilities are zeros and the transformer is
not called.

Refs PyAutoLabs/PyAutoArray#575

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Added a follow-up commit (approved by the human, 2026-09-26): profile_visibilities now returns zero visibilities without a Fourier transform when the fit has no ordinary light profile. It uses the same Basis-aware predicate, so an MGE-only fit no longer runs a forward NUFFT of an all-zero image on every call. Tests: new spy test (fails on the previous HEAD, passes now). PyAutoGalaxy full suite 1241 passed; PyAutoLens 758 passed + 1 xfailed. On alma, CPU jit, MGE-only sparse log_likelihood drops from 0.995 s to 0.579 s, with identical logL. This is still covered by the Heart RED override above; no release.

@Jammy2211
Jammy2211 merged commit e58715e into main Sep 26, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/interferometer-mge-w-tilde-route branch September 26, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant