Skip to content

fix: end search.summary with a 'Resampling Info' section #1551

Closed

Description

@Jammy2211

Overview

The gradient searches' resampling statistics (Resurrections, the NaN lane-step counts and rates, Constrained Lane-Steps) are currently emitted in the middle of search.summary, between the sample counts and the timing lines. The user asked for them to live at the bottom of the file instead: a blank line after the 'Visualization Time' line, then a Resampling Info subheader followed by the six resampling lines. This makes the file read as "what the search found, how long it took, then the resampling diagnostics" rather than interleaving diagnostics with headline numbers.

Plan

  • Extract the resampling block out of search_summary_from_samples into its own helper, preserving every existing emit-nothing guard (no keys → no lines; no constrained key → no constrained line; zero lane-steps → no rates).
  • Append the block at the end of search_summary_to_file, after the timing/visualization lines, separated by exactly one blank line and introduced by a Resampling Info subheader.
  • Update the resampling tests to assert the section sits at the end of the written file, and add a Witness-shaped ordering test; the Clipper/Scaler lines and all other summary content are untouched.
Detailed implementation plan

Affected Repositories

  • PyAutoFit (primary, only)

Branch Survey

Repository Current Branch Dirty?
./PyAutoFit main (e6ff1e6) clean

Suggested branch: feature/resampling-info-summary-section

Implementation Steps

  1. autofit/text/text_util.py — add _resampling_summary_from(samples_info) -> [str] holding the block currently at the middle of search_summary_from_samples (guarded on n_value_nan_lane_steps; Constrained Lane-Steps only when n_constrained_lane_steps exists; rates only when n_starts * total_steps > 0), and remove the block from search_summary_from_samples. The Clipper/Scaler lines stay where they are.
  2. autofit/text/text_util.py — in search_summary_to_file, after the Visualization Time append (and equally when visualization_time is None), append the section when the helper returns lines: exactly one blank line, then Resampling Info\n, then the six lines. The 'Visualization Time' line has no trailing newline while the other tail lines do, so the separator normalises to end the previous line and leave one empty line either way.
  3. test_autofit/text/test_text_util.py — repoint the resampling-content tests (nan_lane_step_counters, nan_rates_omitted_when_no_lane_steps_taken, constrained_lane_steps_reported, constrained_absent_when_never_written) at search_summary_to_file via tmp_path, keep the absent-for-other-searches invariants (no Resampling Info header in a Nautilus summary), and add a Witness test: with visualization_time given, the file ends with Visualization Time … \n\nResampling Info\n + the six lines in order.

Key Files

  • autofit/text/text_util.py — search_summary_from_samples, search_summary_to_file
  • test_autofit/text/test_text_util.py — resampling/summary tests
  • autofit/non_linear/paths/abstract.py — save_summary (sole production caller; unchanged)

Original Prompt

Click to expand starting prompt

Add Resampling Info section to the bottom of search.summary

Type: bug
Target: PyAutoFit
Difficulty: small
Autonomy: safe
Priority: normal
Status: formalised
Consequence: glance
Witness: a completed search's search.summary file ends with a blank line after the 'Visualization time' line, then a 'Resampling Info' subheader followed by the six resampling lines (Resurrections, Value-NaN Lane-Steps, Gradient-NaN Lane-Steps, Constrained Lane-Steps, Value-NaN Lane-Step Rate, Gradient-NaN Lane-Step Rate).
Review-minutes: 3
Unattended: ready

Add Resampling Info section to the bottom of search.summary

Original request (verbatim): these should be at bottom of search.summary, with a space after the 'Visualization time' line, and a subheader saying 'Resampling Info': Resurrections = 0
Value-NaN Lane-Steps = 5540
Gradient-NaN Lane-Steps = 36
Constrained Lane-Steps = 0
Value-NaN Lane-Step Rate = 0.6520715630885122
Gradient-NaN Lane-Step Rate = 0.00423728813559322

Witness: a completed search's search.summary file ends with a blank line after the 'Visualization time' line, then a 'Resampling Info' subheader followed by the six resampling lines (Resurrections, Value-NaN Lane-Steps, Gradient-NaN Lane-Steps, Constrained Lane-Steps, Value-NaN Lane-Step Rate, Gradient-NaN Lane-Step Rate).

Activity

  1. Jammy2211 commented on Aug 31, 2026

    @Jammy2211
    CollaboratorAuthor

    Library PR created: #1554 (feature/resampling-info-summary-section, one commit, +145/−52 across autofit/text/text_util.py and its tests).

    Workspace impact — recommendation (iii): no workspace work needed. API Changes are "None — internal output-format change": no symbols removed, renamed, or re-signatured, and no script or tool in the organism parses search.summary (grepped the library and workspace checkouts; the only mentions are prose). The autofit_workspace curated smoke subset was run against the branch in-container: 8/8 PASS, and a real MultiStartAdam smoke run's search.summary shows the Witness exactly — blank line after Visualization Time, Resampling Info subheader, the six resampling lines closing the file. The remaining five workspaces could not be smoked in this container (no lens-stack checkouts); the batch record's expected-effects line for this member already anticipates smoke-output-pin staleness from the format change.

    All five autonomous-ship gate legs are recorded on the PR (tests 2328/0 fail, smoke 8/8, review CLEAN with claim dispositions, Heart STALE 35 within the shift's heart-ack, independent adversary CLEAN). Per the batch contract the run ends at PR-open — merge is the human's act at review, serially before the other two PyAutoFit members this shift.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions