Skip to content

prompt: re-home pynufft removal to maintenance, file two follow-ups - #265

Merged
Jammy2211 merged 2 commits into
mainfrom
claude/remove-pynufft-6uwt2z
Aug 22, 2026
Merged

prompt: re-home pynufft removal to maintenance, file two follow-ups#265
Jammy2211 merged 2 commits into
mainfrom
claude/remove-pynufft-6uwt2z

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Mind-state changes for the pynufft removal shipped in PyAutoArray#475, PyAutoGalaxy#583 and PyAutoLens#709.

Re-homed remove_pynufft_legacy_transformer.md from draft/refactor/autoarray/ to draft/maintenance/libraries/. The Brain Refactor Agent refused it under refactor/SUSPECT-API-CHANGE, effective autonomy human-required, "re-route: file under feature/ (API change implied); a refactor must be behaviour-preserving". Deleting a public class is not behaviour-preserving. maintenance/ ("dependency updates, hygiene, cleanup, small technical debt", per ROUTING.md) is the taxonomy fit for a dependency removal, better than the agent's suggested feature/, which is for new capability.

Rewrote it against what was actually measured, correcting two errors in the 2026-08-19 filing:

  • pynufft was never a base dependency — optional and dev extras only.
  • The import saving is ~10 ms, not ~230 ms. pynufft's 0.19 s cumulative import is ~95% scipy.sparse, which derivative_util.py:30 imports eagerly for csr_matrix regardless.

Settled the blocking Intel-macOS decision the prompt flagged: jaxlib's last x86_64 macOS wheel is 0.4.38 (2024-12-17), jaxlib has never shipped an sdist, and nufftax is pure-JAX — so Intel Macs keep TransformerDFT only. Accepted as a release-note line rather than a blocker.

Two new prompts:

  • draft/research/libraries/intel_macos_support_policy.md — the general platform question. One documented "NumPy-only path" turned out to be a JAX path in disguise, so others may be too; the current de-facto answer is "installs fine, fails at analysis time", which is the worst one.
  • draft/maintenance/libraries/defer_scipy_sparse_import.md — the real ~0.10 s import win the measurement uncovered, 10× the pynufft one.

Superseded draft/bug/autoarray/pynufft_scipy_pinv2_dev_extra.md — retiring the backend was one of its three sanctioned remedies. Confirmed its report on a clean Python 3.13 install: hasattr(scipy.linalg, "pinv2") is False under SciPy 1.17.1.

Dashboard regenerated via pyauto-brain intake --apply dashboard (148 prompts).

Test Plan

  • python3 scripts/lifecycle.py checklifecycle check: OK
  • dashboard.md / dashboard.html regenerated, not hand-edited
  • All three new/moved prompts appear in the dashboard with correct work-type and target routing

Generated by Claude Code

claude added 2 commits August 22, 2026 17:26
The Brain Refactor Agent refused the removal prompt under `refactor/`
(SUSPECT-API-CHANGE, human-required): deleting a public class is not
behaviour-preserving. Re-homed to `draft/maintenance/libraries/`, the
taxonomy fit for a dependency removal, and rewritten against what was
actually measured while implementing it.

Two corrections to the original filing:
- pynufft was never a base dependency; it sat in the `optional` and `dev`
  extras only.
- the import-time saving is ~10 ms, not ~230 ms. pynufft's 0.19 s
  cumulative import is ~95% `scipy.sparse`, which
  `derivative_util.py:30` imports eagerly regardless.

The Intel-macOS question the prompt flagged as blocking is settled and
recorded: jaxlib's last x86_64 macOS wheel is 0.4.38 (2024-12-17), there
has never been a jaxlib sdist, and nufftax is pure-JAX, so Intel Macs
keep TransformerDFT only. Accepted as a release-note line.

New prompts:
- `draft/research/libraries/intel_macos_support_policy.md` — the general
  platform question, since one "NumPy-only path" turned out to be a JAX
  path in disguise.
- `draft/maintenance/libraries/defer_scipy_sparse_import.md` — the real
  ~0.10 s import win the pynufft measurement uncovered.

Marks `draft/bug/autoarray/pynufft_scipy_pinv2_dev_extra.md` superseded:
retiring the backend was one of its three sanctioned remedies.
The pynufft removal's library tier is merged (PyAutoArray#475,
PyAutoGalaxy#583, PyAutoLens#709) and the workspace tier is raised
(autolens_workspace#497, autolens_workspace_test#261). Records the merge
order and the two open items the work surfaced but does not close:
`use_adjoint_scaling` is now a no-op on both remaining transformers, and
the `apply_sparse_operator` incompatibility's recorded cause was
pynufft-specific and is now unverified.

The scipy.sparse deferral prompt gets the same treatment its predecessor
needed: its own premise was wrong. `scipy.sparse` was never imported from
`derivative_util.py` — `scipy.spatial` pulls it in transitively, so
deferring csr_matrix alone achieved nothing. Deferring both gives
464.4 ms -> 183.7 ms, ~2.8x the estimate. Implemented in PyAutoArray#477.

The lesson, now hit twice and written down: a module's importtime
cumulative figure is not its exclusive cost.
@Jammy2211
Jammy2211 merged commit 656dc2e into main Aug 22, 2026
1 check passed
Jammy2211 pushed a commit that referenced this pull request Aug 24, 2026
Conflicts were the three generated files plus one genuine collision.

The collision: `delaunay_nan_probe_ell_comps_validator.md` was retired on both
sides — by this sweep as `delaunay-nan-probe-ell-comps-validator`, and on main
by the session that actually shipped the fix, as `delaunay-nan-probe-fix`.
Theirs is kept and mine is dropped: it is the owning session's ship record,
with the CI validation, the "the validator was right" finding and the probe's
new shape. The sweep's version only pointed at the evidence from outside.

The generated files (`complete/index.md`, `dashboard.md`, `dashboard.html`)
were resolved by regenerating from the merged source of truth, not by hand:

  python3 scripts/lifecycle.py index --apply
  pyauto-brain intake --apply dashboard

Rendered against PyAutoBrain main at 9063997 (#265 merged), so `intake
dashboard --check` agrees with what CI will produce.

Main had also retired `jax_point_source_point_smoke_sentinel.md` and
`point_jax_vmap_parity_nondeterministic.md` — both merged cleanly, and both
were prompts this sweep had inspected and deliberately left in the backlog.
Backlog 144 -> 142.

lifecycle check / index --check / orphans and registry_toc --check all OK.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NcL3NFXVPW4xipE8wJfjSx
Jammy2211 pushed a commit that referenced this pull request Aug 24, 2026
The Dashboard Refresh check failed on the merge commit even though the pages
had just been regenerated. Cause: this session's PyAutoBrain checkout was 37
commits behind origin/main, so every render used a stale renderer AND a stale
config/policy.yaml. The dashboard census classifies prompts through
repo_aliases, which PyAutoBrain#268/#271 changed, and the renderer itself
gained the freshness banner and refresh block in #265 -- so CI, which runs the
renderer from PyAutoBrain main, correctly saw the committed pages as stale.

Fast-forwarded the Brain checkout to origin/main and re-ran
`intake dashboard --apply`. `dashboard --check` now reports the pages current
against the same renderer CI uses.

lifecycle check OK, index --check OK, repos_sync --check 0 mismatches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MPhEXMoPYa7H1sNHWR2GNW
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.

2 participants