test: JAX pytree leaf-type registration guard (guards PyAutoFit#1366)#42
Merged
Merged
Conversation
Reproduces af.Model(int) sub-model; asserts leaf types are NOT registered as pytree nodes, the real component IS, and jax tree_flatten/unflatten round-trips. Regression guard for the shapelet vmap crash. JAX assertions live here, not in test_autofit (moved out in #1247). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDCsgNCXacXqiWAPTswWCt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Regression guard for the JAX shapelet-fit crash fixed in PyAutoFit#1366 (release-validation run
29266305445). Addsscripts/jax_assertions/pytree_leaf_registration.py: builds a model with anaf.Model(int)sub-model (the shapeletn/mstructure), then asserts leaf types (int/float/str/…) are not registered as pytree nodes, the real component class is, andjax.tree_util.tree_flatten/tree_unflattenround-trips.Reproduces without autogalaxy (pure autofit). JAX assertions live here, not
test_autofit/(moved out in #1247).Library-first gate
Merge after PyAutoFit#1366. Verified passing against that branch.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TDCsgNCXacXqiWAPTswWCt