Skip to content

test: shared_state fast assertions for FactorGraphModel shared state - #31

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/analysis-shared-state
Jun 7, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/analysis-shared-state

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds fast assertion tests for the FactorGraphModel cross-factor shared-state mechanism (PyAutoFit #1308): that the shared model data is computed once per evaluation (not once per factor), that the shared-path likelihood exactly equals the un-shared per-factor sum, that a graph whose analyses do not opt in is unchanged, and that the shared object is a well-behaved JAX pytree that threads through jax.jit.

Scripts Changed

  • scripts/graphical/shared_state.py — new: deterministic numpy assertions (compute-once, exact shared-vs-unshared equality, no-provider unchanged) plus a tiny end-to-end DynestyStatic run.
  • scripts/jax_assertions/shared_state.py — new: JAX assertions (shared object is a pytree under use_jax=True, threads through jax.jit matching eager, numpy/jax agree, no-sharing returns None).
  • smoke_tests.txt — added graphical/shared_state.py as the feature's curated smoke guard.

Upstream PR

PyAutoLabs/PyAutoFit#1308

Test Plan

  • scripts/graphical/shared_state.py passes (4 assertions)
  • scripts/jax_assertions/shared_state.py passes (4 assertions)

🤖 Generated with Claude Code

Add deterministic numpy + JAX assertion scripts for the cross-factor
shared-state mechanism (PyAutoFit #1308) and register the graphical script
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 1, 2026
@Jammy2211
Jammy2211 merged commit 144db9b into main Jun 7, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/analysis-shared-state branch June 7, 2026 20:07
@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