test(viz): __Visualization Sanity__ pilot block on imaging viz_jit (fast_viz A')#111
Merged
Merged
Conversation
…ualization_jit Three assertions on a deterministic SIE tracer (einstein_radius=1.2, ell_comps=(0.1, 0.0)) — independent of the script's MGE prior medians: - Correctness: tangential_critical_curve_list_via_zero_contour_from() returns a non-empty list. Catches the silent-zero source-plane failure mode that triggered the 2026-05-16 Euclid revert (PyAutoFit #1280). - Correctness: einstein_radius_via_zero_contour_from() returns a finite positive value. Catches latent-variable collapse. - Perf: warm-call latency on the SAME LensCalc instance is under 100 ms. Regression net for the closure cache-busting bug fixed in PyAutoGalaxy #434 (warm calls were ~10 s before caching, ~67 ms after). The block runs at script start before the Nautilus search so it fires on every run_all_scripts.sh invocation. Closes PyAutoLabs/PyAutoGalaxy#433 alongside the library PRs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 21, 2026
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
Adds the first
__Visualization Sanity__regression-net block onautolens_workspace_test/scripts/imaging/modeling_visualization_jit.py. The block exercises the JAX-jittablezero_contourcritical-curve path on a deterministic SIE tracer (einstein_radius=1.2,ell_comps=(0.1, 0.0)) at script start, asserting:LensCalcinstance is under 100 ms.Together these catch the three failure modes behind the 2026-04-19 and 2026-05-16 visualization-default reverts: (i) silent-zero source plane from a JAX-trace exception swallowed by the broad
except, (ii) Einstein-radius latent collapse, (iii) closure cache-busting in_critical_curve_list_via_zero_contourthat made warm calls cost ~10 s instead of ~67 ms. Local validation under PYAUTO_TEST_MODE=2:PASS Visualization Sanity (correctness): 1 tangential CC, einstein_radius=1.1938andPASS Visualization Sanity (perf): warm call 79.0 ms.The block runs unconditionally before the Nautilus search, so it fires on every
run_all_scripts.shinvocation on the build server.Scripts Changed
scripts/imaging/modeling_visualization_jit.py— appends a__Visualization Sanity__prose block + correctness + perf asserts after the existing Part 1 MGE caching probe. Uses a separately-constructed SIE tracer so the assertions are deterministic regardless of the script's MGE prior medians.Upstream PRs
Test Plan
PYAUTO_TEST_MODE=2against the worktree libraries — Sanity block passes (einstein_radius=1.1938, warm call 79.0 ms).jax_likelihood_functions/point_source/point.py, JAX vmap returns-1e99sentinel instead of-83.38) reproduces identically on canonicalmainwithout these changes; it is a pre-existing point-source-JAX regression and is out of scope for this PR.run_all_scripts.shbuild.Closes PyAutoLabs/PyAutoGalaxy#433 (alongside the library companion PRs).
🤖 Generated with Claude Code