Skip to content

fix: provide enough fake samples in bypass test mode #1313

Closed

Description

@Jammy2211

Overview

The release PyAutoBuild run fails three downstream latent robustness guards before they reach the intended latent masking assertion. In PYAUTO_TEST_MODE=2 / =3, PyAutoFit bypasses the sampler and _build_fake_samples always creates exactly two fake samples. The latent robustness guards need more than one latent batch (>3 samples) to exercise the fixed JAX latent masking path, so they fail with AssertionError: Need >3 samples ... got 2.

Plan

  • Increase the deterministic fake sample count used by bypass test mode while keeping bypass mode cheap and sampler-free.
  • Preserve the current best-at-prior-median sample and deterministic perturbed samples.
  • Add focused PyAutoFit coverage proving bypass mode returns enough samples for multi-batch downstream checks.
  • Verify the affected downstream latent robustness scripts progress past the sample-count gate.
Detailed implementation plan

Affected Repositories

  • PyAutoFit (primary)

Work Classification

Library

Branch Survey

Repository Current Branch Dirty?
./PyAutoFit main clean
./PyAutoPrompt main new prompt file

Suggested branch: feature/test-mode-fake-sample-count
Worktree root: ~/Code/PyAutoLabs-wt/test-mode-fake-sample-count/

Implementation Steps

  1. Update PyAutoFit/autofit/non_linear/search/abstract_search.py::_build_fake_samples.
  2. Return at least four deterministic fake samples from bypass mode instead of exactly two.
  3. Keep the first sample at the prior median / canonical parameter vector so existing max-likelihood and summary behavior remains stable.
  4. Generate additional small deterministic perturbations with lower likelihoods and positive weights.
  5. Add or update tests under PyAutoFit/test_autofit/non_linear/search/ for bypass fake sample count.
  6. Run targeted PyAutoFit tests.
  7. Run the three downstream latent robustness scripts if feasible:
    • autofit_workspace_test/scripts/features/latent_nan_robustness.py
    • autogalaxy_workspace_test/scripts/latent/latent_nan_robustness.py
    • autolens_workspace_test/scripts/latent/latent_nan_robustness.py

Key Files

  • autofit/non_linear/search/abstract_search.py — deterministic fake samples for bypass test mode.
  • test_autofit/non_linear/search/... — focused regression coverage.

Original Prompt

Click to expand starting prompt

ok back to the release list

go

Activity

  1. Jammy2211 commented on Jun 8, 2026

    @Jammy2211
    CollaboratorAuthor

    Smoke Test Results — 2026-06-08

    All 46 smoke tests passed across 6 workspaces; 2 configured entries were skipped.

    Workspace Passed Failed Skipped Total
    autofit_workspace 7 0 1 8
    autogalaxy_workspace 6 0 0 6
    autolens_workspace 7 0 0 7
    autolens_workspace_test 14 0 1 15
    euclid_strong_lens_modeling_pipeline 6 0 0 6
    HowToLens 6 0 0 6

    Also verified the three release-blocking latent robustness scripts directly against the PyAutoFit worktree; each now runs with 4 bypass samples.

  2. Jammy2211 commented on Jun 8, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped — 2026-06-08

    PR

    Summary

    Expanded bypass-mode fake samples from two to four deterministic samples in PYAUTO_TEST_MODE=2/3. This keeps bypass mode cheap while allowing downstream latent-variable and multi-batch sample checks to run.

    Verification

    • PyAutoFit PR CI passed: unittest 3.12, unittest 3.13, NSS fork checks 3.12/3.13, fresh-venv install, regex guard.
    • Local PyAutoFit suite passed: 1413 passed, 14 skipped.
    • Local smoke gate passed: 46 passed, 0 failed, 2 skipped across 6 workspaces.
  3. Jammy2211 commented on Jul 28, 2026

    @Jammy2211
    CollaboratorAuthor

    Closing as complete — swept by an issue-tracker reconciliation pass.

    This work shipped and is recorded in PyAutoMind:

    • PyAutoMind/complete/2026/06/test-mode-fake-sample-count.md

    Verified via two independent legs: the record claims this issue in its - issue: header, and its pull request is confirmed merged. Reopen if anything here is still outstanding.

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