Overview
A parked cluster of advanced-pipeline SLaM fit failures (2026-07-20 sweep), reproduced and scoped on clean main 2026-07-21 under PYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1. This task covers the pixelized-SLaM inversion / adapt-image cascade only. The multi-wavelength SersicCore alpha=0 failure proved unrelated and was split into a separate issue/prompt (bug/autogalaxy/sersic_core_alpha_zero_division.md).
Diagnosis
Two distinct signatures within the pixelized-SLaM cluster:
- double-Einstein-ring (imaging + group) —
AttributeError: 'NoneType' object has no attribute 'array' at PyAutoArray/.../inversion/mappers/abstract.py:476 (self.adapt_data.array), inside pixel_signals_from → adaptive-regularization weights. Occurs in phase source_pix[1]_source_1 (imaging slam.py:367, group slam.py:476). Confirmed same root cause in both scripts.
- imaging/features/pixelization/slam —
TypeError: add got incompatible shapes for broadcasting: (786, 786), (210, 210) at PyAutoArray/.../inversion/inversion/abstract.py:366 (curvature_matrix + regularization_matrix). A curvature/regularization size mismatch — needs phase-1 diagnosis (real pipeline bug vs synthetic-samples/test-mode artifact).
Root cause (double-ring — confirmed real, not a test-mode artifact)
The SLaM setup uses regularization_init = al.reg.Adapt (adaptive regularization → needs a per-galaxy adapt image). source_pix_1_source_1 pixelizes source_1, but its stitched galaxy_name_image_dict carries only lens + source_0. source_0 obtained its adapt image from an earlier light-profile phase; source_1 was only ever a bare redshift galaxy, so no adapt image can exist for it yet → AdaptImages yields no entry for source_1 → the source_1 mapper's adapt_data is None → crash.
Plan
- Phase 1 — diagnose: confirm the double-ring root cause end-to-end; diagnose the
pixelization/slam (786 vs 210) mismatch (same adapt/synthetic-samples gap, a real mesh-size mismatch, or test-mode-only?); determine whether any fix is library (PyAutoArray/PyAutoGalaxy) or workspace-only; reconcile the HowToLens target (the parent note's HowToLens features/ paths do not exist — HowToLens uses a chapter_N_* layout).
- Phase 2 — fix double-ring: seed
source_1 an adapt image (from the current tracer's lensed source-plane model image) for its first pixelized fit, so adaptive regularization has data to weight on. Re-run both double-ring scripts green in test mode.
- Phase 3 — fix pixelization/slam per the phase-1 verdict; update the HowToLens equivalent.
Detailed implementation plan
Affected Repositories
- autolens_workspace (primary)
- HowToLens (pixelization tutorial equivalent — real path TBD in phase 1)
- PyAutoLens / PyAutoArray / PyAutoGalaxy (only if phase-1 finds a library cause)
Work Classification
Workspace (primary) — with a possible library follow-up gated on phase-1 diagnosis of the pixelization/slam shape mismatch.
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./autolens_workspace |
main |
clean |
| ./HowToLens |
main |
clean |
| ./PyAutoLens |
main |
1 (unrelated: paper_jax/paper.md) |
| ./PyAutoGalaxy |
main |
clean |
| ./PyAutoArray |
main |
clean |
Suggested branch: feature/slam-adapt-inversion-cascade
Worktree root: ~/Code/PyAutoLabs-wt/slam-adapt-inversion-cascade/ (created later by /start_workspace)
Chosen fix direction (approved at scoping)
Seed source_1 an adapt image from the current tracer's lensed source model before its first pixelized fit. (Alternative rejected: bootstrap with Constant regularization then switch to Adapt.)
Reproduction
cd autolens_workspace
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib \
PYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1 PYAUTO_SKIP_FIT_OUTPUT=1 PYAUTO_SKIP_VISUALIZATION=1 PYAUTO_SKIP_CHECKS=1 PYAUTO_FAST_PLOTS=1 \
python scripts/imaging/features/advanced/double_einstein_ring/slam.py
Key Files
scripts/imaging/features/advanced/double_einstein_ring/slam.py — source_pix_1_source_1 (~line 286-367); stitched galaxy_name_image_dict lacks source_1.
scripts/group/features/advanced/double_einstein_ring/slam.py — same phase (~line 476).
scripts/imaging/features/pixelization/slam.py — curvature/regularization shape mismatch.
PyAutoGalaxy/autogalaxy/analysis/adapt_images/adapt_images.py — AdaptImages galaxy→image mapping (line ~327-335), galaxy_name_image_dict_via_result_from.
PyAutoArray/autoarray/inversion/mappers/abstract.py:476 — pixel_signals_from (adapt_data.array crash site).
Testing
Both double-ring scripts + pixelization/slam (+ HowToLens equivalent) must run green under the smoke env vars above. Regenerate notebooks after the workspace scripts pass.
Original Prompt
Click to expand starting prompt
Parked cluster of advanced-pipeline SLaM fit failures (2026-07-20 sweep). First step: reproduce imaging/features/advanced/double_einstein_ring/slam on clean main; confirm whether the failure is the synthetic-samples adapt_images gap (fixable in the SLaM pipeline / samples_summary construction) or downstream of the pixelization-inversion-not-PD cluster. Split multi-wavelength into a separate prompt if it proves unrelated (it did — SersicCore alpha=0 ZeroDivisionError, now bug/autogalaxy/sersic_core_alpha_zero_division.md).
Affected: autolens_workspace imaging/features/pixelization/slam, imaging/features/advanced/double_einstein_ring/slam, group/features/advanced/double_einstein_ring/slam; HowToLens pixelization tutorial equivalent.
Overview
A parked cluster of advanced-pipeline SLaM fit failures (2026-07-20 sweep), reproduced and scoped on clean
main2026-07-21 underPYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1. This task covers the pixelized-SLaM inversion / adapt-image cascade only. The multi-wavelengthSersicCore alpha=0failure proved unrelated and was split into a separate issue/prompt (bug/autogalaxy/sersic_core_alpha_zero_division.md).Diagnosis
Two distinct signatures within the pixelized-SLaM cluster:
AttributeError: 'NoneType' object has no attribute 'array'atPyAutoArray/.../inversion/mappers/abstract.py:476(self.adapt_data.array), insidepixel_signals_from→ adaptive-regularization weights. Occurs in phasesource_pix[1]_source_1(imagingslam.py:367, groupslam.py:476). Confirmed same root cause in both scripts.TypeError: add got incompatible shapes for broadcasting: (786, 786), (210, 210)atPyAutoArray/.../inversion/inversion/abstract.py:366(curvature_matrix + regularization_matrix). A curvature/regularization size mismatch — needs phase-1 diagnosis (real pipeline bug vs synthetic-samples/test-mode artifact).Root cause (double-ring — confirmed real, not a test-mode artifact)
The SLaM setup uses
regularization_init = al.reg.Adapt(adaptive regularization → needs a per-galaxy adapt image).source_pix_1_source_1pixelizessource_1, but its stitchedgalaxy_name_image_dictcarries onlylens+source_0.source_0obtained its adapt image from an earlier light-profile phase;source_1was only ever a bare redshift galaxy, so no adapt image can exist for it yet →AdaptImagesyields no entry for source_1 → the source_1 mapper'sadapt_dataisNone→ crash.Plan
pixelization/slam(786 vs 210) mismatch (same adapt/synthetic-samples gap, a real mesh-size mismatch, or test-mode-only?); determine whether any fix is library (PyAutoArray/PyAutoGalaxy) or workspace-only; reconcile the HowToLens target (the parent note's HowToLensfeatures/paths do not exist — HowToLens uses achapter_N_*layout).source_1an adapt image (from the current tracer's lensed source-plane model image) for its first pixelized fit, so adaptive regularization has data to weight on. Re-run both double-ring scripts green in test mode.Detailed implementation plan
Affected Repositories
Work Classification
Workspace (primary) — with a possible library follow-up gated on phase-1 diagnosis of the
pixelization/slamshape mismatch.Branch Survey
Suggested branch:
feature/slam-adapt-inversion-cascadeWorktree root:
~/Code/PyAutoLabs-wt/slam-adapt-inversion-cascade/(created later by/start_workspace)Chosen fix direction (approved at scoping)
Seed
source_1an adapt image from the current tracer's lensed source model before its first pixelized fit. (Alternative rejected: bootstrap withConstantregularization then switch toAdapt.)Reproduction
cd autolens_workspace NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib \ PYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1 PYAUTO_SKIP_FIT_OUTPUT=1 PYAUTO_SKIP_VISUALIZATION=1 PYAUTO_SKIP_CHECKS=1 PYAUTO_FAST_PLOTS=1 \ python scripts/imaging/features/advanced/double_einstein_ring/slam.pyKey Files
scripts/imaging/features/advanced/double_einstein_ring/slam.py—source_pix_1_source_1(~line 286-367); stitchedgalaxy_name_image_dictlackssource_1.scripts/group/features/advanced/double_einstein_ring/slam.py— same phase (~line 476).scripts/imaging/features/pixelization/slam.py— curvature/regularization shape mismatch.PyAutoGalaxy/autogalaxy/analysis/adapt_images/adapt_images.py—AdaptImagesgalaxy→image mapping (line ~327-335),galaxy_name_image_dict_via_result_from.PyAutoArray/autoarray/inversion/mappers/abstract.py:476—pixel_signals_from(adapt_data.arraycrash site).Testing
Both double-ring scripts +
pixelization/slam(+ HowToLens equivalent) must run green under the smoke env vars above. Regenerate notebooks after the workspace scripts pass.Original Prompt
Click to expand starting prompt
Parked cluster of advanced-pipeline SLaM fit failures (2026-07-20 sweep). First step: reproduce
imaging/features/advanced/double_einstein_ring/slamon clean main; confirm whether the failure is the synthetic-samples adapt_images gap (fixable in the SLaM pipeline / samples_summary construction) or downstream of the pixelization-inversion-not-PD cluster. Split multi-wavelength into a separate prompt if it proves unrelated (it did — SersicCore alpha=0 ZeroDivisionError, nowbug/autogalaxy/sersic_core_alpha_zero_division.md).Affected: autolens_workspace
imaging/features/pixelization/slam,imaging/features/advanced/double_einstein_ring/slam,group/features/advanced/double_einstein_ring/slam; HowToLens pixelization tutorial equivalent.