Skip to content

intake: unblock the lensing-of-lens workspace task, and file multi-plane cross-validation - #346

Merged
Jammy2211 merged 2 commits into
mainfrom
claude/point-source-json-regime-tmk7la
Aug 27, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
claude/point-source-json-regime-tmk7la

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two follow-ups to PyAutoLabs/PyAutoLens#712 (#480), which merged earlier today.

1. Unblocked an existing prompt (not a new filing)

draft/feature/workspaces/restore_multiple_sources_lensing_of_lens.md was already in the backlog, filed 2026-04-28 straight from #480's own text, so this updates it rather than filing a duplicate.

  • Marked UNBLOCKED — fix: repos_sync check mode never checks root AGENTS.md routing table / WORKFLOW owner map #480 shipped in PyAutoLens#712 (c1bba66), issue closed, pointing at complete/2026/08/point-solver-magnification-plane-redshift.md.
  • Difficulty: too-large → large — that rating carried the "first fix fix: repos_sync check mode never checks root AGENTS.md routing table / WORKFLOW owner map #480" leg, now done.
  • Gave it a title. The first line was a truncated URL sentence (# Once https://github.com/.../480 is fixed (PointSolver), so it rendered on the dashboard with no readable name.
  • Added step 7 — the no_run.yaml removal. The original six steps never mentioned it, yet it is the step that actually re-enables the example: both point_source/features/multiple_sources/{simulator,modeling} stay out of harness execution however good the code is until those entries go.
  • Cross-linked with draft/bug/pyautolens/point_source_json_datasets_record_no_regime.md, which is parked behind exactly that step.

The validation it asked for and never got

The prompt recorded real doubt about #480's diagnosis — "I'm a bit unsure I totally buy it, so do some explicit tests which more directly remove the mass profile but also edit the magnification_threshold setting". Both were run, and the doubt pointed at something real: the bug is configuration-dependent, and removing source_0's mass profile masks it.

Solving for source_0 at plane_redshift=1.0 on the #480 tracer:

source_0 µ at z=1.0 (correct) µ at z=2.0 (what the old code measured) old code's result
with mass (R_E=0.2) 27.9 9.06 23.1 16.0 7e-3 2e-3 1e-3 2e-3 all rejected → 0 images
without mass 27.9 9.06 23.1 16.0 1.86 1.54 2.38 2.56 survive → 4 images

Dropping the mass was not incidental to the workaround — it removes the very condition that triggers the bug. That is why the simplified example worked, and why step 1 restoring that mass is exactly what would have re-broken it before #712. µ at z=1.0 is identical in both rows: correct physics, since a deflector at plane j does not affect the mapping to plane j.

2. New prompt: cross-validate multi-plane ray tracing

draft/test/autolens/cross_validate_multi_plane_ray_tracing.md (large, high, Model: Fable).

Multi-plane ray tracing has no second opinion. Single-plane quantities do — test_isothermal.py::test__shear_yx_2d_from__matches_via_hessian pins the analytic closed form against the Richardson Hessian of the deflections, and its docstring says why: the two are wrong in different ways, so agreement is evidence where either alone is only self-consistency. traced_grid_2d_list_from and its scaling factors are tested only against themselves, or against literals the same code produced.

Motivated by both bugs this session surfaced in that machinery. #480 lived four months in a core path, and the ray-traced Jacobian that finally settled it — agreeing with float64 JAX autodiff to 1.8e-09 — was a one-off rather than a fixture. The control arm of that same check then exposed the Richardson-step bug, filed separately.

The prompt pairs the implementation against the published formalism rather than re-deriving from our source, names the one certain reference (inspirehep.net/literature/419263, which lens_calc.py already cites for its equations 55 and 60), and explicitly marks the remaining references as leads to verify rather than established citations. It also flags the convention trap up front: deflections_between_planes_from is scaled against the final plane, so truncating a tracer to planes ≤ j gives 1.86 where the answer is 27.9 — measured during #480, a convention mismatch rather than a bug, and exactly what the guide exists to document.

Ends as an @autolens_workspace guide routed through /workspace; library tests and guide likely split into two PRs, library first.

Test Plan

  • scripts/lifecycle.py check — OK after each change.
  • pyauto-brain intake dashboard --check — "dashboard.md + dashboard.html are current" (136 prompts).
  • Confirmed no duplicate prompt existed before updating (1) or filing (2).
  • (2) re-homed draft/test/autogalaxy/ → draft/test/autolens/: the classifier resolved PyAutoGalaxy first, but the multi-plane machinery is PyAutoLens's tracer_util.

Prompts and generated pages only; no code, no registry state changes.

James Nightingale and others added 2 commits August 27, 2026 15:00
No new prompt filed — this work was already in the backlog as
draft/feature/workspaces/restore_multiple_sources_lensing_of_lens.md (filed
2026-04-28 from PyAutoLens#480's own text). Filing a second one would have
duplicated it, so the existing prompt is updated instead.

- Marked UNBLOCKED: #480 shipped in PyAutoLens#712 (c1bba66), issue closed.
- Difficulty too-large -> large; that rating carried the "first fix #480" leg,
  which is done.
- Title replaced: the first line was a truncated URL sentence, so the prompt
  rendered on the dashboard with no readable name.
- Added step 7, the no_run.yaml removal. The original six steps never mentioned
  it, yet it is the step that actually re-enables the example — the scripts stay
  out of harness execution however good the code is until those two entries go.

Answers the validation the prompt asked for and never got. It recorded real
doubt about #480's diagnosis and asked for tests removing the mass profile and
varying magnification_threshold. Both were run, and the doubt pointed at
something real: the bug is configuration-dependent. With source_0's mass the
last-plane magnifications are ~1e-3 and every candidate is rejected (0 images);
without it they are ~2 and all four survive even under the old code. Removing
the mass profile masks the bug rather than being incidental to the workaround,
which is why the simplified example worked — and why step 1 restoring that mass
is exactly what would have re-broken it before #712.

Cross-linked with point_source_json_datasets_record_no_regime, which is parked
behind step 7, so neither prompt gets re-derived or duplicated later.

Dashboard regenerated; intake dashboard --check reports current.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0188mKnNzXptgLi1CUZ4H7NZ
…rmulations

Multi-plane ray tracing has no second opinion. Single-plane quantities do:
test_isothermal.py::test__shear_yx_2d_from__matches_via_hessian pins the analytic
closed form against the Richardson Hessian of the deflections, and its docstring
says why — the two are wrong in different ways, so agreement is evidence where
either alone is only self-consistency. traced_grid_2d_list_from and its scaling
factors are tested only against themselves or against literals the same code
produced.

Motivated by the two bugs this session surfaced in exactly that machinery:
PyAutoLens#480 lived four months in a core path, and the ray-traced Jacobian that
finally settled it (agreeing with float64 JAX autodiff to 1.8e-09) was a one-off,
not a fixture. The control arm of that same check then exposed the
Richardson-step bug filed separately.

Declares Model: Fable — the work is paper reading, derivation and narrative
prose, not mechanical edits — and pairs the implementation against the published
formalism rather than re-deriving from our source. Names the one certain
reference (inspirehep 419263, which lens_calc.py already cites for its equations
55 and 60) and marks the rest as leads to verify rather than established
citations.

Flags the convention trap up front: deflections_between_planes_from is scaled
against the final plane, so truncating a tracer to planes <= j gives 1.86 where
the answer is 27.9. Measured during #480 — a convention mismatch, not a bug, and
the kind of thing the guide exists to document.

Ends as an @autolens_workspace guide, routed through /workspace; library tests
and guide likely split into two PRs, library first.

Dashboard regenerated; intake dashboard --check reports current.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0188mKnNzXptgLi1CUZ4H7NZ
@Jammy2211 Jammy2211 changed the title intake: unblock the multiple_sources lensing-of-lens workspace task intake: unblock the lensing-of-lens workspace task, and file multi-plane cross-validation Aug 27, 2026
@Jammy2211
Jammy2211 merged commit 639cbf5 into main Aug 27, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the claude/point-source-json-regime-tmk7la branch August 27, 2026 15:05
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