fix: make the PointSolver SMALL_DATASETS short-circuit announce itself - #711
Merged
Merged
Conversation
Under `PYAUTO_SMALL_DATASETS=1`, `PointSolver.solve` skips the triangle-tiling solve and returns the fixed pair `[(1.0, 0.0), (0.0, 1.0)]`. That is intentional — the solve is the dominant cost in smoke runs and is meaningless on downsized grids — but it was completely silent, and the returned pair is identical for every lens model. Verified here at einstein_radius 1.0 / 1.6 / 2.5: same two coordinates, no log line even at DEBUG with warnings forced on. Anything derived from those positions is therefore model-independent, so a parity script comparing such a value against a pinned literal is measuring nothing. That is exactly how it failed: `autolens_workspace_test`'s `point_source/jax_likelihood/point.py` produced a different wrong value on every run and cost a full investigation before the cause was found (#710). The short-circuit now emits one `logger.warning` per process — latched at module level rather than per instance, because a vmap batch calls `solve` once per sampled parameter set and the condition is about the process environment. Warn rather than raise: every smoke script that legitimately relies on the speedup keeps working, and only the silence goes away. Tests cover all three properties: the pair is model-independent, the warning fires exactly once across repeated calls, and nothing is emitted when the flag is unset. Refs #710 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJSb9kydhAgMgCCKh26ai2
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.
Closes #710 (library leg). The workspace leg is PyAutoLabs/autolens_workspace_test#265 and must merge after this one.
What this fixes
Under
PYAUTO_SMALL_DATASETS=1,PointSolver.solveskips the triangle-tiling solve and returns the fixed pair[(1.0, 0.0), (0.0, 1.0)]. That is intentional — the solve dominates smoke-run cost and is meaningless on downsized grids — but it was completely silent, and the pair is identical for every lens model.Anything derived from those positions is therefore model-independent, so a parity script comparing such a value against a pinned literal is measuring nothing. That is exactly how it surfaced:
autolens_workspace_test'spoint_source/jax_likelihood/point.pyproduced a different wrong value on every run — once the-1e99sentinel, once a finite-but-wrong16.131221— and cost a full investigation before the cause was found.The change
The short-circuit now emits one
logger.warningper process, latched at module level rather than per instance (a vmap batch callssolveonce per sampled parameter set, and the condition is about the process environment, not any one solver).Warn rather than raise on purpose: every smoke script that legitimately relies on the speedup keeps working, and only the silence goes away.
Evidence
Measured in-session against libraries
2026.8.23.1+ this branch:solve()ateinstein_radius1.0 / 1.6 / 2.5 under the cap[(1.0, 0.0), (0.0, 1.0)]always, before this changeAPI Changes
None. No signature, return type or default changes — the short-circuit returns exactly what it returned before. The only new behaviour is one
WARNINGlog record per process on theautolens.point.solver.point_solverlogger.Tests
Three added to
test_autolens/weak/test_simulator_small_datasets.py, covering each property independently:solvecallsGenerated by Claude Code