Skip to content

docs: multi_plane guide — Richardson section shows the adaptive-step fix - #624

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/multi-plane-richardson-guide-update
Nov 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/multi-plane-richardson-guide-update

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes #623

Summary

PyAutoGalaxy#591 / PR#593 made LensCalc._hessian_via_richardson adapt its step per point. With that fix released in autogalaxy 2026.11.7.1, the "A Warning: The NumPy Hessian Step Is Too Coarse Near A Compact Deflector" section of scripts/guides/advanced/multi_plane.py was out of date. It still said the defect was "not fixed".

What changed in the section, now titled "The NumPy Hessian Near A Compact Deflector: What Used To Fail":

  • The old fixed-step numbers [-0.00694, -0.00221, 0.00139, 0.00246] are quoted as history.
  • It explains the two termination rules: the tolerance rule (rtol = 1e-7) and the roundoff-floor stop.
  • It explains the UserWarning contract: only points that are genuinely singular warn, and nothing raises.
  • The live evaluation stays, and now also prints the max relative residual against autodiff and against the ray-traced Jacobian.
  • The "not fixed" sentence and the PyAutoMind bug-prompt pointer are gone; the section points at PyAutoGalaxy#593 instead.
  • notebooks/guides/advanced/multi_plane.ipynb is regenerated. Only the three cells for this section changed.

Witness evidence

These are live outputs against the installed autogalaxy 2026.11.7.1, which includes #593. The env is the one the runner resolves from profile_smoke.yaml plus ENV: jax full_datasets.

mu at z=2.0, LensCalc Richardson Hessian = [ 0.0450841   0.01098994 -0.08601921 -0.0111762 ]
mu at z=2.0, exact autodiff              = [ 0.0450841   0.01098994 -0.08601921 -0.01117619]
mu at z=2.0, ray-traced Jacobian         = [ 0.0450841   0.01098994 -0.08601921 -0.01117449]
max relative residual, Hessian vs autodiff   = 1.63e-07
max relative residual, Hessian vs ray-traced = 1.53e-04

No UserWarning was emitted; I ran with PYTHONWARNINGS=always.

Testing

  • Script: passes through the PyAutoHands runner (run_python.py autolens_workspace scripts --list <guides/advanced/multi_plane.py>): PASS (6.1s).
  • Notebook: run.py ... notebooks could not run locally because nbformat/nbconvert are not installed in this environment. Instead I ran every code cell of the regenerated notebook, in order, as one script under the same runner env. It exited 0 and printed the same numbers.
  • Size guard: scripts/check_sizes.sh reports OK.
  • How the notebook was regenerated: ipynb-py-convert was not available in this environment, so generate.py could not run. I ran the official add_notebook_quotes.py step and checked my cell splitting against the committed notebook: every cell matched apart from leading-blank-line whitespace in unchanged code cells. I then spliced the three changed cells into the existing notebook and wrote it with build_util.dump_notebook_like, so the metadata and Colab/Gemini cells are untouched. The next full generate.py run should produce no diff here, but it is worth confirming.

Tier: notify — merge mode: human /prm (batch 2026-11-08-am contract: ends at PR-open)


Generated by Claude Code

PyAutoGalaxy#593 made LensCalc's NumPy Hessian step adaptive, so the guide's
live evaluation on the PyAutoLens#480 fixture now agrees with the exact
autodiff and ray-traced oracles. Rewrite the former "not fixed" warning as
history plus mechanism: quote the old fixed-step numbers, explain the
tolerance / roundoff-floor termination rules and the singular-point-only
UserWarning contract, print residuals against both oracles, and drop the
bug-prompt pointer. Regenerate the notebook.

Closes #623

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NWt7fTXiKUjArRaF1
@Jammy2211
Jammy2211 merged commit a78405d into main Nov 8, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/multi-plane-richardson-guide-update branch November 8, 2026 14:13
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.

docs: multi_plane guide — Richardson section shows the adaptive-step fix

2 participants