Skip to content

sampler_pipeline: promote searches as NonLinearSearch + posterior_kind (A4 companion) - #522

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/search-ext-a4-companions
Oct 14, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/search-ext-a4-companions

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Companion to PyAutoFit search-extensibility A4 (PyAutoLabs/PyAutoFit#1685, #1686, #1687, merged). Stage 3 of the sampler pipeline now tells a promoted search to subclass autofit.NonLinearSearch, declare posterior_kind / test_mode_budget, apply its kind's defaults from autofit.non_linear.search.posterior_kind (WEIGHTED.nested_initializer_for, POINT.clipper_for, CHAIN.auto_correlation_settings_for), set samples_cls, and implement run(ctx) + raw_samples_from. The family-base and old test-mode advice is gone. Text follows the "Companion changes required" section of PyAutoFit#1687, paraphrased so it no longer names the deprecated hooks.

Closes #520

Scripts Changed

  • skills/sampler_pipeline/reference.md — Stage 3 search.py / samples.py items rewritten for NonLinearSearch + posterior kinds

Upstream PR

PyAutoLabs/PyAutoFit#1687 (merged)

Companion PRs

Witness results

  • searches.ultranest.search, searches.pyswarms.globe, searches.pyswarms.local import cleanly under python -W error::FutureWarning (on main both warn: "subclasses AbstractNest/AbstractMLE, which is deprecated").
  • Construct + fit under -W error::FutureWarning: PySwarmsGlobal and PySwarmsLocal FIT OK at PYAUTO_TEST_MODE=1 and =2 (budget iters=1, ClipperNone, InitializerBall); UltraNest FIT OK at PYAUTO_TEST_MODE=2 (budget max_iters=1, max_ncalls=1, InitializerPrior). UltraNest at TEST_MODE=1 hits ImportError: numpy.core.multiarray failed to import from ultranest's compiled mlfriends extension; main fails identically (numpy ABI of the local ultranest build, not this change).
  • Search identifiers (output hash folders) identical on branch and main for PySwarmsGlobal, PySwarmsLocal and UltraNest.
  • autofit_workspace_test/scripts/graphical/analytic_gaussian.py with af.DynestyStatic(seed=): PARITY: PASS (41/41) (18/18 + 23/23), run twice, parity tables identical.
  • Brain skills/sampler_pipeline/reference.md no longer names a family base, apply_test_mode or is_test_mode.

Test Plan

  • pytest tests/ — 1258 passed
  • bin/check_skill_line_counts.sh — fails on main too (batch, prm, start_dev, create_issue over budget); sampler_pipeline not involved

Validation checklist (--auto run — plan was not pre-approved)

  • Effective level: safe (header: safe, cap: refactor → safe); Consequence: glance
  • Plan: on the issue (refactor: A4 companions — sampler reference, developer-tier searches, seeded Dynesty helper (search-extensibility) #520), unmodified since
  • Gate: tests PyAutoBrain pytest tests/ 1258 passed; autofit_workspace_test / autofit_workspace_developer have no test dir (n/a) · smoke autofit_workspace_test smoke_tests.txt 15/15 PASS on the branch (incl. graphical/analytic_gaussian.py); the six Heart workspaces are not downstream of these repos (no library change) · review CLEAN (independent review agent; every Witness claim basis-cited, UltraNest TEST_MODE=1 env caveat stated) · Heart STALE ("release validation incomplete: no rehearsal for current source")
  • Human: plan sound in hindsight?
  • Human: diff matches plan (no scope creep)?
  • Human: merge, amend, or reject — then log the outcome

🤖 Generated with Claude Code

Stage 3 now tells a new search to subclass autofit.NonLinearSearch,
declare posterior_kind / test_mode_budget, take its defaults from
posterior_kind.{CHAIN,WEIGHTED,POINT}, set samples_cls and implement
run(ctx) + raw_samples_from. The family bases and the old test-mode
hooks were deprecated in PyAutoFit A4 (#1685-#1687).

Closes #520

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

refactor: A4 companions — sampler reference, developer-tier searches, seeded Dynesty helper (search-extensibility)

1 participant