Skip to content

refactor: remove the NSS sampler and its cross-repo infrastructure #1356

Description

@Jammy2211

Overview

NSS (the JAX-native Nested Slice Sampler, af.NSS) was integrated as a first-class sampler, but it dragged a bespoke install/CI/build apparatus in with it: a [nss] extra whose real dependencies (handley-lab/blackjax fork + yallup/nss) can't be declared as git+ direct URLs in an uploaded wheel, a manual post-install step, a dedicated unittest_nss job and test-ignore in the release workflow, a Heart CI-status fixture, and a Required-by: nss arviz footgun. Measured performance never justified that complexity (mixed at best — faster per-eval on MGE but OOM-prone on pixelization/Delaunay via vmap fan-out), and the sampler can return later as a genuine PyPI package. This task removes NSS and all of its supporting infrastructure across six repos.

Plan

  • Delete the af.NSS sampler module, its tests, its [nss] extra, and the AGENTS.md footgun note from PyAutoFit (library root — this removes a public API).
  • Strip the NSS tutorial section from the autofit_workspace searches/nest example (script + regenerated notebook).
  • Remove NSS special-casing from PyAutoBuild's release workflow (the git+ direct-URL footgun guard, the separate unittest_nss job, the --ignore=…/nss test skip).
  • Remove NSS references from PyAutoHeart (the "nss install smoke" CI-status fixture and the release_validation doc).
  • Retire the NSS profiling runs in autolens_profiling (delete the searches/nss/ subtree, de-register it from the sweep/samplers), keeping the historical results/notes as evidence.
  • Annotate the PyAutoMind nss_first_class_sampler epic as retired and void its outstanding issued/nss_* follow-up prompts.
  • Phase into per-repo PRs, library-first (PyAutoFit merges before the workspace).
Detailed implementation plan

Affected Repositories

  • PyAutoFit (primary)
  • autofit_workspace
  • PyAutoBuild
  • PyAutoHeart
  • autolens_profiling
  • PyAutoMind

Branch Survey

Repository Current Branch Dirty?
./PyAutoFit main clean
./autofit_workspace main dirty (231 — build outputs; isolated by worktree)
./PyAutoBuild main clean
./PyAutoHeart main clean
./autolens_profiling main dirty (14 — profiling outputs; isolated by worktree)
./PyAutoMind tmp-land-navigator dirty (1 — this prompt)

Suggested branch: refactor/remove-nss-sampler

Implementation Steps

Phase 1 — PyAutoFit (library; gates the rest):

  1. git rm -r autofit/non_linear/search/nest/nss/ and test_autofit/non_linear/search/nest/nss/.
  2. autofit/__init__.py — remove from .non_linear.search.nest.nss.search import NSS.
  3. pyproject.toml — remove the [nss] comment block + nss = ["fastprogress<1.1"] extra (~lines 78–106). KEEP blackjax>=1.2.0 in [optional] (the NUTS search uses it).
  4. AGENTS.md — remove the [nss] footgun bullet; drop "NSS" from the nested-sampler subsystem list.
  5. Tests: full test_autofit/; because af.NSS is a public-API removal, leg-1 also runs PyAutoGalaxy + PyAutoLens suites (neither references NSS — expected green).

Phase 2 — autofit_workspace (user-facing tutorial; after Phase 1):

  1. scripts/searches/nest.py — remove the NSS intro paragraphs and the Search: NSS section (~lines 10–44 intro refs + 300–391); confirm the Dynesty/Nautilus examples still run standalone.
  2. Regenerate notebooks/searches/nest.ipynb from the edited script.
  3. Smoke: run the trimmed nest.py.

Phase 3 — PyAutoBuild (release CI):

  1. .github/workflows/release.yml — remove the [nss] git+ direct-URL footgun guard (~130–165), the separate unittest_nss job/handling, and the --ignore=test_autofit/non_linear/search/nest/nss skip (~250–256). No test dir → gate leg-1 n/a.

Phase 4 — PyAutoHeart:

  1. tests/test_ci_status.py — remove the "nss install smoke" fixture entry; adjust assertions.
  2. docs/release_validation.md — remove the [nss] wheel-blind-spot reference.
  3. Tests: PyAutoHeart suite.

Phase 5 — autolens_profiling (dev repo; doc-light):

  1. git rm -r searches/nss/ (9 files).
  2. searches/sweep.py — remove the 9 ("nss", …) tuples.
  3. searches/_samplers.py — remove the NSS-specific defaults; _setup.py/_runner.py — remove nss dispatch.
  4. Clean nss mentions in README.md, hpc/README.md, skills/profile_likelihood/reference.md. Keep results/notes (historical A100 evidence).

Phase 6 — PyAutoMind (registry housekeeping):

  1. Annotate z_features/complete/nss_first_class_sampler.md as retired/superseded.
  2. Mark the ~8 issued/nss_* prompts void (moot once NSS is gone).

Testing approach

Per-repo suites (PyAutoFit + downstream libs, PyAutoHeart), workspace smoke for nest.py, and a final grep -ri nss sweep across all six repos to confirm no dangling af.NSS references remain.

Key Files

  • PyAutoFit/autofit/non_linear/search/nest/nss/ — the sampler module (deleted)
  • PyAutoFit/autofit/__init__.pyaf.NSS export (removed)
  • PyAutoFit/pyproject.toml[nss] extra + git+ notes (removed)
  • PyAutoBuild/.github/workflows/release.yml — NSS install/test special-casing (removed)
  • PyAutoHeart/tests/test_ci_status.py, PyAutoHeart/docs/release_validation.md
  • autofit_workspace/scripts/searches/nest.py — NSS tutorial section (removed)
  • autolens_profiling/searches/nss/, searches/sweep.py, searches/_samplers.py

Autonomy

--auto, effective level SUPERVISED (refactor cap safe ∧ header supervised; a 6-repo public-API removal). Per-repo ship sign-offs are batched into a consolidated question on this issue; the run ends short of PR-open and merge stays human.

Original Prompt

Click to expand starting prompt

Refactor: remove the NSS nested sampler from PyAutoFit and retire all its supporting infrastructure across the organism. Delete the autofit/non_linear/search/nest/nss module, the af.NSS export, the [nss] git+ direct-URL extra in pyproject.toml, and its tests. Strip the NSS handling out of PyAutoBuild's release.yml (the git+ footgun guard, the separate unittest_nss job, the nss test-dir ignore) and remove the NSS references from PyAutoHeart (the nss install smoke CI fixture and release_validation docs). Sweep the autofit/autolens workspace examples and tutorials, retire the autolens_profiling NSS runs, and close out the PyAutoMind nss_first_class_sampler epic and its issued prompts. NSS performance never warranted this infrastructure cost and it can return as a genuine pip install later; we no longer support it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions