Skip to content

results: NNLS warm-start memo diagnostic, 32-cell lens-model robustness matrix, post-#453/#497 baseline (PyAutoArray#498) - #184

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/numba-cpu-nnls-iteration-reduction
Aug 28, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/numba-cpu-nnls-iteration-reduction

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Measurement leg of PyAutoArray#498 (numba CPU likelihood epic, phase 3a — the cross-evaluation NNLS warm-start memo, library PR: PyAutoLabs/PyAutoArray#501). Adds the per-solve active-set iteration diagnostic, the 11-variant / 32-cell lens-model robustness matrix, the fallback-guard re-check, the step-0 post-#453/#497 baseline re-profile, and the two notes that record the default-on decision.

Headline numbers (Delaunay-1250 + MGE-60 fiducial, AUTOARRAY_NUMBA_OPERATED_MEMO=0, OMP_NUM_THREADS=1): random-walk median active-set iterations 70→7 (euclid, 9.9×), 32→8 (hst, 4.0×); solve 0.54→0.05 s / 0.25→0.07 s; log-likelihood parity ≤ 4e-14 in all 32 matrix cells; zero seeded-solve failures; median solve time never worse than memo-off by >2%. Step-0 baseline: the solve is now 40% (euclid) / 17% (hst) of an evaluation, not the ~72% the issue was filed on.

Scripts Changed

  • scripts/imaging/likelihood_breakdown/delaunay_numba_nnls_iterations.py — NEW: random-walk + i.i.d. instance sequences, memo off/on, fnnls_cholesky stats captured from inside FitImaging; --model <variant>, --n-instances; counts fallbacks; JSON + PNG per cell
  • scripts/imaging/likelihood_breakdown/nnls_iterations_matrix.py — NEW: aggregates every cell JSON into results/notes/nnls_warm_start_memo_matrix.md
  • scripts/misc/likelihood_breakdown/README.md — scripts table rows for both numba cells (delaunay_numba.py was missing)
  • README.md, scripts/misc/likelihood_breakdown/README.md, scripts/misc/simulators/README.md — regenerated timing tables (build_readme.py, a lint.yml gate): the step-0 re-profile and the euclid simulator summary changed the numbers they read

Results

  • results/breakdown/imaging/delaunay_numba_nnls_iterations_{euclid,hst}[_<model>]_v2026.8.17.1.{json,png} — 16 cells
  • results/breakdown/imaging/delaunay_numba_breakdown_{euclid,hst}_v2026.8.17.1.{json,png} — step-0 baseline re-profile (overwritten in place, same version string)
  • results/simulators/imaging_euclid_summary_v2026.8.17.1.* — side effect: the euclid dataset was absent locally and auto_simulate_if_missing regenerated it; timings only, pinned log-likelihood unchanged
  • results/notes/nnls_warm_start_memo.md, results/notes/nnls_warm_start_memo_matrix.md; pointers in results/README.md

Test Plan

  • ruff check + ruff format --check on both scripts
  • AUTOLENS_PROFILING_SMOKE=1 python <script> exits 0 for both
  • ruff check . / ruff format --check . / build_readme.py --check / check_submits.py --check clean repo-wide; the six lint.yml smoke scripts exit 0
  • pinned log-likelihoods PASS in every run; memo on/off parity ≤ 4e-14
  • CI lint smoke green

Pre-existing red, not from this branch: lint.yml's pytest scripts/misc/test/ step fails test_hazards_prior_exit.py::test__records_the_clipper_as_what_blocks_it (the ClipperPriorBox anchor is not found in finding.blocked_by). It reproduces identically on canonical main (451b85f) with this branch nowhere in the checkout, and this branch touches no file under scripts/misc/hazards/ or scripts/misc/test/. Needs its own task.

Merges after PyAutoArray#498's PR (library-first gate). Generated by the PyAutoLabs agent workflow.

Jammy2211 and others added 3 commits August 28, 2026 10:06
… post-#453/#497 Delaunay numba baseline

New delaunay_numba_nnls_iterations.py: random-walk and i.i.d. 30-instance
sequences on the euclid + hst Delaunay-1250 fiducial, memo off vs on,
per-solve active-set iteration stats captured from inside FitImaging.
Random walk: median iterations 69.5 -> 7.0 (euclid), 32 -> 8 (hst); solve
0.54 -> 0.05 s / 0.25 -> 0.07 s; log-likelihood parity 3e-14. Note
results/notes/nnls_warm_start_memo.md records the gate verdict (default on).
Step-0 baseline re-profile: the solve is now 40% (euclid) / 17% (hst) of an
evaluation after #453/#497, not ~72%.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XySQZP6Npj4adZMkYZ96Bo
…ts, 32 cells) + fallback-guard re-check

delaunay_numba_nnls_iterations.py gains --model (powerlaw, subhalo,
no_lens_light, sersic_light, rectangular, adapt_reg, no_edge_zeroing,
source_complex, mesh_600, mesh_2000) and --n-instances, and counts
warm-start fallbacks; nnls_iterations_matrix.py aggregates every cell into
results/notes/nnls_warm_start_memo_matrix.md. Parity <= 4e-14 in all 32
cells, zero seeded-solve failures, median solve time never worse than
memo-off by >2%; every random-walk cell gains (3.2x-118x), only i.i.d.
sequences lose iterations (worst 0.52x), never time. Guard re-check: 3
fallbacks in 240 evaluations, all in hst/fiducial/iid.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XySQZP6Npj4adZMkYZ96Bo
…tifacts

`build_readme.py --check` is a lint.yml gate and was red on this branch: the
two preceding commits added the step-0 `delaunay_numba_breakdown_*` re-profile
and the `imaging_euclid_summary` artifact without regenerating the tables they
feed. Pure `build_readme.py` output, no hand edits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XySQZP6Npj4adZMkYZ96Bo
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Aug 28, 2026
@Jammy2211
Jammy2211 merged commit 9a04e5f into main Aug 28, 2026
1 check failed
@Jammy2211
Jammy2211 deleted the feature/numba-cpu-nnls-iteration-reduction branch August 28, 2026 16:01
@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