Skip to content

test: datacube shared_preloads shared-vs-unshared parity - #138

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/datacube-shared-state
Jun 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/datacube-shared-state

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds the correctness gate for the datacube cross-Analysis shared-state path (PyAutoArray #344 / PyAutoLens #566): a self-contained script that builds an identical-channel datacube FactorGraphModel two ways — shared_preloads=False (each channel rebuilds its inversion-setup quantities) and shared_preloads=True (the channel-invariant mapper + curvature matrix are computed once and reused) — and asserts the per-cube log-likelihoods are bit-identical, in both numpy and JAX. Preloading the channel-invariant quantities must not change the answer.

It uses the sparse (w-tilde) interferometer route (apply_sparse_operator), so both short-circuits are exercised: the mapper reuse in TracerToInversion and the curvature reuse in InversionInterferometerSparse. Parity is asserted within each backend (numpy-vs-numpy, jax-vs-jax), not across them, matching the pixelized-source path note in datacube/rectangular.py.

Scripts Changed

  • scripts/jax_likelihood_functions/datacube/shared_preloads.py — new: shared-vs-unshared datacube likelihood parity, numpy + JAX, independent of the other datacube scripts.
  • smoke_tests.txt — registered the new script.

Upstream PR

Test Plan

  • python scripts/jax_likelihood_functions/datacube/shared_preloads.py passes (numpy + JAX parity)

🤖 Generated with Claude Code

Self-contained test that builds an identical-channel datacube FactorGraphModel
both with shared_preloads=False and shared_preloads=True and asserts the cube
log-likelihoods are bit-identical, for both numpy and JAX, via the sparse route
(so both the mapper and curvature short-circuits are exercised). Registered in
smoke_tests.txt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jun 8, 2026
@Jammy2211
Jammy2211 merged commit 72a466a into main Jun 8, 2026
0 of 4 checks passed
@Jammy2211
Jammy2211 deleted the feature/datacube-shared-state branch June 8, 2026 14:46
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 7, 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