fix(jax-assertions): run multi_start_gradient_auto_convergence with a real search - #84
Merged
Conversation
… real search The script declared `ENV: jax`, which releases only PYAUTO_DISABLE_JAX, so profile_smoke's `PYAUTO_TEST_MODE: "2"` default still applied and the sampler was bypassed. `_fit_bypass_test_mode` builds samples_info from the bypass stub plus `_test_mode_samples_info()`, which AbstractMultiStartGradient does not override, so `total_steps` was never written and part A raised `KeyError: 'total_steps'` (PyAutoHeart run 30858578587, and 30790463134 before it — latent since the script was authored, not a regression). The bypass could never satisfy this script regardless: it asserts normalization ~= 25, and the prior median of LogUniformPrior(1e-2, 1e2) is 1.0. Declare `ENV: real_search jax`, matching searches/MultiStartAdam.py. Also drops the stale `af.` prefix from `af.AbstractMultiStartGradient` in the module docstring — that class is not exported on the `af` namespace, and the prefix trips the PyAuto API gate on any local run. Fixes #83 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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/jax_assertions/multi_start_gradient_auto_convergence.pyhas been failingthe workspace-smoke full-profile sweep with
KeyError: 'total_steps'(run 30858578587,
job
smoke / run_scripts (3.12, autofit_test, jax_assertions)).Not a library contract break. The script declared
ENV: jax, which releases onlyPYAUTO_DISABLE_JAX, soprofile_smoke.yaml'sPYAUTO_TEST_MODE: "2"defaultstill applied and the sampler was bypassed.
AbstractSearch._fit_bypass_test_modebuilds
samples_infofrom the bypass stub plus_test_mode_samples_info(), whichAbstractMultiStartGradientdoes not override (only BlackJAX NUTS does), sototal_stepswas never written and the part-A read raised.The bypass could not satisfy this script regardless: it asserts
normalization ≈ 25, and the prior median ofLogUniformPrior(1e-2, 1e2)is 1.0.This is a real-inference assertion script, so it now declares
ENV: real_search jax— matching its siblingsscripts/searches/MultiStartAdam.py,MultiStartProdigy.pyandBlackJAXNUTS.py.Latent, not a regression. The identical failure is in the prior sweep
(30790463134,
2026-08-03T06:33Z). Pre-migration,
profile_smoke.yamlgavejax_assertions/only
unset: [PYAUTO_DISABLE_JAX], so the #187/#189 declaration migration was agenuine no-op here — the script has been broken under the smoke profile since it
was authored. It is not in
smoke_tests.txt, so the per-PR gate was neveraffected; only the full-profile sweep runs it.
samples_via_internal_fromhas writtentotal_stepsintosamples_infosincethe original multi-start commit (
63cd4e222) and does so in released2026.7.29.2 — the library never changed, and no library change is needed here.
The
AbstractMultiStartGradient-vs-NUTS_test_mode_samples_infoasymmetry israised separately rather than patched over: a placeholder
total_stepswouldconvert a loud
KeyErrorinto a vacuous0 < 300pass followed by a confusingtruth-recovery failure.
Scripts Changed
scripts/jax_assertions/multi_start_gradient_auto_convergence.py—ENV: jax→ENV: real_search jax(with the rationale recorded in the__Env__section);dropped the stale
af.prefix fromaf.AbstractMultiStartGradientin the moduledocstring, since that class is not exported on the
afnamespace and the prefixtrips the PyAuto API gate on any local run.
Docstring-only diff — no executable code changed.
Test Plan
build_env_for_scriptresolves fromconfig/build/profile_smoke.yaml—EXIT=0in 10.0 s:Auto-convergence stopped after 158 / 300 steps. Recovered: centre=50.156, normalization=25.197, sigma=9.858 Resume path builds a byte-identical value_and_grad HLO (77848 chars) Results-DB round-trip OK: converged=True, stop_reason=converged, fom_history trace length 158 (ceiling 300).PYAUTO_TEST_MODEandPYAUTO_DISABLE_JAXafter the change (was
{'PYAUTO_TEST_MODE': '2', ...}before).validate_env_profiles.py --strict-derivation --strict-markers --strict-declarations— 0 errors, 0 warnings.scripts/jax_assertions/directory re-run, each script under its ownresolved env — 11/11 pass. (In that sweep this script took 3.3 s because
it resumed the prior run's output; the fresh-output timings are 10.0 s and
11.1 s across two independent clean-output runs, both
EXIT=0.)Closes #83
Generated by the PyAutoLabs agent workflow.