Skip to content

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

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 — a KeyError at Samples.summary() when a latent goes NaN for a subset of samples.

Scripts Changed

  • scripts/latent/latent_nan_robustness.py — new guard: an imaging galaxy fit, 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.
  • config/latent.yaml — enables total_galaxy_0_flux and total_galaxy_0_flux_mujy so the multi-column (mis-zip) path is exercised.
  • scripts/latent/__init__.py — package marker (matches sibling scripts/ subdirs).
  • 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 5a27ea3 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