Skip to content

test: add the af.NSS searches integration script - #86

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/nss-searches-integration-test
Aug 18, 2026
Merged

test: add the af.NSS searches integration script#86
Jammy2211 merged 1 commit into
mainfrom
feature/nss-searches-integration-test

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Companion to PyAutoFit#1492 (the af.NSS re-mainlining on mainline blackjax ≥1.6) — restores integration coverage for the search in the scripts/searches/ suite, where every other first-class search already has a script and NSS was the gap.

What it covers

scripts/searches/NSS.py, mirroring the BlackJAXNUTS.py convention (same 1D Gaussian cell, use_jax=True, pytree registration, NullPaths in-memory run, ENV: real_search jax in-file tag):

  • Truth-recovery asserts on (centre, normalization, sigma) vs simulator truth (50, 25, 10).
  • Nested-sampling machinery asserts: finite log-evidence, positive Monte-Carlo error from the simulated-volume ensemble, eval counter populated, ESS floor.
  • A second fixed-seed run through the chunked GPU-memory path (chunk_size=7 < num_delete=25 — the _chunked_nss.py kernel recomposed for mainline in #1492) asserting bit-parity of the evidence with the unchunked run — the strongest integration check the chunked path can get.
  • num_mcmc_steps=6 follows the upstream ≥ max(5, 2·d) inner-steps guidance at d=3 (under-stepping biases logZ upward per the blackjax 1.6 docstring).

Validation (CPU, against the PyAutoFit#1492 branch)

  • Direct run: recovered (50.145, 25.223, 9.864); logZ −72.158 ± 0.422; 30,784 evals; ESS 417; chunked ≡ unchunked. All asserts pass.
  • PYAUTO_TEST_MODE=1 (the sweep's mode — loosens NSS's termination): recovered (50.150, 25.227, 9.858); logZ −72.164; 27,741 evals; chunked ≡ unchunked. All asserts pass.

Merge gate

⚠️ Merge after PyAutoFit#1492af.NSS does not exist on PyAutoFit main until then, so the full run_all_scripts.sh sweep would log this script as failing. Not added to the curated smoke_tests.txt (matches the BlackJAXNUTS.py / Nautilus_jax.py precedent of keeping the CI gate list minimal), so the PR-gating smoke run is unaffected either way.

🤖 Generated with Claude Code

https://claude.ai/code/session_018dV9h5h76hZ6trGZKWJFHe


Generated by Claude Code

Integration coverage for the re-mainlined af.NSS nested slice sampler
(mainline blackjax >=1.6): the standard 1D Gaussian cell with
use_jax=True, truth-recovery + finite-logZ + ensemble-error + ESS
asserts, and a second fixed-seed run through the chunked GPU-memory
path (chunk_size < num_delete) asserting bit-parity of the evidence
with the unchunked run.

Validated against the PyAutoFit#1492 branch on CPU: direct run
(logZ -72.158 +/- 0.422, evals 30,784, ESS 417) and PYAUTO_TEST_MODE=1
(logZ -72.164, evals 27,741) both pass all asserts, chunked identical
to unchunked in both modes. Not added to the curated smoke_tests.txt
(matches BlackJAXNUTS.py / Nautilus_jax.py precedent) — it runs in the
full run_all_scripts.sh sweep, and needs PyAutoFit#1492 merged first.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018dV9h5h76hZ6trGZKWJFHe
@Jammy2211
Jammy2211 merged commit 12da16d into main Aug 18, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/nss-searches-integration-test branch August 25, 2026 18:59
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.

2 participants