Skip to content

test(latent): latent_nan_robustness guard for compute_latent_samples NaN masking - #137

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/latent-nan-masking-fix
Jun 6, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/latent-nan-masking-fix

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds an integration-level regression guard reproducing and protecting against the PyAutoFit compute_latent_samples per-batch latent NaN-masking bug — the exact KeyError reported on total_lensed_source_flux at the end of a SLaM search.

Scripts Changed

  • scripts/latent/latent_nan_robustness.py — new guard: an SIE + Sersic lens fit exercising the full 8-latent set (incl. total_lensed_source_flux and effective_einstein_radius), latents materialised on the JAX path with PYAUTO_LATENT_NAN_INJECT=stride:3; asserts summary()/median_pdf() succeed and surviving latents are finite. Reproduces the KeyError pre-fix, passes post-fix.
  • smoke_tests.txt — registers the new script.

Upstream PR

Test Plan

  • Smoke test passes (script reproduces the KeyError pre-fix and passes post-fix).

🤖 Generated with Claude Code

Reproduces and guards against the PyAutoFit compute_latent_samples per-batch
latent NaN-masking bug (KeyError at Samples.summary() when a latent goes NaN
for a subset of samples). Uses the PYAUTO_LATENT_NAN_INJECT hook on the JAX
latent path. Registered in smoke_tests.txt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jun 6, 2026
@Jammy2211
Jammy2211 merged commit afeb018 into main Jun 6, 2026
0 of 4 checks passed
@Jammy2211
Jammy2211 deleted the feature/latent-nan-masking-fix branch June 6, 2026 14:02
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next 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.

1 participant