Skip to content

feat: add BlackJAXNUTS integration test script#23

Merged
Jammy2211 merged 1 commit intomainfrom
feature/blackjax-nuts-search
May 6, 2026
Merged

feat: add BlackJAXNUTS integration test script#23
Jammy2211 merged 1 commit intomainfrom
feature/blackjax-nuts-search

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

  • Adds scripts/searches/BlackJAXNUTS.py — integration test for af.BlackJAXNUTS on the standard 1D Gaussian dataset, mirroring the structure of Nautilus_jax.py.
  • Builds the analysis with use_jax=True, calls enable_pytrees() + register_model(model) so instance_from_vector JIT-traces, then runs af.BlackJAXNUTS(num_warmup=200, num_samples=500) and asserts on parameter recovery + diagnostic health.
  • Hard assertions guard against silent regressions: |recovered - truth| < 5 per param, ess_min > 50, n_divergent == 0.
  • Not added to smoke_tests.txt — that list is intentionally a small curated subset; this script is picked up by run_all_scripts.sh post-merge instead.

Library counterpart: PyAutoLabs/PyAutoFit#1256 (merged).
Workspace counterpart: PyAutoLabs/autofit_workspace#52.
Issue: PyAutoLabs/PyAutoFit#1255.

Test plan

  • python scripts/searches/BlackJAXNUTS.py — recovers (centre, normalization, sigma) close to (50, 25, 10), ESS > 100, 0 divergences. All asserts pass.

🤖 Generated with Claude Code

Mirrors `Nautilus_jax.py` — runs `af.BlackJAXNUTS` (shipped in PyAutoFit
#1256) on the standard 1D Gaussian dataset using the JAX-jitted
likelihood path. Validates that the gradient-based MCMC search executes
end-to-end with `use_jax=True`, recovers truth within tolerance, and
produces healthy NUTS diagnostics (positive ESS, zero divergences).

Hard assertions guard against silent regressions: parameter recovery
must land within ±5 of (50, 25, 10), ESS > 50, divergences == 0.

Not added to smoke_tests.txt — that list is intentionally a small
curated subset; this script is exercised by run_all_scripts.sh.

Refs PyAutoLabs/PyAutoFit#1255

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 6, 2026
@Jammy2211 Jammy2211 merged commit c6d3d3a into main May 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant