Skip to content

test(searches): validate MultiStartAdam recovers truth basin under JAX#43

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/multi-start-gradient-search
Jul 14, 2026
Merged

test(searches): validate MultiStartAdam recovers truth basin under JAX#43
Jammy2211 merged 1 commit into
mainfrom
feature/multi-start-gradient-search

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

The JAX cross-backend end-to-end validation for the new af.MultiStartAdam search (PyAutoFit#1369, PR#1370 merged). Adds scripts/searches/MultiStartAdam.py, which runs the multi-start gradient MAP search on the 1D Gaussian dataset via the standard search.fit() API with a use_jax=True analysis, and asserts recovery of the known truth basin (centre/normalization/sigma = 50/25/10).

This is the remaining Phase-1 leg of the promotion. It lives here rather than in PyAutoFit's unit suite because library unit tests stay NumPy-only; the real JAX/optax path is exercised here.

Test Plan

  • python scripts/searches/MultiStartAdam.py → recovered centre=50.156, normalization=25.196, sigma=9.858; assertion passes (jax 0.10.2 + optax 0.2.5)

Notes

  • Mirrors the Nautilus_jax.py pattern (enable_pytrees() + register_model(), af.ex.Analysis(use_jax=True), NullPaths).
  • Not added to smoke_tests.txt — the *_jax search scripts are not part of the curated smoke subset.

Generated by the PyAutoLabs agent workflow.

Adds scripts/searches/MultiStartAdam.py — the JAX cross-backend end-to-end
validation for af.MultiStartAdam (PyAutoFit#1369), asserting truth-basin
recovery on the 1D Gaussian dataset (centre/normalization/sigma = 50/25/10)
via the standard search.fit() API with a use_jax=True analysis. Kept out of
PyAutoFit's NumPy-only unit suite by design.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 14, 2026
@Jammy2211
Jammy2211 merged commit 0a81c45 into main Jul 14, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/multi-start-gradient-search branch July 14, 2026 18:02
Jammy2211 added a commit that referenced this pull request Jul 15, 2026
The mode=release profile (env_vars_release.yaml) pins PYAUTO_DISABLE_JAX=1
alongside PYAUTO_TEST_MODE=0, so searches scripts really run but on the NumPy
backend. MultiStartAdam is JAX-native and hard-raises when the analysis is not
JAX-traceable, so it has failed the autofit_test/searches shard — and with it
nightly-release Stage 3 — every night since it landed in #43.

Add the missing `set: { PYAUTO_DISABLE_JAX: "0" }` overrides, following the
searches/BlackJAXNUTS precedent. Dynesty_jax and Nautilus_jax get the same
treatment: they declare use_jax=True but were also absent from the overrides,
so they were validating the NumPy path while presenting as JAX tests — passing
vacuously, since unlike MultiStartAdam they carry no backend guard.

Also stop the smoke profile bypassing MultiStartAdam. Its PYAUTO_TEST_MODE=2
skips the sampler before _fit runs, so the script passed without executing its
JAX path at all. Note what this does and does not gate: env_vars.yaml feeds
Heart's workspace-validation.yml at mode=smoke, which runs every script weekly
— NOT the per-PR gate, which is the curated smoke_tests.txt list containing
neither this script nor BlackJAXNUTS. So this buys a weekly net on the JAX
path, not a per-PR one. Running it costs ~6s.

Verified with JAX enabled: MultiStartAdam exit 0 (recovers 50.156/25.196/9.858
vs truth 50/25/10), Dynesty_jax exit 0, Nautilus_jax exit 0, and MultiStartAdam
under the smoke-resolved env exit 0. Env resolution driven through
autobuild.env_config.build_env_for_script over the real configs for every
scripts/searches/*.py: Nautilus.py and DynestyStatic/Dynamic.py correctly stay
at DISABLE_JAX=1, confirming the substring patterns do not over-match.

Closes #44

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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