From e85744821ca05e02fbdbed237aa3adfadb76c90c Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 8 Oct 2026 08:40:00 +0100 Subject: [PATCH] sampler_pipeline: autolens_inference boundary and a documentation stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Boundary, Stage 1b and Stage 2 point real-likelihood evidence and the mature findings tier at `autolens_inference` (the samplers faculty already does; `autolens_profiling` keeps per-evaluation likelihood cost). - Stage 3 drops the nonexistent `[nss]` extra example and the config-mirroring point: per-search YAML config was removed (PyAutoFit #1202), so search defaults are `__init__` kwargs only. - New "Stage 5 — documentation": the interim checklist of every surface that lists searches, taken from the search-extensibility survey's blast-radius list, so a promoted search ships documented. SKILL.md and the `--auto` promotion task now cite Stages 3–5. Refs PyAutoLabs/PyAutoFit#1668 (search-extensibility A0c part 1, item 11). Co-Authored-By: Claude Fable 5.1 --- skills/sampler_pipeline/SKILL.md | 15 ++--- skills/sampler_pipeline/reference.md | 85 ++++++++++++++++++++++++---- 2 files changed, 82 insertions(+), 18 deletions(-) diff --git a/skills/sampler_pipeline/SKILL.md b/skills/sampler_pipeline/SKILL.md index eaabb4d8..f2e5a7f2 100644 --- a/skills/sampler_pipeline/SKILL.md +++ b/skills/sampler_pipeline/SKILL.md @@ -70,7 +70,7 @@ The prototype contract (what makes its row comparable): - Benchmark honestly: no `pure_callback` under single-JIT (constant-folding), `vmap` for traced-input timings, compiled closures cached. - If the candidate targets real likelihoods (lensing MGE / pixelization / - interferometer), extend to `autolens_profiling` use-case runs before any + interferometer), extend to `autolens_inference` use-case runs before any promotion argument — the 1D Gaussian alone never justifies promotion. - Record durable findings in `PyAutoMemory/wiki/methods` (update `concepts/sampler-benchmarks.md`). @@ -84,11 +84,12 @@ comparable row · converged · concrete win · implementation cost justified). `NonLinearSearch` subclass under `autofit/non_linear/search///`, plus an integration script in `autofit_workspace_test/scripts/searches/` (and a `*_jax` variant when the - likelihood is jittable), run end-to-end before shipping. The full - six-point package anatomy (search.py, samples.py, `af.` export, dependency - extra + the PyPI git-URL gotcha, numpy-only unit tests, workspace config - mirroring) and the reference implementations to read first are in - [`reference.md`](reference.md) Stages 3–4. The prompt runs + likelihood is jittable), run end-to-end before shipping, plus the + documentation surfaces that list searches. The five-point package anatomy + (search.py, samples.py, `af.` export, dependency extra + the PyPI git-URL + gotcha, numpy-only unit tests), the reference implementations to read + first and the documentation checklist are in + [`reference.md`](reference.md) Stages 3–5. The prompt runs `start_dev → ship_library` as a normal library task — library source is edited inside that task's worktree, never ad hoc. - **Archive** → the prototype stays in `searches_minimal/` as the record; @@ -109,6 +110,6 @@ comparable row · converged · concrete win · implementation cost justified). an already-promoted search on a new likelihood class runs the separate **findings lane** (faculty AGENTS.md → "the maturation lane"): experiment in `autolens_workspace_developer/searches_minimal/` → mature first-class - cells + knowledge in `autolens_profiling` → user lessons in the + cells + knowledge in `autolens_inference` → user lessons in the `autolens_workspace` guides. Precedent: wsdev#117 (pixelized MultiStartProdigy). diff --git a/skills/sampler_pipeline/reference.md b/skills/sampler_pipeline/reference.md index 6cef48c9..960f5478 100644 --- a/skills/sampler_pipeline/reference.md +++ b/skills/sampler_pipeline/reference.md @@ -95,7 +95,7 @@ exercise on real lensing likelihoods — and cube → physical stays inside (the priors-jax-native work; without it a `pure_callback` hop costs ~18 ms/eval and erases the on-device advantage, per the HPC profiling findings). Owned-likelihood scripts live beside the Gaussian ones (or in -`autolens_profiling` for HPC-scale runs) — their numbers go in the +`autolens_inference` for HPC-scale runs) — their numbers go in the promotion argument, not in `comparison.txt`, which stays a same-problem table. @@ -110,9 +110,10 @@ table. (constant-folding fakes 20–30×); time through `vmap` with traced inputs; cache compiled closures. Full list: the faculty's AGENTS.md. - Real-likelihood evidence (required before any promotion argument): run - the candidate on lensing use cases via `autolens_profiling` — the - `/profile_likelihood` skill drives the sweep machinery; A100/HPC runs go - through that repo's conventions. + the candidate on lensing use cases via `autolens_inference` — its + `scripts//searches//.py` cells are the mature + tier; A100/HPC runs go through that repo's conventions. Per-evaluation + likelihood cost stays with the `/profile_likelihood` skill. - Record durable findings in `PyAutoMemory/wiki/methods/concepts/ sampler-benchmarks.md` (internal; never cited in public output). @@ -138,15 +139,10 @@ A new search package `autofit/non_linear/search///` needs: 4. **Dependency** — optional extra in `pyproject.toml`. Gotcha: PyPI rejects git-URL dependencies in uploaded wheels ("400 Can't have direct dependency") — fork-only deps get a manual-install comment in - `pyproject.toml` and a post-extras install step in the CI jobs (the - `[nss]` extra is the worked example). + `pyproject.toml` and a post-extras install step in the CI jobs. 5. **Unit tests** — `test_autofit/non_linear/search//test_.py`, **numpy-only** (library unit tests never import JAX; cross-backend checks live in workspace_test). -6. **Config surfaces** — if the search introduces new output/config keys, - mirror them into each workspace's config (workspace configs override - library defaults; a default-on key without the mirror fires warnings in - every consumer). This is a normal library task: Mind prompt via `/intake`, `start_dev`, worktree, plan, `ship_library`. @@ -170,6 +166,73 @@ cd autofit_workspace_test && python scripts/searches/.py scripts are deliberately **not** in the curated smoke lists — never grow `smoke_tests.txt` to exercise a sampler. +## Stage 5 — documentation + +A search is not promoted until the surfaces that list searches name it. No +registry generates these yet, so this is the interim checklist (library +first; generated files — notebooks, `llms-full.txt`, `workspace_index.json` +— regenerate via PyAutoHands and are never hand-edited). Skip a row only when +its condition does not apply. + +**PyAutoFit** +- `docs/api/searches.rst` entry and the committed + `docs/api/_autosummary/autofit..rst` stub +- `docs/cookbooks/search.md` — contents list and a section +- `docs/overview/natural_language.md` — family / JAX list +- `docs/installation/overview.md` — dependency list (new dependency only) +- `docs/general/citations.md`, `files/citations.bib`, `files/citations.md`, + `files/citation.tex` +- `AGENTS.md` package-map line + +**autofit_workspace** +- `scripts/searches/.py` section (smoke-tested) and + `scripts/searches/README.md` +- `scripts/cookbooks/search.py` — mirror of the RTD cookbook section +- `scripts/plot/_plotter.py` (search-specific plots only) +- `llms.txt`, `CITATIONS.md` + +**autofit_workspace_test / autofit_workspace_developer** +- the Stage 4 integration script(s) +- `searches_minimal/_simple.py` and its `output/comparison.txt` row + (the pre-promotion evidence, already written in Stage 2) + +**HowToFit** (new family or capability only) +- `scripts/chapter_1_introduction/tutorial_3_non_linear_search.py` and/or + `tutorial_6_gradients.py`; `CITATIONS.md` + +**Downstream libraries and workspaces** (kept in lockstep) +- `guides/modeling/searches.py` in autolens_workspace and + autogalaxy_workspace (plus `guides/plot/searches.py` when the search has + plots) +- `chapter_optional/tutorial_searches.py` in HowToLens and HowToGalaxy +- `docs/api/modeling.rst` in PyAutoLens, PyAutoGalaxy and PyAutoCTI +- `docs/general/citations.*` in PyAutoLens, PyAutoGalaxy and PyAutoCTI; + `CITATIONS.*` in PyAutoLens, PyAutoGalaxy, PyAutoCTI, autolens_workspace, + autogalaxy_workspace, HowToLens and HowToGalaxy +- `docs/installation/overview.*` in PyAutoGalaxy and PyAutoCTI (new + dependency only) + +**Assistants** +- autofit_assistant: `skills/af_configure_search.md`, + `wiki/core/concepts/non_linear_search.md` (roster table), the family page + under `wiki/core/concepts/`, `initialization_and_chaining.md` + (provider/consumer role), `wiki/core/stack/autofit.md` +- autolens_assistant: `skills/al_configure_search.md`, + `wiki/core/concepts/non_linear_search.md` +- autogalaxy_assistant: `skills/ag_configure_search.md`, + `wiki/core/concepts/non_linear_search.md` + +**Organs and galleries** +- the samplers faculty's `AGENTS.md` judgment tables +- `PyAutoMemory/wiki/methods/concepts/sampler-benchmarks.md` (internal) +- `autofit_visualization/scripts/samples/visualization.py` and its + regenerated manifest (search-specific plots only) + +Each repo's documentation edit ships through its normal workflow +(`ship_library` for the libraries, `ship_workspace` for the rest), library +first. Re-run `bin/pyauto-brain samplers` afterwards: the new class must no +longer appear in the tier gaps. + ## Running the pipeline under `--auto` "Point at a repo and go" maps onto the autonomy contract @@ -181,7 +244,7 @@ cd autofit_workspace_test && python scripts/searches/.py **promote-or-archive call is the one judgment gate**, posted as a batched question on the issue (checkpoint-and-continue), or pre-answered at launch ("if it converges and beats X on my likelihood, proceed"). -2. **Promotion task** (Stages 3–4; a normal `feature/autofit` library task): +2. **Promotion task** (Stages 3–5; a normal `feature/autofit` library task): runs `start_dev → ship_library` under the same contract — implementation proceeds, ship sign-off checkpoints, PR-open ends the run.