prompt: re-home pynufft removal to maintenance, file two follow-ups - #265
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mind-state changes for the pynufft removal shipped in PyAutoArray#475, PyAutoGalaxy#583 and PyAutoLens#709.
Re-homed
remove_pynufft_legacy_transformer.mdfromdraft/refactor/autoarray/todraft/maintenance/libraries/. The Brain Refactor Agent refused it underrefactor/—SUSPECT-API-CHANGE, effective autonomyhuman-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", perROUTING.md) is the taxonomy fit for a dependency removal, better than the agent's suggestedfeature/, which is for new capability.Rewrote it against what was actually measured, correcting two errors in the 2026-08-19 filing:
optionalanddevextras only.scipy.sparse, whichderivative_util.py:30imports eagerly forcsr_matrixregardless.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
TransformerDFTonly. 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")isFalseunder SciPy 1.17.1.Dashboard regenerated via
pyauto-brain intake --apply dashboard(148 prompts).Test Plan
python3 scripts/lifecycle.py check→lifecycle check: OKdashboard.md/dashboard.htmlregenerated, not hand-editedGenerated by Claude Code