Skip to content

test: assert derived instance attributes cross pytree boundaries as leaves - #81

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/jax-pytree-traced-aux-fix
Aug 1, 2026
Merged

test: assert derived instance attributes cross pytree boundaries as leaves#81
Jammy2211 merged 1 commit into
mainfrom
feature/jax-pytree-traced-aux-fix

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Regression coverage for PyAutoLabs/PyAutoFit#1441 — the autofit half of the PyAutoLens#678 phase B cluster gradient failure. JAX-using tests live here per PyAutoFit#1247.

The script builds a model whose class derives an attribute in __init__ from a prior parameter, then asserts (1) the flattened instance carries no tracers in aux data and (2) a custom_jvp whose rule re-reads the derived attribute inside its own jax.jvp differentiates cleanly with the exact gradient. Verified to fail with UnexpectedTracerError against pre-#1441 autofit and pass after.

Merge after PyAutoLabs/PyAutoFit#1441.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DnTmLoJjJgMTze5uAbg1Jd

…eaves

Regression coverage for PyAutoFit#1441 (traced values leaking into pytree
aux data), the autofit half of the PyAutoLens#678 phase B cluster gradient
failure. Fails with UnexpectedTracerError on pre-fix autofit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnTmLoJjJgMTze5uAbg1Jd
@Jammy2211
Jammy2211 merged commit e850bdc into main Aug 1, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/jax-pytree-traced-aux-fix branch August 1, 2026 12:48
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