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
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