Repository navigation
docs(timings): the unit-test + import-time bottleneck census (epic phase 9) - #214
Merged
Merged
Conversation
…ase 9) The unit/import half the legacy round left as a placeholder, beside it in `timings/`. A research verdict: no library source, test or workflow changed. CI truth for PyAutoNerves / PyAutoArray / PyAutoFit from the first ingested `unit-timings-<py>` artifacts (runs 34038040174, 34039841741, 34039848597); PyAutoGalaxy and PyAutoLens are labelled local throughout, because their first artifact is not ingested yet. What it found, each cited by run id or by a profile: - Ten PyAutoArray tests cost 24.8 s in CI and <=0.02 s locally: cold numba compilation, because `lib-tests.yml` restores none of the caches `smoke-tests.yml` already has. A local A/B with a persistent JAX compile cache takes the same suite 43 s -> 21 s. - `pytest --cov` costs +33 % (PyAutoArray) and +68 % (PyAutoFit) locally at identical pass counts. - One PyAutoGalaxy test is 52 % of that suite: `kaplinghat.py:217` called 2 186 457 times from the scalar `quad` lambda at `:258`. - Three imports are paid and not needed at import, each with its trigger line: `matplotlib.pyplot` 0.239 s via `potential_correction/visualize.py:19`, `scipy.special` 0.150 s via the module-level literal at `messages/normal.py:678`, `scipy.integrate` 0.178 s via `kaplinghat.py:5` — times 494 script processes a board round. - PyAutoFit cannot run under `-n auto` at all: parametrized ids embed a memory address (`test_prior_properties.py:63`). - Fixture cost is not a finding anywhere; `model.info` and `should_simulate` are confirmed fixed from the third side. Nine ranked options with impact, risk, validation route and the guard each must respect, and an explicit exclusion list: nothing that restructures a likelihood or a sampler for compile time, nothing upstream-JAX-bound, and the standing `no JAX in unit tests` rule kept. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
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.
Closes #213. Phase 9 of the
ci-timing-fast-testsepic (PyAutoMinddraft/feature/pyautoheart/ci_timing_fast_tests_epic.md) — the research verdict that closes the epic. One document,timings/unit_import_census_2026-09.md, beside the legacy digest; no library source, test or workflow changed anywhere.Sources
CI truth for three repos from the first ingested
unit-timings-<py>artifacts (the phase-8c PR runs): PyAutoNerves run 34038040174, PyAutoArray run 34039841741, PyAutoFit run 34039848597, both Python legs each;origin/main(2825c03, the heart-health run that ingested them) is merged in so the record and the document sit together. PyAutoGalaxy and PyAutoLens have no rows yet; every number for them is labelled local (one 4-core container, warm, serial--durations=0). Epochfast-tests @ 2026-09-06.The seven findings
lib-tests.ymlrestores no JAX cache and no numba cache;smoke-tests.ymlhas restored both since phase 7. Local A/B with a persistent JAX cache: PyAutoArray 43 s → 21 s.kaplinghat.py:217 _density_3d_from_radiuscalled 2,186,457 times from the scalarquadlambda at:258-263, for three grid points.matplotlib.pyplot0.239 s viaautolens/potential_correction/visualize.py:19;scipy.special0.150 s via the module-level literalautofit/messages/normal.py:678;scipy.integrate0.178 s viakaplinghat.py:5. A board round is 494 script processes, 232 importing autolens.-n auto: parametrized ids embed a memory address (test_prior_properties.py:63). The largest leg on the board is the only unparallelisable one.transformer.py:345): 3.49 s of a 4.84 s numpy-parity test isbackend_compile_and_load; theno JAX in unit testsrule is breached by the library, not the tests.model.info/replace_promiseandshould_simulateare confirmed fixed from the third side; 7 blackjax tests are 33.6 s of PyAutoFit's 157.5 s leg and invisible locally.Ranked options (§6, each with impact, risk, validation route and guard)
O1 caches for
lib-tests.yml· O2 deferscipy.specialout ofimport autofit· O3 defer pyplot out ofimport autolens· O4 vectorise the kaplinghat quadrature · O5 fix PyAutoFit's parametrized ids · O6 the--covpolicy question · O7 the NUFFT NumPy path (documentation half recommended) · O8 the 400,000-step scaler test · O9 the blackjax lane (settings only). §7 lists what the compile-time verdict excludes; §8 the gaps (no CI rows yet for Galaxy/Lens, blackjax absent locally, the ~1.8× CI/local factor on three repos only, no option trialled end-to-end).Each option the human accepts is filed as its own PyAutoMind prompt; nothing here changes source.
Test Plan
heart-tests.ymlunaffected (docs-only change undertimings/)🤖 Generated with Claude Code
https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
Generated by Claude Code