Skip to content

fix(jax-assertions): run multi_start_gradient_auto_convergence with a real search - #84

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/multi-start-auto-convergence-real-search
Aug 4, 2026
Merged

fix(jax-assertions): run multi_start_gradient_auto_convergence with a real search#84
Jammy2211 merged 1 commit into
mainfrom
feature/multi-start-auto-convergence-real-search

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

scripts/jax_assertions/multi_start_gradient_auto_convergence.py has been failing
the 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 only
PYAUTO_DISABLE_JAX, so profile_smoke.yaml's PYAUTO_TEST_MODE: "2" default
still applied and the sampler was bypassed. AbstractSearch._fit_bypass_test_mode
builds samples_info from the bypass stub plus _test_mode_samples_info(), which
AbstractMultiStartGradient does not override (only BlackJAX NUTS does), so
total_steps was never written and the part-A read raised.

The bypass could not satisfy this script regardless: it asserts
normalization ≈ 25, and the prior median of LogUniformPrior(1e-2, 1e2) is 1.0.
This is a real-inference assertion script, so it now declares
ENV: real_search jax — matching its siblings scripts/searches/MultiStartAdam.py,
MultiStartProdigy.py and BlackJAXNUTS.py.

Latent, not a regression. The identical failure is in the prior sweep
(30790463134,
2026-08-03T06:33Z). Pre-migration, profile_smoke.yaml gave jax_assertions/
only unset: [PYAUTO_DISABLE_JAX], so the #187/#189 declaration migration was a
genuine 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 never
affected; only the full-profile sweep runs it.

samples_via_internal_from has written total_steps into samples_info since
the original multi-start commit (63cd4e222) and does so in released
2026.7.29.2 — the library never changed, and no library change is needed here.
The AbstractMultiStartGradient-vs-NUTS _test_mode_samples_info asymmetry is
raised separately rather than patched over: a placeholder total_steps would
convert a loud KeyError into a vacuous 0 < 300 pass followed by a confusing
truth-recovery failure.

Scripts Changed

  • scripts/jax_assertions/multi_start_gradient_auto_convergence.pyENV: jax
    ENV: real_search jax (with the rationale recorded in the __Env__ section);
    dropped the stale af. prefix from af.AbstractMultiStartGradient in the module
    docstring, since that class is not exported on the af namespace and the prefix
    trips the PyAuto API gate on any local run.

Docstring-only diff — no executable code changed.

Test Plan

  • Script passes under the env build_env_for_script resolves from
    config/build/profile_smoke.yamlEXIT=0 in 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).
  • Resolved env confirmed to release PYAUTO_TEST_MODE and PYAUTO_DISABLE_JAX
    after the change (was {'PYAUTO_TEST_MODE': '2', ...} before).
  • validate_env_profiles.py --strict-derivation --strict-markers --strict-declarations — 0 errors, 0 warnings.
  • Whole scripts/jax_assertions/ directory re-run, each script under its own
    resolved 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.

… 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>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Aug 4, 2026
@Jammy2211
Jammy2211 merged commit f4c45c1 into main Aug 4, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/multi-start-auto-convergence-real-search branch August 4, 2026 13:24
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.

fix(jax-assertions): run multi_start_gradient_auto_convergence with a real search

1 participant