Skip to content

fix: report step count and stop reason in the multi-start search.summary - #1555

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/multistart-quick-update-49-steps
Sep 1, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/multistart-quick-update-49-steps

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #1553. A MultiStartProdigy start_here.py run was reported as "stopping at 49 steps because iterations_per_quick_update=50". Investigation (on the issue) shows the search cannot stop at a quick-update boundary: the multi-start step loop never reads the cadence (it is inert for this family — the EXEMPT entry in test_quick_update_wiring.py), and the only stop paths are the auto-convergence plateau (gated behind min_steps=100) and the n_steps ceiling. The "49" was search.summary's Total Samples = 49 line — 1 best + n_starts=48 per-start final points, a count fixed at construction — while the run's real length appeared nowhere in the summary.

This PR makes the summary state the run's actual length and pins the non-interaction:

  • search_summary_from_samples now labels the gradient searches' sample count with its composition (Total Samples = 49 (1 best + 48 per-start final points; not a step count)) — only where the arithmetic actually holds (reloaded samples arrive with the weight-0 per-start rows pruned, and n_starts sits outside the search identifier, so on those paths the count stays plain) — and reports Total Steps = N and Stop Reason = converged|max_steps beside it (Stop Reason omitted for legacy search_internal files that never recorded one).
  • New end-to-end regression test_multi_start_quick_update_termination.py: a MultiStartProdigy fit with a quick-update boundary (25) mid-budget (60, convergence explicitly off) runs every one of its 60 steps and stops on max_steps. It also asserts quick_update_count == 0 — the cadence's current inertness — as a tripwire: the change that wires real quick updates into the step loop must flip that assertion to "fired" rather than inherit a vacuously green test.

API Changes

None — internal. Three new/changed lines in the text of search.summary for the MultiStartGradient family only (no consumer parses that file; verified across autofit/, test_autofit/, workspace scripts). No public symbol added, removed, or changed.

Test Plan

  • pytest test_autofit/text/test_text_util.py test_autofit/non_linear/search/mle/ — passes (new: step-count/stop-reason lines, composition-mismatch path, legacy no-stop_reason path, e2e non-termination witness)
  • test_quick_update_wiring.py unchanged and green (the EXEMPT entry stays; wiring real quick updates is the sibling task)
  • Full library suite serially: only pre-existing environment failures in this container (dynesty API drift, missing optional viz deps), none touching this diff — CI's pinned matrix is authoritative
  • Witness reproduced at the reported configuration (n_starts=48, cadence 50, n_steps=120): run goes far past step 50; total_samples=49 confirmed as the misread number

Validation checklist (--auto run — plan was not pre-approved)

  • Effective level: safe (header: safe, cap: bug → safe)
  • Plan: on the issue (fix: MultiStartProdigy "stopped at 49 steps" is a summary misread, not a quick-update stop #1553), written at start, unmodified since
  • Gate: tests — targeted suites pass; full serial suite fails only on pre-existing env-pin breakage identical on origin/main (dynesty/scipy/optional-dep drift), none in touched code · smoke — n/a in this container; evidence: no workspace script or library code parses search.summary (grep) · review CLEAN — witness falsified-first: conjunct 1 reproduced at the reported configuration, conjunct 2 covered by the new e2e test with the inertness tripwire · Heart — YELLOW within the 2026-08-31-pm batch launch ack (manifest drift + CI measurement blindness in web container), recorded in the task's active.md
  • Independent adversary (leg 5, batch launch): run by a different model; first pass returned 2 findings (vacuously-green e2e test; composition label false on reload paths) — both fixed and re-reviewed CLEAN
  • Human: plan sound in hindsight?
  • Human: diff matches plan (no scope creep)?
  • Human: merge, amend, or reject — then log the outcome

Note for the batch review: autofit-multistart-iterations (the quick-update wiring task) touches the same seam — merge this first per the batch record's serial order; its wiring change must flip the new test's quick_update_count == 0 tripwire to a "fired" assertion.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RMc7X2QncxHM4GEC7b4K4P


Generated by Claude Code

A MultiStartProdigy start_here.py run was reported as "stopping at 49 steps
because iterations_per_quick_update=50". The search cannot stop at a
quick-update boundary — the multi-start step loop never reads the cadence,
and its only stop paths are the auto-convergence plateau (gated behind
min_steps=100) and the n_steps ceiling. The 49 was search.summary's
"Total Samples" line: 1 best + n_starts=48 per-start final points, a count
fixed at construction that carries no step information, yet the summary's
one prominent number — and the run's real length appeared nowhere.

Label the gradient searches' sample count with its composition — only where
the arithmetic actually holds: reloaded samples arrive with the weight-0
per-start rows pruned, and n_starts sits outside the search identifier, so
on those paths the label would be self-contradictory and the count stays
plain. Report Total Steps and Stop Reason beside it, and pin the
non-interaction with an end-to-end regression: a MultiStartProdigy fit
whose quick-update boundary falls mid-budget runs every one of its steps,
and the cadence's current inertness is asserted so the change that wires
real quick updates into the step loop must flip that assertion rather than
inherit a vacuously green test.

Refs #1553

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMc7X2QncxHM4GEC7b4K4P
…verlap with #1554

Keep this PR's composition label, Total Steps and Stop Reason lines in
search_summary_from_samples; drop the inline resampling lines, which #1554
moved to the end-of-file Resampling Info section. Targeted suites green
(text_util 25 pass, mle 131 pass).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qj5UN31m3FSCxzgp5jTrPj
@Jammy2211
Jammy2211 merged commit a601c3b into main Sep 1, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/multistart-quick-update-49-steps branch September 1, 2026 19:43
Jammy2211 pushed a commit that referenced this pull request Sep 1, 2026
…s tripwire to assert quick updates FIRE

The wiring makes the cadence live for the MultiStart family, so the e2e
regression's quick_update_count assertion flips from == 0 to > 0 exactly as
the tripwire's comment demanded; the two ceiling asserts (60 steps, max_steps
stop) stay unchanged. mle + wiring + text_util suites: 162 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qj5UN31m3FSCxzgp5jTrPj
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: MultiStartProdigy "stopped at 49 steps" is a summary misread, not a quick-update stop

2 participants