Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/wiki-currency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ jobs:
# Cone mode: directories only; root-level catalogue files are included
# automatically.
git -C sources/autofit_workspace sparse-checkout set scripts
# The search-roster generator (PyAutoHands): the roster blocks in skills/ and
# wiki/core/ are rendered from the installed release's search manifest and
# checked against it below. Cloned here so the PR-branch matching step
# pairs it with a not-yet-merged generator change.
git clone --quiet --depth 1 https://github.com/PyAutoLabs/PyAutoHands sources/PyAutoHands

# Paired-PR support (same trade-off as the Brain-ref hatch, PyAutoBrain#186):
# on PR events, any cited source repo with a branch matching this PR's head
Expand Down Expand Up @@ -150,6 +155,20 @@ jobs:
run "Provenance (--check-provenance)" --check-provenance
run "Citation paths (--check-citations)" --check-citations

# Generated search rosters vs the installed release's search manifest
# (python -m autofit search-manifest --json): a changed roster fails; a
# stamp-only difference after a release that added no search is a note.
echo "## Search roster (check_search_roster)" >> "$REPORT"
echo '```' >> "$REPORT"
rc=0
python sources/PyAutoHands/autohands/check_search_roster.py --root . >> "$REPORT" 2>&1 || rc=$?
echo '```' >> "$REPORT"
if [ "$rc" -ne 0 ]; then
echo "**FAILED** — \`check_search_roster\` exited $rc" >> "$REPORT"
fail=1
fi
echo >> "$REPORT"

cat "$REPORT" >> "$GITHUB_STEP_SUMMARY"
if [ "$fail" -ne 0 ]; then
echo "::error::wiki-currency drift detected — see the job summary / drift-report artifact."
Expand Down
23 changes: 17 additions & 6 deletions skills/af_configure_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,23 @@ distribution.

Every search class shares the same construction pattern: a `name`/`path_prefix` that
decides where output lands, `number_of_cores` for parallelisation, and per-sampler
settings (`PyAutoFit:autofit/non_linear/search/`). The installed roster (verify with
`dir(af)` — never from memory): `Nautilus`, `DynestyStatic`, `DynestyDynamic`, `NSS`
(nested); `Emcee`, `Zeus`, `BlackJAXNUTS`, `SMC` (MCMC); `LBFGS`, `BFGS`,
`MultiStartAdam`, `MultiStartADABelief`, `MultiStartLion`, `MultiStartProdigy`, `Drawer`
(MLE). `NSS`, `BlackJAXNUTS`, `SMC` and the `MultiStart*` searches are JAX-native and
need an analysis built with `use_jax=True`.
settings (`PyAutoFit:autofit/non_linear/search/`). The roster below is generated from the
installed release's search manifest (`python -m autofit search-manifest --json`) — regenerate
it with PyAutoHands `autohands regenerate_search_roster --root .`, never by hand, and still
verify against the installed stack with `dir(af)`, never from memory:

<!-- search-roster:begin style=list -->
<!-- search-manifest@1 autofit 2026.10.12.1 -->
- **Markov chain Monte Carlo** (`mcmc`): `af.Emcee`, `af.Zeus`, `af.BlackJAXNUTS`, `af.SMC` (experimental) — example: `autofit_workspace:scripts/searches/mcmc.py`
- **Nested sampling** (`nest`): `af.DynestyStatic`, `af.DynestyDynamic`, `af.Nautilus`, `af.NSS` (experimental) — example: `autofit_workspace:scripts/searches/nest.py`
- **Maximum likelihood / maximum a posteriori** (`mle`): `af.Drawer`, `af.BFGS`, `af.LBFGS`, `af.MultiStartAdam`, `af.MultiStartADABelief` (experimental), `af.MultiStartLion` (experimental), `af.MultiStartProdigy` — example: `autofit_workspace:scripts/searches/mle.py`
<!-- search-roster:end -->

`NSS`, `BlackJAXNUTS`, `SMC` and the `MultiStart*` searches are JAX-native and need an
analysis built with `use_jax=True`. Measured per-task behaviour on the toy-likelihood
benchmark is `autofit_inference:catalogue/search_catalogue.json` at commit
`3463aa19014b6bd83563018568f0fb4a2376f8eb` (protocol `gaussian_x3@1`): its wave 1 ranks
nothing, so read it as coverage and failure modes per task, never as a leaderboard.

