Repository navigation
Description
Overview
Certify iterative δκ recovery (not just mechanics) for the visibility-space potential-correction engine al.pc.IterFitDpsiSrcInterferometer on a realistic uv configuration — the validation tier smoke-scale synthetics structurally cannot provide (their source meshes cannot reach χ²/dof ≈ 1, so corrections absorb source-model error). Bridges toward the Powell et al. 2025 / Vegetti et al. 2026 sensitivity regime. Follows the merged engineering of #623 (parent epic #618); cites Cao et al. 2025 throughout.
Plan
- Phase A — campaign harness (autolens_workspace_developer):
potential_correction_campaign/campaign_sdp81_uv.py— simulate an SIE + NFW-subhalo lens through the real SDP.81 ALMA uv coverage already on RAL (/mnt/ral/jnightin/autolens_jax_joss/dataset/interferometer/sdp81*, three visibility tiers), source pixelization sized so the smooth model reaches χ²/dof ≈ 1; run one-shotFitDpsiSrcInterferometerand iterativeIterFitDpsiSrcInterferometer(sparse route, arcdpsi_mask, gauge constraints,xp=jnpon GPU); metrics JSON (global + local δκ correlation, peak distance, evidence) + figures. Local validation on a uv subsample before dispatch. - Phase B — RAL/A100 runs: refresh the RAL PyAuto mirror (today's merges), dispatch detached (nohup+setsid+sentinel per RAL conventions; precision-operator cached to disk), sweep subhalo mass toward the ~10⁶–10⁸ M☉ regime as tiers allow.
- Phase C — results + docs: results writeup on this issue; add the interferometer section to
guides/advanced/potential_correction.py(autolens_workspace) using the certified configuration as exemplar; promote thresholds into a wst regression if a CI-affordable config emerges.
Detail
Affected Repositories
- autolens_workspace_developer (primary, phase A/B)
- autolens_workspace (phase C guide section)
Work Classification
Workspace (research campaign)
Suggested branch: feature/potential-correction-uv-campaign
Worktree root: ~/Code/PyAutoLabs-wt/potential-correction-uv-campaign/
Known traps (from #623)
WSL OOM ≥4k random vis at 64×64 — heavy configs on RAL only; uv beyond real-space Nyquist explodes χ²; global δκ correlation is sidelobe-limited — report local-window + peak metrics too; precision-operator computation scales with n_vis × mask (cache to disk); LAPACK-vs-XLA slogdet agreement is rtol≈1e-8 at these condition numbers.
Original Prompt
Prompt file: PyAutoMind/active/potential_correction_realistic_uv_campaign.md (from the user instruction: "do draft/research/autolens/potential_correction_realistic_uv_campaign.md — iterative δκ-recovery certification on a realistic uv configuration (B1938-like, or reusing the SDP.81 coverage already on RAL)... It's a compute campaign... likely with RAL/A100 in the loop.")
Activity
Jammy2211 commentedon Jul 17, 2026
Campaign started — configuration pivot (2026-07-17)
SDP.81 unavailable:
/mnt/ral/jnightin/autolens_jax_joss/dataset/interferometer/does not exist on RAL — prep job 330605's install step exited 1 although its done-sentinel fired (a script error-handling flaw; recovery belongs to the jax-joss task's resume notes, autolens_workspace#281). The campaign pivots to ALMA-like earth-rotation-synthesis uv coverage (Gaussian antenna configuration × hour-angle track → dense elliptical-ring sampling with honest sidelobes), which is fully configurable in scale and reproducible — arguably better for a controlled certification than a fixed observed coverage. The localsma.fitsreal coverage remains available as a cross-check, and SDP.81 can be swapped in later once the jax-joss prep is repaired.Harness landed (
autolens_workspace_developer/potential_correction_campaign/campaign_uv_recovery.py): three tiers (local ~1.1k vis / mid ~10k / full ~70k, RAL A100 with--use-jax), precision-operator disk caching, arc-restricteddpsi_mask, and — the key addition over the smoke tests — an explicit regime gate: the smooth-model source fit's χ²/dof is measured first and must sit near ~1–3 before recovery metrics mean anything (the smoke-scale failure mode was χ²/dof ≈ 4×10³). Metrics: global + local(1″) δκ correlation, peak distance, peak significance, evidence, for both the one-shot and iterative engines. Local-tier validation run in progress.Jammy2211 commentedon Jul 17, 2026
Local-tier results — the campaign's first science finding (2026-07-17)
Harness validated end-to-end on the local tier (1,224 synthesis visibilities, 72×72 @ 0.08″, regime gate χ²/dof = 3.56) with a δψ-regularization mini-sweep (Matérn52, c ∈ {2e3, 2e4, 2e5, 2e6}, s = 4):
Findings:
Phase B design (RAL + local follow-up): joint (source-coefficient × δψ-coefficient/scale) evidence-sampled optimization around the iterative engine (
IterDpsiSrcInvInterferometerAnalysiswith a search, or per-iteration re-optimization à la Koopmans/Vegetti — an engine enhancement worth considering), at the mid/full tiers where the added visibilities constrain the source more tightly. Harness pushed tofeature/potential-correction-uv-campaign(autolens_workspace_developer).Jammy2211 commentedon Jul 17, 2026
Engine enhancement validated — per-iteration evidence re-optimization (2026-07-17)
PyAutoLens#628 (
pending-release):IterFitDpsiSrcInterferometer(reg_optimize_every=N)— every N accepted LM iterations the regularization strength multipliers (a_src, a_δψ) are re-optimized by maximising the Laplace evidence at the fixed normal equations (one Cholesky per grid candidate ≈ free). This is the Koopmans 2005 / Vegetti & Koopmans 2009 objective control, targeting exactly the characterized failure mode.Local-tier validation:
reg_optimize_every=1The source-absorption degeneracy is broken by the evidence control, as the published methodology predicts. Remaining gap to the one-shot (0.83 / 0.14″) is expected to close with (a) more LM iterations + a finer re-optimization grid, and (b) the mid/full visibility tiers — both the RAL leg (
--use-jax; the sparse-operator FFTs are already JAX in every run). 439 tests pass; default engine behaviour unchanged.Jammy2211 commentedon Jul 17, 2026
Mid-tier results + two harness lessons (2026-07-17, session close)
Harness lessons (both fixed + pushed): (1) the regime gate demonstrably predicts iterative failure — at χ²/dof 29 the iterative failed exactly as forecast; noise retuned to 4.0 brings the gate to 3.19. (2) The precision-operator cache must be noise-keyed (
TᴴC⁻¹Tis noise-dependent); a stale cache silently poisons every evidence in the run.Mid tier (9,920 vis, gate 3.19), clean run:
reg_optimize_every=2Contrast with local tier where
reg_optimize_every=1lifted the iterative from 0.13 → 0.41 / 0.44″: the re-optimization schedule is the identified sensitivity (every-step control vs every-2-steps; the mid run also used n_iter=10 with re-opt resets consuming budget). Open questions for the next leg: ro=1 at mid tier, larger n_iter, finer re-opt grid, and whether the evidence-optimal per-step trajectory needs damping of the scale jumps (currently ±2 decades per re-opt).Session state: one-shot certification now stands at two tiers (local + mid, both in-regime, 6.2σ and 9.3σ); iterative certification stands at the local tier only. Next: the ro-schedule study at mid tier, then the full tier + mass sweep on RAL A100 (
--use-jax), then Phase C (workspace guide interferometer section from the certified config). Harness improvements all pushed to the campaign branch.Jammy2211 commentedon Jul 17, 2026
ro-schedule hypothesis refuted at mid tier (2026-07-17)
reg_optimize_every=1at the mid tier reproduces thero=2result exactly (corr 0.136 / peak 1.56″ / evidence −1.336e5 vs −1.335e5): the iterative converges deterministically to the same poor basin regardless of the evidence-control schedule. The local-tier certification (ro=1, corr 0.41) therefore reflects the basin structure at that configuration, not the schedule per se.Sharpened diagnosis: basin selection from the x = 0 cold start. At mid-tier resolution/noise the LM's early steps commit to a basin where δψ stays small before the corrections can engage; the evidence again self-protects (iterative −1.34e5 ≪ one-shot −5.74e4) but the optimizer never visits the recovering basin.
Queued next experiment — warm start: initialize the iterative state from the certified one-shot solution [s★ | δψ★] rather than zero. The one-shot is certified at both tiers (mid: 0.84 / 0.34″ / 9.3σ), so the LM then starts inside the right basin and its re-trace feedback refines rather than searches — this also mirrors the published pipelines, which linearize around progressively corrected models rather than cold-starting. One-line engine addition (
x0=parameter); high probability of closing the mid-tier iterative certification. Then: full tier + mass sweep (RAL A100--use-jax), Phase C guide section.Jammy2211 commentedon Jul 17, 2026
MID-TIER ITERATIVE CERTIFICATION ACHIEVED — via a formulation bug the warm start exposed (2026-07-17)
The warm-start experiment did more than close the certification — it exposed and fixed a real formulation bug in the interferometer LM objective (PyAutoLens#629,
pending-release):The bug: the normal-equation objective counted the state's δψ twice — once through the re-traced lens, once as the linear
G·δψmodel term in χ² and the gradient. From cold starts this is second-order small (why all previous runs converged plausibly); from a warm start at the certified one-shot solution the optimizer's best move under the inconsistent objective is to cancel the correction — the smoking gun was δκ corr −0.83 (strong anti-correlation). Fix: χ² + Gauss–Newton gradient use the source block only (residuald − T·f(ψ₀+δψ)·s,JᵀC⁻¹r = D − F·[s|0]), and the re-optimization's linear δψ output applies as an increment on the lens state. The imaging engine never had this bug (its kernels are residual-based).Certification (mid tier, 9,920 vis, gate 3.19):
Statistically identical recovery — the visibility-space iterative engine is now certified at the mid tier. The earlier "source-absorption" and "ro-schedule" observations are re-explained: they were downstream symptoms of the inconsistent objective.
Remaining: full tier (~70k vis) + subhalo-mass sweep on RAL A100 (
--use-jax) as the scale/sensitivity leg, and Phase C (workspace guide interferometer section from this certified configuration: warm-start from the one-shot + evidence control is the documented recipe, exactly as published pipelines linearize around progressively corrected models).Add x0 warm start to the imaging iterative engine (parity)
Jammy2211 commentedon Jul 17, 2026
Phase C shipped + engine parity (2026-07-17)
x0=warm start added to the imaging iterative engine for parity with the certified interferometer recipe. (To answer the natural question: the double-counting bug was interferometer-only — the imaging engine's kernels are residual-based, so its objective was always consistent; upstream Cao's iterative.py likewise.)guides/advanced/potential_correction.py— the certified recipe (sparse-operator route, arcdpsi_mask, one-shot inversion, iterative warm-started from the one-shot withreg_optimize_every=1, regime-gate guidance).Remaining on this issue: the full tier (~70k vis) + subhalo-mass sweep on RAL A100 (
--use-jax) — the scale/sensitivity leg toward the ~10⁶ M☉ regime — and PR-ing the campaign branch (autolens_workspace_developer) once that leg's results land.Jammy2211 commentedon Jul 17, 2026
Full-tier A100 results — subhalo-mass sweep (RAL job 330633)
Full tier: 70,200 visibilities (earth-rotation synthesis, 40 antennas x 90 hour-angle steps), 128x128 @ 0.05", noise 0.5, certified recipe (
--use-jax --reg-optimize 1 --warm-start), sparse (w-tilde) route throughout, JAX x64 on one A100.* The gate fits the smooth model, so its residuals include the subhalo's own imprint — at this depth a 1e10 perturber alone drives chi2/dof to ~200. At 1e9/1e8 the gate sits at ~1, confirming the source model is adequate and the recovery metrics are clean.
Findings
TransformerNUFFT(job 330629 failed on the DFT guard; fixed in the campaign branch).Results JSON + dkappa maps under
euclid_jump:/mnt/ral/jnightin/pc_campaign/results/full_m*/.Jammy2211 commentedon Jul 17, 2026
Campaign complete: one-shot + iterative certified at local/mid tiers, full-tier A100 mass sweep done (sensitivity floor between 1e8 and 1e9 Msun for this configuration; ~3 min/mass at 70k visibilities), certified recipe documented in the merged workspace feature example (autolens_workspace#286) and the campaign harness merged (autolens_workspace_developer#107). A VLBI-resolution configuration toward the ~1e6 Msun B1938 regime is the natural follow-up campaign if/when wanted. Closing.