Repository navigation
Description
Overview
A5 library half of the search-extensibility epic: every search onto run(ctx), the legacy _fit/pool surface deleted, and the new-search template with its witness. Depends on A4 (merged 2026-10-14).
Plan
- Migrate Emcee, Zeus, BFGS/LBFGS onto
run(ctx)(PR 1), then Dynesty/NUTS/SMC (PR 2), then MultiStart (PR 3), each gated by the A0a conformance suite, per-search tests and seeded byte-identity against main df6d218. - Close the framework (PR 4): delete the legacy
_fit/pool shims, add the unknown-kwarg warning andSettingsSearchvmap filter, shipsearch/_template/search.pywith a toy-search witness;FitLifecycleonly if the migrations prove it necessary (D22). - Hold every A4 invariant: identifiers,
hash_list, constructor sets, review-05/07 fixes, JAX fork rule, old-output loading. - Library only; consumers follow in
search_ext_a5_consumers.md.
Tier: judge — merge mode: human /prm
Detailed implementation plan (the Mind prompt, verbatim)
Suggested branch: feature/search-ext-a5-library
@PyAutoFit A5 (library): migrate every search onto run(ctx), delete the legacy _fit/pool surface, ship the new-search template
Type: refactor
Target: autofit
Repos:
- PyAutoFit
Difficulty: large
Autonomy: supervised
Priority: high
Status: formalised
Consequence: judge
Epic: search-extensibility
Phase: A5-library
Witness: no search outsideabstract_search.pyoverrides_fit(grepdef _fit(underautofit/non_linear/searchreturns only the base);make_pool,make_sneaky_pooland thenumber_of_coresshim are gone fromexecution.pyand nothing in PyAutoFit, PyAutoLens, PyAutoGalaxy, PyAutoCTI or the workspaces here references them; a toy search written fromautofit/non_linear/search/_template/search.pypasses both A0a conformance layers in ≤250 lines with the documented ~6 PyAutoFit touch points (search file, registry entry, export line, unit test, integration script, workspace section); the A0a golden identifier table is byte-identical for all 15 searches;Emcee(seed=1),DynestyStatic(seed=1)andNautilus(seed=1)fits producesamples.csvbyte-identical to the same fits on main df6d218 (A4 merge); the per-searchautofit_workspace_test/scripts/searches/<Name>.py(+_jax) scripts pass atPYAUTO_TEST_MODE=1and=2with the same pass set as main;pyauto-heart smoke autofit autolensclean.
Review-minutes: 45
Unattended: needs-slicing
Filed: 2026-10-14
Authority: epic report draft/research/autofit/search_extensibility_epic_report.md "#### A5", §3.5 (decomposition and the run(ctx) hook), §8.5 (D22: FitLifecycle only if the migrations show it is needed); search_extensibility_epic_surveys/01_search_architecture.md "Phase 5"; A1's frozen docs/design/run_ctx.md. A2 migrated Drawer and Nautilus, A3b NSS, A4 moved SMC to the weighted posterior kind and decomposed the base — do not redo those. This is the LIBRARY half of A5; the consumer half (Hands roster, assistants, Brain SamplerSurface, workspace CI anchors, al/ag guide collapse) is search_ext_a5_consumers.md, blocked on this.
Shape: ONE task, stacked PRs merged in order
- PR 1 — simple searches onto
run(ctx): Emcee, Zeus, BFGS/LBFGS. Each migration deletes the search's_fitoverride and implementsrun(ctx)againstFitContext(fitness, pool viaPoolFactory,start_points, resume state from itsCheckpointer,ctx.update). Per-search unit tests and the A0a suite gate each. - PR 2 — Dynesty (static, dynamic, pooled), BlackJAX NUTS and SMC the same way; Dynesty's
_sampler_kwargs()and the A4rstateprecedence stay. - PR 3 — MultiStart last; split its
_fitinternally regardless (survey 01 P5) and keep_seed_for+child_seedsemantics from A4. - PR 4 — framework close: delete the legacy
_fitsurface inexecution.py(make_pool,make_sneaky_pool,number_of_cores;SneakyPoolitself stays asPoolFactory.sneaky); unknown-kwarg guard (warn, never raise) for kwargs no__init__in the MRO consumes;SettingsSearchfiltersuse_jax_vmapto searches that accept it;search/_template/search.pywith the contract in its module docstring, plus the template smoke (a toy search built from it, kept as a test fixture, passes both A0a layers);docs/design/run_ctx.mdrevision note;docs/_generate_searches.py --checkclean. IntroduceFitLifecycleONLY if PRs 1–3 show duplicated lifecycle code that the mixins cannot host — say so in the PR body either way (D22).
Invariants every PR must hold
- The A0a golden table (
test_autofit/non_linear/search/conformance_roster.py),hash_list,to_dictand constructor-argument sets byte-identical to main for all 15 searches;samples_clspaths unchanged. - Seeded runs bit-identical before and after each migration (compare
samples.csvagainst main df6d218 for each migrated search withseed=1); unseeded runs keep fresh entropy. - The review-05 and review-07 fixes stay (old
Fitnesspickle semantics, preflight resolved settings,.completedafter the archive, pool close on success, old NUTS/SMC seed-42 identity, Dynestyrstateprecedence, gridchild_seed). - JAX fork rule: no search forks under a JAX analysis;
PoolFactoryis the only pool source after PR 4. - Old output folders (pre-A2, A4-era) still load through the Aggregator and resume; the disk-backed checks run in a writable environment and are quoted on the PR.
abstract_search.pystays ≤600 lines (test guards it).
Constraints
- Serial pytest (
-n autois broken on this suite); emulateunittest-nojaxwith the import-hook plugin (nojax_plugin the session scratchpad or rebuild it); Sphinx ≤30 warnings. - Prior/Message design (design: unify the Prior/Message hierarchy around a single-source density #1500) untouched. No consumer repos in this task.
- Each PR body lists "Companion changes required" for anything outside PyAutoFit (expected: none beyond the A5 consumers task; the developer-tier searches are handled by
search_ext_a4_companions.md).
Launched under --auto by the human 2026-10-14 (AUTONOMY.md decide-and-flag; ends at PR-open; merge stays human for tier judge, in-turn tiered merge for glance). Epic ledger: PyAutoMind draft/research/autofit/search_extensibility_epic.md.
Activity
Jammy2211 commentedon Oct 15, 2026
Shipped
Search-extensibility phase A5 (library) is merged as four stacked PRs:
run(ctx)run(ctx)run(ctx)contractsearch/_template/search.py(merge commit 3f4699b)All 15 searches now run through
run(ctx). Decisions recorded in the PR bodies: Zeus test-mode start points as a class attribute; Zeus and BFGS keep their own dill resume; Dynesty pool comes only fromPoolFactory; MultiStart loop state is a dict; theuse_jax_vmapwarning ignoresNone; noFitLifecycleabstraction.Follow-ups are filed in PyAutoMind: BFGS resume reading
x0from the scipy result, pre-existing workspacesearches/script failures, and the A5 consumers task (now unblocked). Merged, not yet released (pending-releaselabel).