Read `wiki/core/concepts/non_linear_search.md` for the decision guide; the worked
examples are `autofit_workspace:scripts/searches/nest.py`, `mcmc.py`, `mle.py`.
Expand Down
57 changes: 42 additions & 15 deletions wiki/core/concepts/non_linear_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ sources:
- project: PyAutoFit
paths:
- autofit/non_linear/search/
pinned_commit: 4592990b14cacab243cde9c17789d463ff4a674f
last_updated: 2026-07-10
content_sha256: 7d5ab270e029c8b829bac65f8918a8e397ba867c30f50723add04ef52314e0ca
pinned_commit: 3f4699b959e387b2eddca4508585c7812dc557be
last_updated: 2026-10-15
content_sha256: c56214e3dcb1c67d566bcf47d2cbec8bdef83890e8b4a434f8e1cd355073263b
---

# Non-linear searches
Expand All @@ -22,18 +22,45 @@ model/analysis code is identical whichever engine runs

## The installed roster

Verify against the installed stack (`dir(af)`), never from memory. At the pinned
version:

| Family | Search | One-line character |
|---|---|---|
| Nested | `af.Nautilus` | neural-network-boosted region sampler; recommended default — [[nested_sampling]] |
| Nested | `af.DynestyStatic` / `af.DynestyDynamic` | the long-standing pure-Python nested samplers |
| MCMC | `af.Emcee` | affine-invariant ensemble; dependable default MCMC — [[mcmc_and_hmc]] |
| MCMC | `af.Zeus` | ensemble slice sampling; often mixes faster on correlated posteriors |
| MCMC | `af.BlackJAXNUTS` | gradient-based NUTS; needs a JAX-differentiable likelihood |
| MLE | `af.LBFGS` | quasi-Newton maximum-likelihood — [[mle_and_optimizers]] |
| MLE | `af.Drawer` | draws from the priors; a sanity-check baseline |
Verify against the installed stack (`dir(af)`), never from memory. The table is generated
from the installed release's search manifest (`python -m autofit search-manifest --json`;
regenerate with PyAutoHands `autohands regenerate_search_roster --root .`, never by hand) —
one row per search, with the capabilities the search declares:

<!-- search-roster:begin style=table -->
<!-- search-manifest@1 autofit 2026.10.12.1 -->
| Search | Family | Status | JAX | Gradient | Evidence | Posterior | Example |
|---|---|---|---|---|---|---|---|
| `af.Emcee` | mcmc | stable | none | none | no | chain | `autofit_workspace:scripts/searches/mcmc.py` |
| `af.Zeus` | mcmc | stable | none | none | no | chain | `autofit_workspace:scripts/searches/mcmc.py` |
| `af.BlackJAXNUTS` | mcmc | stable | required | uses | no | chain | `autofit_workspace:scripts/searches/mcmc.py` |
| `af.SMC` | mcmc | experimental | required | uses | yes | weighted | — |
| `af.DynestyStatic` | nest | stable | optional | none | yes | weighted | `autofit_workspace:scripts/searches/nest.py` |
| `af.DynestyDynamic` | nest | stable | optional | none | yes | weighted | `autofit_workspace:scripts/searches/nest.py` |
| `af.Nautilus` | nest | stable | optional | none | yes | weighted | `autofit_workspace:scripts/searches/nest.py` |
| `af.NSS` | nest | experimental | required | none | yes | weighted | — |
| `af.Drawer` | mle | stable | none | none | no | point | `autofit_workspace:scripts/searches/mle.py` |
| `af.BFGS` | mle | stable | optional | none | no | point | — |
| `af.LBFGS` | mle | stable | optional | none | no | point | `autofit_workspace:scripts/searches/mle.py` |
| `af.MultiStartAdam` | mle | stable | required | uses | no | point | `autofit_workspace:scripts/searches/mle.py` |
| `af.MultiStartADABelief` | mle | experimental | required | uses | no | point | — |
| `af.MultiStartLion` | mle | experimental | required | uses | no | point | — |
| `af.MultiStartProdigy` | mle | stable | required | uses | no | point | — |
<!-- search-roster:end -->

`JAX: required` searches need an analysis built with `use_jax=True`; `experimental` ones
are new enough that their defaults may still move. The full capability matrix is
https://pyautofit.readthedocs.io/en/latest/searches/index.html.

Character, hand-written:

- `af.Nautilus` — neural-network-boosted region sampler; recommended default — [[nested_sampling]]
- `af.DynestyStatic` / `af.DynestyDynamic` — the long-standing pure-Python nested samplers
- `af.Emcee` — affine-invariant ensemble; dependable default MCMC — [[mcmc_and_hmc]]
- `af.Zeus` — ensemble slice sampling; often mixes faster on correlated posteriors
- `af.BlackJAXNUTS` — gradient-based NUTS; needs a JAX-differentiable likelihood
- `af.LBFGS` — quasi-Newton maximum-likelihood — [[mle_and_optimizers]]
- `af.Drawer` — draws from the priors; a sanity-check baseline

## Choosing

Expand Down
Loading