fix: dataset-scoped preloads consumption — cross-type shared state reduces to mesh view#601
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aPreloadsInterferometercarries 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_fromalso 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_fromreturn value now also carriessource_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 populationtest_autoarray/(897) +test_autogalaxy/(962)Autonomy
--autosafe 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