Overview
Follow-up to PyAutoLabs/PyAutoGalaxy#553 (fixed by PyAutoLabs/PyAutoGalaxy#554): al.mp.PointMass and al.mp.SMBH broke every JAX-mode fit, and nothing in CI exercised the JAX path for point-mass profiles, so the regression class was invisible. Add coverage for both bug shapes.
Plan
- Add
mp.PointMass and mp.SMBH to scripts/misc/profiles_jit.py (profile-level JIT: deflections_yx_2d_from + convergence_2d_from on Grid2DIrregular and Grid2D.uniform, three-step pattern) — catches the ArrayIrregular deflections bug shape.
- New
scripts/imaging/jax_likelihood/smbh.py — full-pipeline vmap+jit likelihood with lens = Isothermal + SMBH where mass is a free parameter (a free traced mass is the only way to exercise the SMBH.__init__ bug shape; profiles_jit.py instantiates with floats). Mirrors imaging/jax_likelihood/lp.py; added to smoke_tests.txt so the PR CI gate runs it.
- Update
scripts/CLAUDE.md coverage docs.
Detailed implementation plan
Affected Repositories
- autolens_workspace_test (primary)
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./autolens_workspace_test |
main |
clean |
Suggested branch: feature/pointmass-smbh-jax-ci
Worktree root: ~/Code/PyAutoLabs-wt/pointmass-smbh-jax-ci/
Work Classification: Workspace
Implementation Steps
scripts/misc/profiles_jit.py — extend the mass-profile list with mp.PointMass(centre=(0.01, 0.02), einstein_radius=0.1) and mp.SMBH(centre=(0.01, 0.02), mass=1e10); both grids, all three JAX steps.
scripts/imaging/jax_likelihood/smbh.py — mirror lp.py: auto-sim jax_test dataset, mask, model with lens Isothermal + SMBH (mass LogUniformPrior(1e8, 1e11), redshifts fixed 0.5/1.0) + Sersic source, Fitness + _vmap batch with hardcoded expected literal, Path A jax.jit(analysis.fit_from) round-trip vs numpy scalar. __Env__ section ENV: jax full_datasets.
- Generate the vmap literal by running locally under the CI env tokens; run
lp.py first as a control to confirm the env reproduces its pinned literal (-1.34797827e09).
- Add
imaging/jax_likelihood/smbh.py to smoke_tests.txt.
- Update
scripts/CLAUDE.md (jax_likelihood table + profiles_jit profile list).
Key Files
scripts/misc/profiles_jit.py
scripts/imaging/jax_likelihood/smbh.py (new)
smoke_tests.txt
scripts/CLAUDE.md
Original Prompt
Click to expand starting prompt
Prompt file: PyAutoMind/test/autolens_workspace_test/pointmass_smbh_jax_ci_coverage.md
Maintainer instruction: "ok yes do a CI exercise in autolens_workspace_test with JAX on these profiles as a quick follow up"
Overview
Follow-up to PyAutoLabs/PyAutoGalaxy#553 (fixed by PyAutoLabs/PyAutoGalaxy#554):
al.mp.PointMassandal.mp.SMBHbroke every JAX-mode fit, and nothing in CI exercised the JAX path for point-mass profiles, so the regression class was invisible. Add coverage for both bug shapes.Plan
mp.PointMassandmp.SMBHtoscripts/misc/profiles_jit.py(profile-level JIT:deflections_yx_2d_from+convergence_2d_fromonGrid2DIrregularandGrid2D.uniform, three-step pattern) — catches the ArrayIrregular deflections bug shape.scripts/imaging/jax_likelihood/smbh.py— full-pipeline vmap+jit likelihood with lens = Isothermal +SMBHwheremassis a free parameter (a free traced mass is the only way to exercise theSMBH.__init__bug shape;profiles_jit.pyinstantiates with floats). Mirrorsimaging/jax_likelihood/lp.py; added tosmoke_tests.txtso the PR CI gate runs it.scripts/CLAUDE.mdcoverage docs.Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
feature/pointmass-smbh-jax-ciWorktree root:
~/Code/PyAutoLabs-wt/pointmass-smbh-jax-ci/Work Classification: Workspace
Implementation Steps
scripts/misc/profiles_jit.py— extend the mass-profile list withmp.PointMass(centre=(0.01, 0.02), einstein_radius=0.1)andmp.SMBH(centre=(0.01, 0.02), mass=1e10); both grids, all three JAX steps.scripts/imaging/jax_likelihood/smbh.py— mirrorlp.py: auto-simjax_testdataset, mask, model with lensIsothermal+SMBH(massLogUniformPrior(1e8, 1e11), redshifts fixed 0.5/1.0) + Sersic source,Fitness+_vmapbatch with hardcoded expected literal, Path Ajax.jit(analysis.fit_from)round-trip vs numpy scalar.__Env__sectionENV: jax full_datasets.lp.pyfirst as a control to confirm the env reproduces its pinned literal (-1.34797827e09).imaging/jax_likelihood/smbh.pytosmoke_tests.txt.scripts/CLAUDE.md(jax_likelihood table + profiles_jit profile list).Key Files
scripts/misc/profiles_jit.pyscripts/imaging/jax_likelihood/smbh.py(new)smoke_tests.txtscripts/CLAUDE.mdOriginal Prompt
Click to expand starting prompt
Prompt file:
PyAutoMind/test/autolens_workspace_test/pointmass_smbh_jax_ci_coverage.mdMaintainer instruction: "ok yes do a CI exercise in autolens_workspace_test with JAX on these profiles as a quick follow up"