Skip to content

fix: skip latent computation without keys - #1317

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/latent-jax-release-failures
Jun 9, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/latent-jax-release-failures

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Fixes a latent-refactor edge case where compute_latent_samples(...) could still enter the JAX batching path when an analysis had no enabled latent keys, leading to jnp.stack([]) failures during downstream visualization/update scripts.

API Changes

Analysis.compute_latent_samples(...) now returns None immediately when the analysis has no enabled latent keys, matching the existing no-latent contract instead of attempting an empty latent batch.
See full details below.

Test Plan

  • NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest test_autofit/analysis/test_latent.py test_autofit/analysis/test_latent_variables.py test_autofit/analysis/test_use_jax_for_visualization.py -q
  • NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest -q
  • Targeted Group A release scripts pass against the task worktree.
Full API Changes (for automation & release notes)

Removed

  • None

Added

  • None

Renamed

  • None

Changed Signature

  • None

Changed Behaviour

  • autofit.non_linear.analysis.latent.latent_samples_from(...) returns None when analysis.Latent.keys(analysis) is empty, rather than entering the batching path and crashing on an empty stack.

Migration

  • None. Analyses with no enabled latents now follow the same None result contract as other no-latent paths.

@Jammy2211

Copy link
Copy Markdown
Collaborator Author

@Jammy2211
Jammy2211 merged commit 3ae0ccc into main Jun 9, 2026
7 checks passed
@Jammy2211
Jammy2211 deleted the feature/latent-jax-release-failures branch July 9, 2026 09:33
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 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