diff --git a/draft/bug/autogalaxy/nfw_truncated_potential_accuracy.md b/complete/2026/08/nfw-truncated-potential-accuracy.md similarity index 51% rename from draft/bug/autogalaxy/nfw_truncated_potential_accuracy.md rename to complete/2026/08/nfw-truncated-potential-accuracy.md index 0b971b9e..8fcd9f24 100644 --- a/draft/bug/autogalaxy/nfw_truncated_potential_accuracy.md +++ b/complete/2026/08/nfw-truncated-potential-accuracy.md @@ -1,3 +1,69 @@ +`NFWTruncatedSph.potential_2d_from` failed the `grad(psi)=alpha` finite-difference +self-consistency check at med 7.1e-2 (vs ~8e-4 for every other NFW/gNFW/cNFW +variant) — the MGE decomposition's sigma range (`radii_max = truncation_radius * 5`) +was the prime suspect. + +**Shipped:** [PyAutoGalaxy#564](https://github.com/PyAutoLabs/PyAutoGalaxy/pull/564), +merged 2026-08-09 (fixes PyAutoGalaxy#563). This ledger entry was reconciled +retroactively on 2026-08-19 — the fix shipped outside the prompt's dev flow, so the +draft prompt and `planned.md` entry had gone stale. + +## What shipped (and how it differed from the plan) + +The prompt's plan was to **widen/refine the MGE sigma range**. The shipped fix went +further: the MGE approximation was **replaced entirely** by the exact analytic +lensing potential — equation (18) of Baltz, Marshall & Oguri (2009) for the n=1 +smoothly truncated NFW — which the prompt's step 3 had flagged as a cross-check. +The analytic form became the implementation: + +- `potential_func_sph_from(grid_radius, tau, xp)` — dimensionless analytic BMO + potential, with a sixth-order small-radius series below `x = 1e-1` to avoid + catastrophic cancellation in NumPy/JAX float32, zero-centred per the paper's + convention. +- `NFWTruncatedSph.potential_2d_from` applies the `2 kappa_s r_s^2` normalisation. + +## Validation + +From the PR: 48 profile tests + 1054 full `test_autogalaxy/` pass; full-mode +200×200 workspace checks across three tNFW truncation regimes 9 PASS / 0 FAIL; +independent comparison against lenstronomy TNFW; JAX JIT/autodiff/float32, centre, +`x=1` and large-truncation checks. The unit tests the prompt asked for exist in +`test_autogalaxy/profiles/mass/dark/test_nfw_truncated.py`: +`test__potential_2d_from__gradient_matches_analytic_deflections` (rel 1e-6), +`__laplacian_matches_analytic_convergence` (rel 1e-5), an independent-implementation +match, and an NFW-limit comparison at large truncation radius. + +Independent re-verification on `main` (49115ad, 2026-08-19), finite-differencing +`grad(psi)` against `coord_func_m`-based deflections over r in [1e-3, 20] arcsec: + +| tau | median frac err | max | +|-----|-----------------|-----| +| 2.0 (defaults) | 1.4e-09 | 4.3e-07 | +| 10.0 | 2.2e-09 | 4.8e-07 | +| 0.5 | 1.2e-09 | 4.6e-07 | + +The med 7.1e-2 failure is gone — errors are now at the FD-scheme floor, ~5 orders +below the other profiles' MGE-limited ~8e-4. + +## Traps / lessons + +- **Analytic beat MGE re-tuning.** The prompt's "widen the sigma range" plan would + have kept an approximation where a closed form exists. When a profile has a + published analytic potential (BMO 2009 here), port it — the MGE path is for + profiles without one. +- **Ledger drift:** the fix merged 2026-08-09 but the prompt sat in `draft/` and + `planned.md` for ten more days, still surfacing on the dashboard as open + high-priority work. A fix shipped outside the prompt's own dev flow must + reconcile the Mind in the same breath. +- Related but distinct: the Isothermal Ell/Sph potential disagreement + (`planned.md` § `isothermal-ell-sph-oversampling-at-the-cusp`) was once guessed + to share this root cause — retracted; MGE is not involved there. +- `draft/feature/autogalaxy/piemass_potential.md` (PIEMass has *no* potential) is + the sibling task and remains open; the BMO-style analytic-port route used here + is the template for it. + +## Original prompt + # `NFWTruncatedSph.potential_2d_from`: MGE potential fails `grad(psi)=alpha` self-consistency Type: bug diff --git a/complete/index.md b/complete/index.md index cc7854d9..186512a0 100644 --- a/complete/index.md +++ b/complete/index.md @@ -6,7 +6,7 @@ Token-light navigation over the finished-work records (schema: only then grep a dated bucket. Curators: edit the band between the CURATED markers; everything below GENERATED is rebuilt. -1026 records across 7 buckets. +1027 records across 7 buckets. ## Highlights @@ -91,6 +91,7 @@ _(curate hard-won records here — survives regeneration.)_ - [multistart-gradient-resume-fom-sanity-check](2026/08/multistart-gradient-resume-fom-sanity-check.md) - [multistart-nan-step-diagnostics](2026/08/multistart-nan-step-diagnostics.md) - [nautilus-1core-serial-pool](2026/08/nautilus-1core-serial-pool.md) — corrective for the Heart RED "release validation FAILED (stage +- [nfw-truncated-potential-accuracy](2026/08/nfw-truncated-potential-accuracy.md) - [normalise-auto-simulate-guard-idiom](2026/08/normalise-auto-simulate-guard-idiom.md) - [notebook-setup-notebook-regen-drift](2026/08/notebook-setup-notebook-regen-drift.md) - [nss-remainline-mainline-blackjax](2026/08/nss-remainline-mainline-blackjax.md) diff --git a/dashboard.md b/dashboard.md index aafe8d97..4d16d6d0 100644 --- a/dashboard.md +++ b/dashboard.md @@ -1,6 +1,6 @@ # PyAutoMind task dashboard - + Every task the Mind is holding, on one page: what is in flight, what is parked, and the whole backlog to pick from. Pick a line, then run `/start_dev ` to start it. @@ -10,14 +10,14 @@ Tasks only — the organism's health lives with the Heart (`/health`), not here. |-------|------:| | [In flight](#in-flight) (`active/`) | 5 | | [Parked](#parked) (`parked.md`) | 3 | -| [Planned](#planned) (`planned.md`) | 7 | -| [Backlog](#backlog) (`draft/`) | 124 | +| [Planned](#planned) (`planned.md`) | 6 | +| [Backlog](#backlog) (`draft/`) | 123 | Live on GitHub: [open issues](https://github.com/search?q=org%3APyAutoLabs+is%3Aissue+is%3Aopen&type=issues) · [open pull requests](https://github.com/search?q=org%3APyAutoLabs+is%3Apr+is%3Aopen&type=prs) ## Start here -**Highest priority** (filed as `high`) — showing 12 of 24 +**Highest priority** (filed as `high`) — showing 12 of 23 - [TRIAGE: needs manual review before routing](draft/triage/jax_zero_contour.md) — medium · safe · high - [Decide whether the clipper belongs in the search identifier](draft/feature/autofit/clipper_in_search_identifier.md) — autofit · medium · human-required · high @@ -29,8 +29,8 @@ Live on GitHub: [open issues](https://github.com/search?q=org%3APyAutoLabs+is%3A - [Deep research: Can we speed up Delaunay in PyAutoArray?](draft/research/autoarray/delaunay_research.md) — autoarray · too-large · supervised · high - [EP hierarchical parent-scale collapse: cure the basin, or document the](draft/bug/autofit/ep_scale_collapse_basin_cure_or_caveat.md) — autofit · too-large · human-required · high - [Census of priors and messages — confirmed bugs + redesign](draft/research/autofit/priors_and_messages_math_audit.md) — autofit · too-large · supervised · high -- [`NFWTruncatedSph.potential_2d_from`: MGE potential fails `grad(psi)=alpha` self-consistency](draft/bug/autogalaxy/nfw_truncated_potential_accuracy.md) — autogalaxy · too-large · supervised · high - [`einstein_radius_jit_from`: replace static init_guess with a JAX-native seed finder](draft/refactor/autogalaxy/einstein_radius_jit_native_seed_finder.md) — autogalaxy · too-large · supervised · high +- [Investigate eager `FitImaging.figure_of_merit` vs JIT/step-by-step divergence in rectangular pixelization](draft/bug/autolens/pixelization_eager_vs_jit_divergence.md) — autolens · too-large · supervised · high **Quick wins** (small enough, and safe enough to run unattended) @@ -69,13 +69,12 @@ Started or scoped, not currently in flight — resume by moving the row back to Scoped but not started; some are not yet prompt files. Full detail in [`planned.md`](planned.md).
-7 task(s) +6 task(s) - **isothermal-ell-sph-oversampling-at-the-cusp** — planned — NOT yet a prompt file; file one via `/intake` before starting - **remote-mcp-deployment-tiers** — [issue #20](https://github.com/PyAutoLabs/autofit_assistant/issues/20) — DESIGN-COMPLETE, build BLOCKED-ON-DEMAND — issue #20 holds the full auth/transport/hosting design + Richard/PyAutoMCP… - **samples-parameter-paths** — [issue #1327](https://github.com/PyAutoLabs/PyAutoFit/issues/1327) — parked - **jax-point-source-point-smoke-sentinel** — planned -- **nfw-truncated-potential-accuracy** — planned - **piemass-potential** — planned - **latent-nan-guard-honest-run** @@ -83,13 +82,12 @@ Scoped but not started; some are not yet prompt files. Full detail in [`planned. ## Backlog -**124** filed prompts, not started. Each section is sorted most-pickable first (priority, then size). +**123** filed prompts, not started. Each section is sorted most-pickable first (priority, then size).
-bug — 32 +bug — 31 - [EP hierarchical parent-scale collapse: cure the basin, or document the](draft/bug/autofit/ep_scale_collapse_basin_cure_or_caveat.md) — autofit · too-large · human-required · high -- [`NFWTruncatedSph.potential_2d_from`: MGE potential fails `grad(psi)=alpha` self-consistency](draft/bug/autogalaxy/nfw_truncated_potential_accuracy.md) — autogalaxy · too-large · supervised · high - [Investigate eager `FitImaging.figure_of_merit` vs JIT/step-by-step divergence in rectangular pixelization](draft/bug/autolens/pixelization_eager_vs_jit_divergence.md) — autolens · too-large · supervised · high - [Fix Autofit release sampler and database regressions](draft/bug/health_fixes/autofit_sampler_database.md) — health_fixes · too-large · supervised · high - [Fix release JAX runtime compatibility and likelihood parity](draft/bug/health_fixes/jax_runtime_and_parity.md) — health_fixes · too-large · supervised · high diff --git a/planned.md b/planned.md index 2fe58dca..44c61837 100644 --- a/planned.md +++ b/planned.md @@ -68,23 +68,6 @@ Sibling smoke scripts to check while triaging: image_plane.py, source_plane.py in the same dir — they share the seed dataset. -## nfw-truncated-potential-accuracy -- prompt: draft/bug/autogalaxy/nfw_truncated_potential_accuracy.md -- status: planned -- filed: 2026-06-05 -- classification: library (accuracy bug) -- suggested-branch: feature/nfw-truncated-potential-accuracy -- summary: | - Pre-existing accuracy bug surfaced while shipping dark-matter-potentials. - NFWTruncatedSph.potential_2d_from (MGE) fails grad(psi)=alpha self- - consistency in autolens_workspace_test/scripts/mass/dark.py (med 7.1e-2 vs - ~8e-4 for every other NFW/gNFW/cNFW variant). Deflections pass, only the - potential is off — likely the MGE sigma range (radii_max = truncation_radius - * 5) is too narrow. Reproduce on clean main first. -- affected-repos: - - PyAutoGalaxy - - ## piemass-potential - prompt: draft/feature/autogalaxy/piemass_potential.md - status: planned