Skip to content

test: af.NSS checkpoint/resume integration smoke - #66

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/nss-checkpointing-and-visualization
May 16, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/nss-checkpointing-and-visualization

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Adds searches_minimal/nss_checkpoint_resume.py — end-to-end integration smoke for af.NSS Phases 2-3 shipping concurrently in PyAutoLabs/PyAutoFit#1274 (closes PyAutoLabs/PyAutoFit#1273).

The script validates the full checkpoint-resume cycle on real nss.ns.run_nested_sampling output (the existing PyAutoFit unit tests cover the pytree round-trip + atomic-write semantics with synthetic data; this script covers the live wiring).

Two-pass strategy

  1. Capture pass — runs af.NSS with checkpoint_interval=2 and instruments _save_checkpoint (via monkey-patch) to copy the first written blob aside before the post-success cleanup deletes it. Also counts analysis.visualize invocations during the run to verify the Phase 3 quick-update hook fires.

  2. Resume pass — pre-plants the captured snapshot at the expected resume location via paths.search_internal_path, runs af.NSS again with the same model + Paths, and asserts:

    • The "Resuming NSS from checkpoint" info log fires.
    • The resumed run produces a finite log_evidence.
    • Post-success cleanup deletes the resumed-run checkpoint.

On a 2D Gaussian flat-likelihood problem (n_live=40, num_mcmc_steps=2, num_delete=5, termination=-1.0, checkpoint_interval=2, iterations_per_quick_update=3) the capture pass runs in ~60 sec on laptop CPU; the resume pass benefits from JIT cache and finishes in ~2 sec.

Designed as a permanent regression gate. Fails loudly if any future refactor breaks the checkpoint hook, the resume detection, the post-success cleanup, or the viz dispatch.

API Changes

None — internal workspace_developer addition only.
See full details below.

Test Plan

  • python searches_minimal/nss_checkpoint_resume.py — passes against the matching af.NSS PyAutoFit branch. Verified end-to-end: capture pass snapshots a checkpoint, post-success cleanup deletes the original, quick-update viz fires 4 times during the capture pass, resume pass restores the snapshot at the expected path, the resume log fires, the resumed run produces identical log_evidence (-0.0096) and finite samples, the resumed-run checkpoint is deleted on success.
Full API Changes (for automation & release notes)

None — internal test workspace addition only.

🤖 Generated with Claude Code

Adds searches_minimal/nss_checkpoint_resume.py — end-to-end integration
smoke for af.NSS Phases 2-3 (PyAutoLabs/PyAutoFit#1273 — fix shipping
concurrently on the matching feature/nss-checkpointing-and-visualization
branch in PyAutoFit).

Strategy: two passes on a 2D Gaussian flat-likelihood problem.

1. Capture pass — runs af.NSS with checkpoint_interval=2 and an
   instrumented _save_checkpoint that copies the first written blob
   aside before the post-success cleanup deletes it. Also counts
   analysis.visualize invocations to verify the Phase 3 hook fires.

2. Resume pass — pre-plants the captured snapshot at the expected
   resume location via paths.search_internal_path, runs af.NSS again
   with the same model + Paths, and asserts:
   - the "Resuming NSS from checkpoint" log fires
   - the resumed run produces finite log_evidence
   - post-success cleanup deletes the checkpoint

Designed as a permanent regression gate. Fails loudly if any future
refactor breaks the checkpoint hook, the resume detection, or the
viz dispatch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release Pending release build label May 16, 2026
@Jammy2211
Jammy2211 merged commit 4e99bf9 into main May 16, 2026
@Jammy2211
Jammy2211 deleted the feature/nss-checkpointing-and-visualization branch May 16, 2026 09:28
@Jammy2211 Jammy2211 removed the pending-release Pending release build label Oct 7, 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.

feat: af.NSS checkpointing + on-the-fly visualization (Phases 2-3)

1 participant