Skip to content

fix: likelihood-breakdown cells use the #682 pseudo-determinant ln det H; re-pin (#525) - #526

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/likelihood-breakdown-cells-pdet
Nov 10, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/likelihood-breakdown-cells-pdet

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Fixes #525, the remainder of #523. Since PyAutoArray#682 the library's ln det H is a pseudo-determinant for the smoothness regularizations. The per-likelihood breakdown cells still computed the old value, and their pinned regression evidences were broken.

  • One shared helper. reconstruction_steps.grounding_from(inversion) resolves (keep, Σ log P_b) once, eagerly, and log_det_regularization_from(reg_reduced, grounding) does the library's arithmetic. Every cell-side ln det H now goes through them:
    • the inline compute_log_evidence of imaging/{rectangular,delaunay,delaunay_nn} and datacube/delaunay (dense and sparse);
    • their timed log_det_regularization_jit rows;
    • sparse_steps.log_evidence, via SparseContext.reg_grounding;
    • the raw log_evidence_terms calls;
    • matrix_free: the exact log det, the scorer call, and SLQ, which now runs on the grounded subspace and adds Σ log P_b.
  • fix: likelihood_breakdown harness follows PyAutoArray#682 pseudo-determinant log det H (#523) #524's code (FixedLightSystem, log_evidence_terms_np) moves to the same (keep, offset) form. The JAX-free system builder keeps a NumPy copy, pinned to the shared helper by a test.
  • Pins re-measured on RAL (job 414743, ral, CPU fp64, private library checkout at today's mains including #682). On every run the cell's own evidence equals the library's (log_evidence (inv matrices) == reference, to 1e-15 relative; datacube sparse cube assertion PASSED).
Cell Old pin New pin
delaunay constant_split 29083.548 29120.133
delaunay adapt_split 29140.296 29164.211
delaunay_nn constant_split 29144.582 29153.794 (+9.21, #682 alone)
delaunay_nn adapt_split 29277.465 29358.118
rectangular bilinear 28621.129 28631.605
rectangular rtu 28505.344 28515.532
matrix_free log dets 2026-09-11 A100 values measured (rectangular ln det H +18.42 = ln 1e8, exactly)
datacube sma (per channel) unpinned −3160.43901

Most shifts are larger than #682's 9.21. They also carry library changes since the previous pins, which went unnoticed: main's lint runs had been cancelled, and some pins only record drift rather than fail.

Scripts Changed

  • scripts/misc/likelihood_breakdown/reconstruction_steps.py: grounding_from, log_det_regularization_from; log_evidence_terms uses them.
  • scripts/misc/likelihood_breakdown/sparse_steps.py: SparseContext.reg_grounding; log_evidence uses it.
  • scripts/misc/likelihood_breakdown/fixed_light_system.py, fixed_light_cpu_common.py: (keep, offset) grounding; JAX-free _grounding_from.
  • scripts/imaging/{rectangular,delaunay,delaunay_nn}/likelihood_breakdown.py, scripts/datacube/delaunay/likelihood_breakdown.py: REG_GROUNDING, grounded evidence and timed rows, re-pins.
  • scripts/imaging/pixelized/matrix_free.py: grounded exact log det, scorer and SLQ; re-pinned PINNED_LOG_DETS.
  • scripts/misc/likelihood_breakdown/test/test_pdet_grounding.py (new): helper vs AbstractInversion.log_det_regularization_matrix_term, NumPy copy vs helper, runs under jit.
  • hpc/batch_cpu/submit_likelihood_breakdown_pdet_repin_ral_cpu_fp64 (new): the re-pin array.

Test plan

  • pytest scripts/misc/*/test: 1907 passed, 6 skipped (on c8a12b5; the re-pin commit touches pins only).
  • ruff check . / ruff format --check .; all 12 generated-surface lint checks on a clean tree.
  • RAL 414743: 10/10 COMPLETED. The cell evidence equals the library on every run, and the new pins are the measured values.
  • CI lint on this PR.

Heart RED override (development only)

Authorization. The live human answered the gate question for #525 with "Override + RAL validation" (2026-11-09). That covers development shipping and the RAL CPU array. Merging needs a separate human /prm with every required check green. This does not release anything, bypass any check, or claim to fix Heart.

RED reasons at ship (heart_feed.py, verbatim):

Heart: RED — Release RED; monitoring RED · 11/100 · 143 unresolved (updated 21h ago)
  [red] PyAutoGalaxy: CI failure — https://api.github.com/repos/PyAutoLabs/PyAutoGalaxy/actions/runs/42605341827
  [red] PyAutoLens: CI failure — https://api.github.com/repos/PyAutoLabs/PyAutoLens/actions/runs/42605339633
  [red] PyAutoGalaxy: PyAutoGalaxy: CI failure
  [red] PyAutoLens: PyAutoLens: CI failure
  [red] PyAutoGalaxy/Tests: failure
  [red] PyAutoGalaxy/workflows/Tests: failure
  [red] PyAutoHands/workflows/Python Version Matrix: failure
  [red] PyAutoHeart/workflows/Workspace Smoke: failure
  [red] PyAutoLens/Tests: failure
  [red] PyAutoLens/workflows/Tests: failure
  [red] PyAutoGalaxy: PyAutoGalaxy: CI failure
  [red] PyAutoLens: PyAutoLens: CI failure
  [red] autolens_test: red
  [red] Workspace validation: NOT ready — 1399p / 14f / 125s @ cloud#42607741369
  [red] test_run: red
  [red] PyAutoArray: red
  [red] PyAutoGalaxy: red
  [red] PyAutoLens: red
  [red] Worktree drift: 0 orphan / 0 missing / 3 dirty
  [yellow] workspace validation not passing (14 failed, cloud#42607741369: autolens_test scripts/imaging/delaunay.py, autolens_test scripts/imaging/rectangular.py, autole…
  [yellow] PyAutoHeart: CI in_progress
  [yellow] HowToGalaxy/Smoke Tests: warn
  [yellow] HowToLens/Smoke Tests: warn
  [yellow] PyAutoBrain/Nightly Release: warn
  [yellow] CI wall-clock: 27 gates · slowest PyAutoBrain Nightly Release 118m · 3 slowed
  [yellow] PyAutoCortex: 1 uncommitted file(s) in canonical checkout
  [yellow] PyAutoPulse: 1 uncommitted file(s) in canonical checkout
  [yellow] magnification-maps-wiring/PyAutoArray: 2 uncommitted file(s) in task worktree
  [yellow] magnification-maps-wiring/PyAutoGalaxy: 2 uncommitted file(s) in task worktree
  [yellow] magnification-maps-wiring/PyAutoLens: 3 uncommitted file(s) in task worktree
  [yellow] PyAutoGalaxy/autogalaxy/3.13: yellow
  [yellow] autogalaxy: yellow
  [yellow] Import timing: 1 imports >1.5× baseline, 11 within
  [yellow] autofit_workspace/features/expectation_propagation.py: EP parked as not release-ready. EP message projection is unstable: a truncated per-factor search project…
  [yellow] autofit_workspace_test/graphical/analytic_gaussian_priors.py: moments projection (PyAutoFit#1656) passes the gaussian and truncated scatter families (16/16 eac…
  [yellow] autofit_workspace_test/graphical/ep.py: EP not release-ready: the per-factor searches are truncated (maxcall/maxiter=1000), so each search projects an ESS=1 po…
  [yellow] autofit_workspace_test/graphical/ep_deterministic.py: EP parked as not release-ready alongside graphical/ep.py. Passes today, but shares the EP machinery whose…
  [yellow] autofit_workspace_test/graphical/ep_exact.py: EP parked as not release-ready alongside graphical/ep.py. Passes today, but shares the EP machinery whose message…
  [yellow] autofit_workspace_test/graphical/ep_parity.py: EP parked as not release-ready alongside graphical/ep.py. Passes today, but shares the EP machinery whose messag…
  [yellow] autogalaxy_workspace/imaging/features/shapelets/modeling: real-search JAX shapelet fit exceeds the 1800s mode=release cap (>30min); speedup tracked by the Prof…
  [yellow] autogalaxy_workspace_test/multi_dataset/jax_likelihood/delaunay.py: quarantined: TIMEOUT 1805s at the release cap in TWO CONSECUTIVE release-integrate runs (34…
  [yellow] autogalaxy_workspace_test/multi_dataset/jax_likelihood/rectangular.py: re-quarantined: hung 1805s at the release cap in release-integrate run 33244320906 with …
  [yellow] autolens_workspace/cluster/start_here: hits the full 1800s mode=release cap in workspace-validation (PyAutoHeart run 29912642195). Script-specific, not a shard…
  [yellow] autolens_workspace/guides/modeling/advanced/expectation_propagation.py: EP parked as not release-ready. EP message projection is unstable: a truncated per-fact…
  [yellow] autolens_workspace/multi_galaxy/features/advanced/shapelets/modeling.py: hit the 1800s mode=release cap in the 2026.10.7.1 release smoke job (PyAutoHands run 3…
  [yellow] autolens_workspace/multi_galaxy/start_here: blocked two consecutive release runs after autolens_workspace#554 (2026-09-17) swapped it off the simulated `simple…
  [yellow] autolens_workspace/weak/features/strong_lensing/a2744: hits the full 1800s mode=release cap in workspace-validation (PyAutoHeart run 29912642195). Script-speci…
  [yellow] autolens_workspace_test/cluster/visualization: per-plane critical-curve + caustic computation on the required full-extent 250x250 viz_grid (multi-plane marchin…
  [yellow] autolens_workspace_test/imaging/subhalo_recovery_evidence.py: evidence-grid acceptance test of PyAutoLens#672 (156-point one-shot + 25-point iterative-to-conve…
  [yellow] autolens_workspace_test/imaging/visualization/modeling_visualization_delaunay_jit: now FAILS its own JIT-cache assertion at 52s (cached 2.45s not < 0.5x compil…
  [yellow] autolens_workspace_test/imaging/visualization/modeling_visualization_jit: re-measured: times out at the 300s cap; JIT + full visualization pipeline
  [yellow] autolens_workspace_test/imaging/visualization/modeling_visualization_rectangular_jit: now FAILS its own JIT-cache assertion at 36s (cached 2.21s not < 0.5x com…
  [yellow] autolens_workspace_test/interferometer/visualization/modeling_visualization_jit: historically >300s cap; local re-measurement OOM-killed (SIGKILL) at 132s - me…
  [yellow] autolens_workspace_test/misc/database/scrape/multi_analysis_jax: re-measured: times out at the real 300s cap (full search, no test mode)
  [yellow] autolens_workspace_test/misc/database/scrape/slam_general_jax: re-measured: times out at the real 300s cap (full search, no test mode)
  [yellow] autolens_workspace_test/misc/database/scrape/slam_multi_one_by_one_jax: re-measured: times out at the real 300s cap (full search, no test mode)
  [yellow] autolens_workspace_test/misc/database/scrape/slam_pix_jax: re-measured: times out at the real 300s cap (full search, no test mode)
  [yellow] autolens_workspace_test/multi_dataset/jax_likelihood/delaunay.py: hung 1805s in release-integrate run 33177898708 (second vmap call, post-compile) with XLA_FLA…
  [yellow] autolens_workspace_test/multi_dataset/jax_likelihood/delaunay_mge.py: hung twice in 30 min with XLA_FLAGS=--xla_cpu_multi_thread_eigen=false in force: 1805s at…
  [yellow] autolens_workspace_test/multi_dataset/jax_likelihood/shared_preloads.py: hung 1805s in release-integrate run 33220882817 (vmap trace at shared_preloads.py:211 …
  [yellow] Skipped-script census: 13 SLOW (5 unmeasured) / 14 NEEDS_FIX / 52 permanent across 10 workspaces
  [yellow] Release readiness: workspace validation not passing (14 failed, cloud#42607741369: autolens_test scripts/imaging/delaunay.py, autolens_test scripts/imaging/rec…
  [yellow] HowToFit:behind: behind: 2
  [yellow] PyAutoEyes:behind: behind: 1
  [yellow] PyAutoHands:behind: behind: 8
  [yellow] PyAutoHeart:behind: behind: 2
  [yellow] PyAutoInsight:behind: behind: 1
  [yellow] PyAutoMemory:behind: behind: 2
  [yellow] PyAutoPulse:behind: behind: 1
  [yellow] autocti_workspace:behind: behind: 2
  [yellow] autofit_workspace:behind: behind: 2
  [yellow] autogalaxy_workspace:behind: behind: 2
  [yellow] autolens_workspace:behind: behind: 2
  [yellow] HowToFit/scripts/chapter_advanced/tutorial_5_expectation_propagation.py/3.12: warn
  [yellow] autofit_workspace_test/scripts/graphical/analytic_gaussian_collapse.py/3.13: warn
  [yellow] autolens_workspace_test/scripts/interferometer/jax_likelihood/mge.py/3.13: warn
  [yellow] autolens_workspace_test/scripts/misc/jax_assertions/delaunay_nn.py/3.13: warn
  [yellow] autolens_workspace_test/scripts/misc/jax_assertions/delaunay_nn_caps.py/3.13: warn
  [yellow] Smoke scripts: 624 scripts timed across 11 repos · slowest autolens_workspace_test scripts/misc/jax_assertions/critical_curves_zero_contour_jit_grad.py 1m · 5 …
  [yellow] PyAutoArray/test_autoarray/inversion/pixelization/interpolator/test_sibson_failed_rows.py::test__jax__degenerate_row_with_no_selected_entry__matches_reference:…
  [yellow] PyAutoGalaxy/test_autogalaxy/interferometer/model/test_plotter_interferometer.py::test__visualizer__matrix_free_route[True]: yellow
  [yellow] PyAutoGalaxy/test_autogalaxy/interferometer/test_fit_interferometer.py::test__fit_figure_of_merit__sparse_operator__pixelization_only__jax_jit_matches_numpy: y…
  [yellow] PyAutoNerves/test_autonerves/test_default.py::test_keep_first: yellow
  [yellow] Unit-test timing: 5 tests >1.5× baseline, 267 within
  [yellow] URL hygiene: 2 forbidden pattern(s) in 2 repo(s) (swept 2026-11-04T13:58:45.284480+00:00)
  [yellow] PyAutoCortex: yellow
  [yellow] PyAutoPulse: yellow

Tier: judge. Merge mode: human /prm.

Closes #525

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits November 9, 2026 19:58
…t H (#525)

Shared helpers in reconstruction_steps: grounding_from(inversion) -> (keep,
sum log P_b) resolved eagerly, and log_det_regularization_from(reg_reduced,
grounding) -> the library's ln det(H). Every cell-side ln det(H) now uses
them: the inline compute_log_evidence of imaging/{rectangular,delaunay,
delaunay_nn} and datacube/delaunay (dense + sparse), their timed
log_det_regularization_jit rows, sparse_steps.log_evidence (via
SparseContext.reg_grounding), the raw log_evidence_terms calls, and
matrix_free (exact log det, scorer call, SLQ on the grounded subspace plus
sum log P_b). #524's FixedLightSystem / log_evidence_terms_np move to the
(keep, offset) form; the JAX-free builder keeps a numpy copy pinned to the
helper by test_pdet_grounding.py (also pins the helper to
AbstractInversion.log_det_regularization_matrix_term and runs it under jit).

Pins are re-measured in a follow-up commit from the RAL array added here
(submit_likelihood_breakdown_pdet_repin_ral_cpu_fp64).

pytest scripts/misc/*/test: 1907 passed, 6 skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured by RAL job 414743 (ral, CPU fp64, private library mains incl.
#682). On every run the cell's own grounded evidence equals the library's
(log_evidence (inv matrices) == reference; datacube sparse cube assertion
PASSED).

- delaunay: constant_split 29120.1328, adapt_split 29164.2105
- delaunay_nn: constant_split 29153.7935 (+9.21, #682 alone), adapt_split 29358.1182
- rectangular: bilinear 28631.6052, rtu 28515.5316
- matrix_free PINNED_LOG_DETS (both log dets, all three meshes)
- datacube sma per-channel pin -3160.43901 (previously unpinned)

Besides #682, the shifts carry library changes since the previous pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit a8ac310 into main Nov 10, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/likelihood-breakdown-cells-pdet branch November 10, 2026 11:28
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.

fix: likelihood_breakdown cells still use pre-#682 ln det H (pins broken)

1 participant