Skip to content

fix(latent): report the exceptions the latent engine swallows (PyAutoLens#732) - #1600

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/vis-lp-latent-jit-assertions
Sep 10, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/vis-lp-latent-jit-assertions

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Companion to PyAutoLabs/PyAutoLens#734 (issue PyAutoLabs/PyAutoLens#732). latent_samples_from turns a latent function that raises into a NaN row so one bad sample cannot abort the batch. It did so silently: on the Euclid vis_lp stage of RAL job 342398 the function raised on every sample (a jax.jit trace failure on the model's assertion check), every row became NaN, and the only symptom was "no finite latent samples remained after masking" with the cause lost. The masking itself was not at fault: it already drops an all-NaN column and greedily salvages anti-correlated NaNs.

The engine now counts the per-sample failures and keeps the first traceback. After the batch it warns "raised on N of M samples" with that traceback, and when every sample raised it says the latent function is broken for this model rather than blaming the samples. Masking behaviour is unchanged.

API Changes

None — internal changes only (log output of latent_samples_from).

Test Plan

  • test_new_path_skips_arbitrary_exception_samples now asserts the warning carries the count and the exception text
  • test_every_sample_raising_names_the_cause_instead_of_a_blank_block — every sample raising returns None and the warning names the every-sample case with the traceback
  • Full suite on the branch merged with current main: 2539 passed, 25 skipped
Full API Changes (for automation & release notes)

Changed Behaviour

  • autofit.non_linear.analysis.latent.latent_samples_from — logs a warning with the failure count and first traceback when the latent function raised on any sample; the "no finite latent samples remained" warning names the every-sample case

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FFSFgEBiZc7kTRutfK1RsN


Generated by Claude Code

Jammy2211 and others added 2 commits September 10, 2026 18:22
…Lens#732)

`latent_samples_from` turns a latent function that raises into a NaN row so one
bad sample cannot abort the batch. It did so silently: when the function raised
on every sample (the Euclid `vis_lp` case -- a `jax.jit` trace failure on the
model's assertion check), the only symptom was "no finite latent samples
remained after masking" with the cause lost.

Count the per-sample failures and keep the first traceback; after the batch
warn "raised on N of M samples" with that traceback, and when every sample
raised say the latent function is broken for this model rather than blaming
the samples. Masking behaviour is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FFSFgEBiZc7kTRutfK1RsN
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 10, 2026 — with Claude
@Jammy2211
Jammy2211 merged commit 0280983 into main Sep 10, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/vis-lp-latent-jit-assertions branch September 10, 2026 18:49
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 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