feat: add BlackJAXNUTS integration test script#23
Merged
Conversation
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>
This was referenced May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/searches/BlackJAXNUTS.py— integration test foraf.BlackJAXNUTSon the standard 1D Gaussian dataset, mirroring the structure ofNautilus_jax.py.use_jax=True, callsenable_pytrees()+register_model(model)soinstance_from_vectorJIT-traces, then runsaf.BlackJAXNUTS(num_warmup=200, num_samples=500)and asserts on parameter recovery + diagnostic health.|recovered - truth| < 5per param,ess_min > 50,n_divergent == 0.smoke_tests.txt— that list is intentionally a small curated subset; this script is picked up byrun_all_scripts.shpost-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