Repository navigation
Description
Overview
PyAutoArray#671 found two gradient defects. (a) A border-relocator tie bug: under jit the reverse-mode gradient of the ellipse semi-axis came out 2× / 0.5× whenever the lens sits on the mask's symmetry centre with border relocation on, for any pixelized mesh. It is fixed in PyAutoArray#672, pending release. (b) An evaluation-point artefact: on odd grids at pixelization over-sampling 1, a grid point sits exactly on the Isothermal centre at the prior medians. This task assesses which of the 73 likelihood-lifecycle gradient cells (results/**/gradient.json) these affected and whether any FD verdict flips. Requested by the human, 2026-11-02.
Plan
- Classify all 73 cells against defects (a) and (b) from each cell's own config. Cells without a pixelized source (MGE, point source, cluster, weak) are unaffected by construction.
- Measure the affected cells:
value_and_gradwith PyAutoArray before and after #672. The fix leaves values bit-identical, so the stored FD numbers stay valid and only the autodiff directional derivatives are recomputed and compared. Small cells run locally; big cells go on RAL only with a human go, on a private checkout. - Write up a research note (per-cell table, Δg, verdict flips, re-run list) in
wiki/research/and post a summary here. - Add a short PyAutoPulse knowledge entry on the symmetric-evaluation-point caveat.
- Tier: judge. Merge mode: human
/prm.
Detailed implementation plan
Affected Repositories
- autolens_profiling (primary): wiki research note + index link
- PyAutoPulse: knowledge entry
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./lens/autolens_profiling | main (0278253) | clean |
| ./organs/PyAutoPulse | main | untracked tmp/ only |
Suggested branch: feature/gradient-campaign-impact
Implementation Steps
- Classifier (scratch
Science/scratch/gradient_campaign_impact_2026-11-02/): per cell, rebuild the dataset, mask, model and instance via the cell's runtime config. Record the mesh,use_border_relocator, centre vs mask origin at the evaluation point, exact ± border ties (max(|y′|)gap), grid parity, pixelization over-sampling, and whether a grid point sits on the mass centre. - A/B: the cell's fused likelihood under PyAutoArray
d7b642e2^vsd7b642e2(temporary checkouts). Compute directional derivatives along the stored FD directions and compare with the storedfdentries. CPU fp64, constant folding disabled. - RAL leg for cells over 15 GB: a one-off array on a private checkout, partition
ral, explicit human go. wiki/research/gradient_campaign_impact_border_tie.md+wiki/index.md; PyAutoPulse knowledge entry; summary comment; re-run recommendation after #672 is released.
Key Files
results/**/gradient.json: stored witness records (point, fd directions, analytic, rel_error)scripts/misc/gradient/harness.py: seeded FD directionsscripts/*/*/likelihood_runtime.py: cell construction
Original Prompt
Click to expand starting prompt
Assess how PyAutoArray#671's two gradient defects affected the likelihood-lifecycle / PyAutoPulse gradient campaign verdicts
Type: research
Target: autolens_profiling
Repos:
- autolens_profiling
Themes: - jax-gradient
Difficulty: medium
Autonomy: supervised
Priority: high
Status: formalised
Consequence: judge
Witness: a table over every campaigngradient.json(v2 standard legs RAL 413791-413830 + p6 fiducial legs) marking each cell affected / unaffected by (a) the border-relocator tie bug and (b) the centre-on-grid Isothermal core, with the reasoning per cell family, plus a re-run list (cells whose fd.status verdict could flip) — posted on autolens_profiling#509 and the Pulse gradient knowledge entry
Review-minutes: 10
Unattended: never
Filed: 2026-11-02
Human request (2026-11-02, during PyAutoArray#671): "when active work on this task is done we need to assess if this issue has impacted the PyAutoPulse gradient campaign in general."
The two defects (record: complete/2026/11/rectangular-gradient-rtu-sparse.md)
- Border-relocator tie gradient (library bug, FIXED in PyAutoArray#672, pending release).
ellipse_params_via_border_pca_fromtookb = max(|y'|). A lens centred on the mask's symmetry centre traces the border into exact +/- pairs, so the maximum is an exact tie. JAX's tie-sharingmaxgradient is unstable underjitreverse mode: the gradient ofbcame out 2x / 0.5x. Eager mode was correct. Affects every jitted pixelized-source gradient withuse_border_relocator=Trueevaluated with the lens on the mask's symmetry centre (prior medians typically are), for any mesh (rectangular, Delaunay, ...). It produced a 2–5% autodiff-vs-FD error on mass/shear in the repro. - Centre-on-grid Isothermal core (evaluation-point artefact, not a library bug). On odd grids (HST 141x141) at pixelization over-sampling 1, one source-grid point sits exactly at the mass centre at prior medians; the
psisoftening (1e-8 core) gives d(deflection)/d(centre) ~1e8. This gave |g| ~2e9 on the imaging/rectangular/hst fiducial. The evaluation-point fix belongs to autolens_profiling#509 (p6c).
Questions
- Which campaign cells were evaluated at a symmetric point (centre at the mask's symmetry centre) with the border relocator on? Their fd verdicts may be wrong, either way.
- Which odd-grid instruments at os_pix=1 were evaluated with the centre on a grid point?
- Do the Delaunay "no_plateau" / mismatch verdicts (Science/scratch/delaunay_hilbert_2026-11-01/README.md) change once PyAutoArray#672 is in the RAL checkout?
- Re-run plan: which cells, which library pin (#672 needs a release or a private RAL checkout per [[RALpullMains]]).
Activity
Jammy2211 commentedon Nov 2, 2026
Result: no campaign verdict was affected by PyAutoArray#671
PRs: #516 (research note) and PyAutoLabs/PyAutoPulse#89 (knowledge page). Tier judge, so human
/prm.--standard-sizeand is evaluated at iid draw 0 of the seeded production sequence (imaging mass centre (0.00085, −0.00035)″). It sits neither on the mask's symmetry centre nor on a grid point, so neither defect can trigger.interferometer/rectangular/smagives a bit-identical gradient with PyAutoArray before and after #672 (largest relative change 2.4e-16), and it reproduces the stored record.Remaining disagreements, none from #671:
interferometer/mge/sma.Side finding: every standard driver except group/multi-galaxy records
"point": "prior_medians"while evaluating at iid draw 0. Filed as a follow-up in PyAutoMind, together with the unexplained gradient gaps.Jammy2211 commentedon Nov 2, 2026
Shipped
wiki/research/gradient_campaign_impact_border_tie.md.knowledge/gradient_witness_evaluation_point.md.pointlabel fix (draft/bug/autolens_profiling/gradient_json_point_label_standard_cells.md) and the unexplained gradient gaps (draft/research/autolens_profiling/unexplained_gradient_gaps_cpu_sparse_delaunay_and_mge.md).