Skip to content

fix: results index skips campaign task records; batch wait loop keeps the fit's exit status - #1750

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/campaign-task-records-wait-loop
Oct 31, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/campaign-task-records-wait-loop

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes #1749. This is a follow-up to hpc-campaign phase 5a, from the independent review of autolens_assistant#174.

What changes

  • autofit/results/index.py. find_results no longer walks into .campaign_tasks/. A campaign's stage entry writes pending or failed task records there before the fit starts, and the results index was counting them as phantom results. The campaign collector walks for those records on its own, so it is unaffected.
  • autofit/campaign/scheduler/slurm.py. The generated batch script's wait loop now keeps only the fit's own exit status. Before, a fit that checkpointed on the pre-timeout USR1 and then finished cleanly exited 138, so it was recorded as a failure.

API Changes

None. CAMPAIGN_TASKS_DIRNAME is a new module constant in autofit.results.index; it is not exported.

Tests

  • New: an index test with task records beside a real result. Two batch-script tests run a generated script under bash: USR1, then a clean exit gives 0; a failing fit gives its own 3. The USR1 test fails against the old loop.
  • Full PyAutoFit suite: 4170 passed, 2 skipped, 1 xfailed.
  • Workspace impact: none. Both paths are new since 2026.10.29.1 and are not used by workspace scripts yet, so no smoke run.

Review

Independent review (a different model from the author's): CLEAN. The slurm tests ran 10× with no flakes. Its one test nit (fail fast if the fit never starts, kill on timeout) is applied.

Under the Heart RED development override, extended by the human on 2026-10-31; the reasons are quoted on #1749. Merge only with green CI and your /prm; no release.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits October 31, 2026 12:12
… the fit's exit status

- autofit.results index walked into output/.campaign_tasks/, so the
  pending/failed task records a campaign's stage entry writes before its
  fit starts showed up as phantom results. The directory is skipped (the
  campaign collector walks for them itself).
- The generated Slurm batch script's 'until wait' loop kept the 138 from a
  USR1-interrupted wait, so a fit that checkpointed on the pre-timeout
  signal and then finished cleanly exited 138. It now keeps only the fit's
  own status. The new test drives a real USR1 and fails on the old loop.

Fixes #1749.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… kills on timeout (review nit)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 289a85e into main Oct 31, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/campaign-task-records-wait-loop branch October 31, 2026 12:21
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: results index skips campaign task records; batch wait loop keeps the fit's exit status

1 participant