tighten sparse-vs-non-sparse to assertion in pixelization_sparse_cpu.py#42
Merged
Merged
Conversation
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>
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
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 realnp.testing.assert_allclose. The script doubles as a CPU-sparse regression test: if the bug recurs, the script fails loudly instead of silently writingfalseinto the JSON.Verification
python jax_profiling/imaging/pixelization_sparse_cpu.pyexits 0.26232.0685738), and sparse vs non-sparse (observedrtol = 1.18e-09).Scripts Changed
jax_profiling/imaging/pixelization_sparse_cpu.py— sparse-path printed-warning branch replaced withnp.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