Skip to content

tighten sparse-vs-non-sparse to assertion in pixelization_sparse_cpu.py - #42

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/pixelization-sparse-cpu-assert
May 1, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/pixelization-sparse-cpu-assert

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Now that the sparse-CPU OOB bug is fixed (PyAutoArray PR #296, merged in ae43ae1), tighten the diagnostic script's sparse-vs-non-sparse comparison from a printed warning to a real np.testing.assert_allclose. The script doubles as a CPU-sparse regression test: if the bug recurs, the script fails loudly instead of silently writing false into the JSON.

Verification

  • python jax_profiling/imaging/pixelization_sparse_cpu.py exits 0.
  • Both assertions pass: non-sparse vs JAX expected (26232.0685738), and sparse vs non-sparse (observed rtol = 1.18e-09).

Scripts Changed

  • jax_profiling/imaging/pixelization_sparse_cpu.py — sparse-path printed-warning branch replaced with np.testing.assert_allclose. Docstring updated to reflect that the sparse path is now asserted (with a forward reference to PyAutoArray PR #296 for the bug context).
  • jax_profiling/imaging/results/pixelization_sparse_cpu_likelihood_summary_hst_v2026.5.1.4.{json,png} — refreshed for the post-fix run (log_evidence_sparse = 26232.068543, sparse_matches_non_sparse_rtol_1em4 = true).

Upstream PR

PyAutoLabs/PyAutoArray#296 (merged)

Test Plan

  • python jax_profiling/imaging/pixelization_sparse_cpu.py — exits 0, both assertions PASSED

🤖 Generated with Claude Code

PyAutoArray PR #296 fixed the OOB read in psf_precision_value_from
that made apply_sparse_operator_cpu() return NaN log_evidence at
masks touching the noise-map array boundary. Now that the sparse
path is correct, replace the printed-warning branch at the bottom
of pixelization_sparse_cpu.py with a real np.testing.assert_allclose
so the script doubles as a CPU-sparse regression test: if the bug
recurs, the script fails loudly instead of silently writing a "false"
flag into the JSON.

Refresh JSON+PNG artifacts to reflect the post-fix state — sparse
log_evidence is 26232.068543 (matches non-sparse to rtol=1.18e-09).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release Pending release build label May 1, 2026
@Jammy2211
Jammy2211 merged commit 2e85d31 into main May 1, 2026
@Jammy2211
Jammy2211 deleted the feature/pixelization-sparse-cpu-assert branch May 1, 2026 16:36
@Jammy2211 Jammy2211 removed the pending-release Pending 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