Skip to content

mind: retire defer-scipy-sparse-import — shipped as PyAutoArray#477 - #324

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/defer-scipy-sparse-import-f0ixm8
Aug 25, 2026
Merged

mind: retire defer-scipy-sparse-import — shipped as PyAutoArray#477#324
Jammy2211 merged 1 commit into
mainfrom
claude/defer-scipy-sparse-import-f0ixm8

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Picked draft/maintenance/libraries/defer_scipy_sparse_import.md off the dashboard with /start_dev. The work was already merged, so no development happened — this is the completion record it should have got on 2026-08-22.

Evidence it shipped

  • PyAutoArray#477 is merged91d8b97 "Defer the eager scipy.sparse and scipy.spatial imports (~280 ms)", merged as 6bbde1a from claude/defer-scipy-sparse-import.
  • The acceptance criteria hold on PyAutoArray@main — verified against a fresh read-only checkout: no module-scope scipy.sparse or scipy.spatial import survives anywhere in autoarray/; every reference is function-local.
  • Mind's own history79d057ce (2026-08-22) wrote the correction into the prompt the day it shipped.

Result on the record: import autoarray 464.4 ms → 183.7 ms (medians of 15 runs, Python 3.13, dev extras) — a 281 ms saving. Suites green: autoarray 1179, autogalaxy 1103/1 skipped, autolens 532/1 skipped.

Why it was still pickable

The implementation recorded its own correction back into the prompt but left the file in draft/ with Status: in-flight. The 2026-08-24 reconciliation sweep (06d76dbb) touched this file to repoint a cross-reference and passed over it — in-flight reads as live work, not shipped work — so it kept rendering as backlog. That is the miss this PR closes.

What the record keeps

The prompt's premise was wrong in exactly the way its pynufft predecessor's was, so the record carries the correction rather than just the outcome:

  • scipy.sparse was never imported from derivative_util.py. scipy.spatial (134 ms) pulls it (154 ms) in transitively, so deferring csr_matrix alone achieved nothing and both had to go. A module's importtime cumulative figure is not its exclusive cost — now hit twice.
  • The prompt's multiprocessing warning did not apply: every use site is inside a function, so a plain local import suffices. _load_nufftax() needed its module-level cache only because unpickled Pool workers never re-run __init__.
  • delaunay.py had been left half-deferred (local imports at two of three use sites), which bought exactly zero — the surviving module-scope import kept the subtree on the path.

Changes

  • Added complete/2026/08/defer-scipy-sparse-import.md — the rich record, original prompt folded in.
  • Removed draft/maintenance/libraries/defer_scipy_sparse_import.md.
  • Repointed cross-references in remove-pynufft-legacy-transformer and pynufft_removal_downstream_residue, correcting their stale "~0.10 s" figure to the measured 281 ms.
  • Regenerated complete/index.md, dashboard.md, dashboard.html. Backlog 140 → 139.

lifecycle.py check, orphans and index --check all OK.


Generated by Claude Code

Picked off the dashboard with `/start_dev`; the work was already merged.
PyAutoArray#477 (`91d8b97`, merged `6bbde1a` from
`claude/defer-scipy-sparse-import`) landed it on 2026-08-22:
`import autoarray` 464.4 ms -> 183.7 ms, a 281 ms saving. Verified against
`PyAutoArray@main` — no module-scope `scipy.sparse` or `scipy.spatial` import
survives anywhere in `autoarray/`; every reference is function-local.

The implementation wrote its own correction back into the prompt the day it
shipped (79d057c) but left the file in `draft/` with `Status: in-flight`. The
2026-08-24 reconciliation sweep (06d76db) touched it to repoint a
cross-reference and passed over it — `in-flight` reads as live work, not
shipped work — so it kept rendering as pickable backlog. This is the record it
should have got.

The record keeps what the task actually taught, since the prompt's premise was
wrong in the same way its pynufft predecessor's was: `scipy.sparse` was never
imported from `derivative_util.py`. `scipy.spatial` (134 ms) pulls it (154 ms)
in transitively, so deferring `csr_matrix` alone achieved nothing and both had
to go. A module's `importtime` *cumulative* figure is not its *exclusive* cost.
Also recorded: the prompt's multiprocessing warning did not apply (every use
site is inside a function, so a plain local import suffices — `_load_nufftax`
needed its module-level cache only because unpickled Pool workers never re-run
`__init__`), and `delaunay.py` had been left half-deferred, which bought zero
because the surviving module-scope import kept the subtree on the path.

Cross-references in `remove-pynufft-legacy-transformer` and
`pynufft_removal_downstream_residue` repointed at the new record, and their
stale "~0.10 s" figure corrected to the measured 281 ms.

Backlog 140 -> 139. `lifecycle.py check`, `orphans` and `index --check` all OK;
dashboard regenerated.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WuqYkCFVVpaSxfq7GsMY8v
@Jammy2211
Jammy2211 merged commit a0e07d3 into main Aug 25, 2026
4 checks 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