Skip to content

fix: dataset-scoped preloads consumption — cross-type shared state reduces to mesh view - #601

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/multi-shared-state-scoped-preloads
Jul 10, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/multi-shared-state-scoped-preloads

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Correctness follow-up to #600 (design PyAutoLens#599 D5): in a joint imaging + interferometer FactorGraphModel, the lead factor's shared preloads are forwarded to every factor — but a PreloadsInterferometer carries a mapper + curvature matrix that embed its dataset's grids. Consuming them in an imaging fit (or vice versa) would silently corrupt the likelihood.

Both fits now scope their preloads at consumption (_preloads_scoped): same-type preloads pass through by identity (datacube path byte-for-byte unchanged); cross-type preloads reduce to the mesh-geometry view — the only part valid across dataset types. AnalysisInterferometer.shared_state_from also populates the mesh fields, so an interferometer lead now shares the mesh cross-type (completing D5 in both directions).

Depends on the paired PyAutoArray PR (merge first).

API Changes

  • FitImaging._preloads_scoped / FitInterferometer._preloads_scoped (internal) — dataset-scoped preloads consumption.
  • AnalysisInterferometer.shared_state_from return value now also carries source_plane_mesh_grid / image_plane_mesh_grid (additive).

Test Plan

  • test_autolens/ full suite (381 passed) incl. new cross-type scoping tests both directions + interferometer mesh-field population
  • Base/downstream: test_autoarray/ (897) + test_autogalaxy/ (962)
  • Datacube parity script (identity path unchanged) + multi parity script against this branch

Autonomy

--auto safe continuation (four-leg gate; Heart YELLOW reason set unchanged from the user's in-session ack). Ends at PR-open; merge stays human.

🤖 Generated with Claude Code

…duces to mesh view

In a joint imaging+interferometer FactorGraphModel, the lead factor's shared preloads are
forwarded to EVERY factor. A PreloadsInterferometer carries a mapper + curvature matrix that
embed ITS dataset's grids — consuming them in an imaging fit (or vice versa) would silently
corrupt the likelihood. Both fits now scope their preloads at consumption (_preloads_scoped):
same-type passes through by identity; cross-type reduces to the mesh-geometry view, the only
part valid across dataset types (PyAutoLens#599 D5). AnalysisInterferometer.shared_state_from
also populates the mesh fields so an interferometer lead shares the mesh cross-type.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 10, 2026
@Jammy2211
Jammy2211 merged commit e3ab69b into main Jul 10, 2026
3 of 5 checks passed
@Jammy2211
Jammy2211 deleted the feature/multi-shared-state-scoped-preloads branch July 10, 2026 15:34
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 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.

1 participant