Skip to content

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

Closed

Description

@Jammy2211

Overview

Remainder of #523. PyAutoArray#682 normalises the smoothness regularizations' H by its pseudo-determinant. That shifts every such fit's log evidence by about +9.21 nats per regularized mapper. #524 aligned the shared scorer (reconstruction_steps.log_evidence_terms with grounding=, FixedLightSystem, log_evidence_terms_np). The per-likelihood cells still compute ln det H the old way, and their pinned regression evidences are now broken: the shift is about 3e-4 relative against rtol=1e-4, so delaunay / delaunay_nn / rectangular / datacube fail their "Eager regression assertion" on today's library mains.

Plan

  • Ground H in every cell-side ln det H, the same way as the library: delete each grounded row and column, then add Σ log P_b, using inversion._intrinsic_regularization_blocks. The grounded indexes are fixed in advance, so the timed jitted steps stay jit-compatible.
  • Sites:
    • the inline compute_log_evidence in imaging/{rectangular,delaunay,delaunay_nn}/likelihood_breakdown.py and datacube/delaunay/likelihood_breakdown.py;
    • scripts/misc/likelihood_breakdown/sparse_steps.log_evidence;
    • imaging/pixelized/matrix_free.py, both the exact path and the SLQ estimate;
    • the four raw reconstruction_steps.log_evidence_terms calls, plus test_matrix_free_steps.py.
  • Re-pin each cell's EXPECTED_LOG_EVIDENCE* from measured eager runs, documented like the existing pins.
  • Validate locally with pytest scripts/misc/*/test and every lint check. Then run a RAL CPU array (ral, private library checkout at today's mains, via hpc/sync), one eager run per cell and regularization scheme. Each run checks the cell evidence against FitImaging.log_evidence and records the new pin.

Tier: judge — merge mode: human /prm. Heart RED: the live human authorized the development-only override and the RAL validation (2026-11-09, "Override + RAL validation").

Detailed implementation plan

Affected Repositories

  • autolens_profiling (primary)

Suggested branch: feature/likelihood-breakdown-cells-pdet

Implementation Steps

  1. Add a shared helper in scripts/misc/likelihood_breakdown/reconstruction_steps.py, e.g. grounding_from(inversion) and log_det_regularization_grounded(reg_reduced, grounding). The four cells, sparse_steps and matrix_free all use it. fix: likelihood_breakdown harness follows PyAutoArray#682 pseudo-determinant log det H (#523) #524's fixed_light_system._reg_grounding_from moves onto it.
  2. Change each cell's compute_log_evidence and the jitted steps it times to take the static grounding.
  3. Re-pin EXPECTED_LOG_EVIDENCE_HST (delaunay, delaunay_nn, rectangular) and EXPECTED_LOG_EVIDENCE_PER_CHANNEL (datacube) from the RAL runs.
  4. Add a unit test pinning log_det_regularization_grounded against AbstractInversion.log_det_regularization_matrix_term.
  5. Add a RAL submit hpc/batch_cpu/submit_likelihood_breakdown_pdet_repin_ral_cpu_fp64 (array over cell × scheme, eager pin runs only).

Activity

  1. added
    bug
    on Nov 9, 2026
  2. Jammy2211 commented on Nov 10, 2026

    @Jammy2211
    ContributorAuthor

    Heart RED override (development only), recorded at ship

    The live human chose "Override + RAL validation" for this task (2026-11-09). That covers development shipping and the RAL CPU validation array. Merge needs a separate human /prm with every required check green.

    RED reasons at ship (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
    

    Branch gates passed (feature/likelihood-breakdown-cells-pdet @ e90e240):

    • pytest scripts/misc/*/test: 1907 passed, 6 skipped.
    • ruff is clean, and all 12 generated-surface lint checks pass on a clean tree.
    • RAL 414743: 10/10 COMPLETED. The cell evidence equals the library's on every run, and the pins are re-measured from those runs.

    PR: #526

  3. added a commit that references this issue on Nov 10, 2026
  4. Jammy2211 commented on Nov 10, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    PR #526 merged 2026-11-10 (a8ac310) via the human's /prm, with lint green. Heart was RED; the development-only override is recorded above.

    • Every cell-side ln det H now uses reconstruction_steps.grounding_from / log_det_regularization_from, the library's pseudo-determinant from PyAutoArray#682. That covers the four likelihood-breakdown cells (dense, sparse and timed rows), sparse_steps, and matrix_free (exact, scorer and SLQ).
    • Pins re-measured from RAL 414743. The cell evidence equals the library's on all 10 runs; see the PR for the old and new values.
    • New test test_pdet_grounding.py pins the helper to AbstractInversion.log_det_regularization_matrix_term.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions