docs: correct false simulator-JAX claims (registration, eager-on-JAX, TransformerNUFFT) - #183
Merged
Merged
Conversation
… NUFFT) The autogalaxy half of PyAutoLabs/autolens_workspace#379. All measured against the installed stack. 1. "The simulator handles pytree registration internally" — no simulator registers pytrees anywhere, so the documented @jax.jit wrap fails with `TypeError ... value is of type Galaxies`. Unimplementable as worded too: JAX flattens jitted arguments at trace time, before entering the callee. The correct call is now named — autogalaxy.jax.register_galaxies_classes, added in PyAutoGalaxy#537 for exactly this gap. 2. "eager via_galaxies_from(...) already runs on JAX" — returns a numpy.ndarray-backed dataset, not jax.Array. 3. The @jax.jit recipe fails even WITH registration, inside autoarray (preprocess.py:153, then array_2d_util.py). Separate library bug, filed separately; docs now point at the eager call instead. 4. Two separate stale NUFFT claims: guides/using_jax.py said TransformerNUFFT is not JAX-traceable (shipped backwards in #181 this morning), and interferometer/simulator.py said it is pynufft-backed with nufftax "a research path". Per autoarray's own error text TransformerNUFFT IS the default JAX-native nufftax-backed transformer (nufftax 0.3.1 installed); TransformerNUFFTPyNUFFT is the legacy pynufft one. Why this went unnoticed: both __JAX Variant__ recipes live inside ```python fences (prose, not executed cells) and neither simulator.py is in smoke_tests.txt, so `dataset_jax = simulate(galaxies)` looked like a working call while never running. Same failure mode as the six likelihood_function.py __JAX__ blocks removed in #181. Refs PyAutoLabs/autolens_workspace#379 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CWqjHGXUut25TEB8octU8H
2 tasks
…igator gate)
PyAutoHands#213 ("gate relative folder references in README prose") merged at
08:28:46Z, seven minutes after this repo's main last passed Navigator Check
(1abfc8c, 08:21:38Z). navigator_check.yml is consumed @main, so this PR was the
first to run under the widened gate and it flagged 5 pre-existing references:
scripts/README.md:1 -> autogalaxy_workspace/scripts
scripts/README.md:4 -> autogalaxy_workspace/notebooks
scripts/interferometer/features/linear_light_profiles/README.md -> autogalaxy_workspace/scripts/imaging/features/...
scripts/interferometer/features/multi_gaussian_expansion/README.md -> ditto
scripts/interferometer/features/shapelets/README.md -> ditto
None were touched by this PR; all are unchanged on main, which will fail its next
run too. They are genuine drift rather than a checker false positive:
autolens_workspace words the same sentences repo-relative ("The `scripts`
folder") and passes the identical gate, while this repo used the
repo-name-prefixed form, which cannot resolve from the repo root because the root
IS autogalaxy_workspace.
Dropped the `autogalaxy_workspace/` prefix from those 5 folder references.
References to `autogalaxy_workspace/README.md` are left alone — the gate covers
folder refs only, and autolens_workspace keeps that form too.
The notebooks/ README mirrors are generated from scripts/, so generate.py
propagated the change.
Refs PyAutoLabs/autolens_workspace#379
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CWqjHGXUut25TEB8octU8H
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
Corrects the false JAX claims in this workspace's docs — the autogalaxy half of
PyAutoLabs/autolens_workspace#379. All measured against the installed stack.
1. "The simulator handles pytree registration internally" — false
No simulator anywhere registers pytrees:
grep -rn registerover both autogalaxysimulators, both autolens simulators and both autoarray bases returns zero
hits. The documented
@jax.jitwrap fails immediately withTypeError ... value is of type Galaxies.It is also unimplementable as worded — JAX flattens a jitted function's
arguments at trace time, before entering the callee, so a simulator that
registered internally would already be too late. (
PointSolver.solve_trianglesin autolens carries the same note at its own call site.)
The correct call is now named:
autogalaxy.jax.register_galaxies_classes(galaxies),added in PyAutoGalaxy#537 precisely because autogalaxy had no public counterpart to
autolens.jax.register_tracer_classes.2. "eager
via_galaxies_from(...)already runs on JAX" — falseEager with
use_jax=Truesucceeds but returnsdataset.data.arrayof typenumpy.ndarray, notjax.Array.3. The
@jax.jitsimulator recipe does not work at allEven with correct registration it dies inside autoarray
(
preprocess.py:153, thenarray_2d_util.py) on sites that do not threadxp.Separate library bug, filed separately. The docs now say so and point at the eager
call rather than presenting a recipe that cannot run.
4.
TransformerNUFFT— two separate stale claimsguides/using_jax.py: docs: reduce likelihood_function.py __JAX__ blocks to a pointer to guides/using_jax.py #181 (merged this morning) shipped "TransformerDFT(thedefault).
TransformerNUFFTis not JAX-traceable." Inherited from the old__JAX__blocks and backwards.interferometer/simulator.pycarried an older variant: thatTransformerNUFFTis pynufft-backed and "the
nufftaxreplacement is a research path".Per autoarray's own error text,
TransformerNUFFTis "the default JAX-native"transformer (nufftax-backed; nufftax 0.3.1 installed) and
TransformerNUFFTPyNUFFTis "the legacy pynufft backend". Defaults differ byclass:
SimulatorInterferometer→TransformerDFT;Interferometer, which a fituses →
TransformerNUFFT.Note on why this went unnoticed
Both
__JAX Variant__sections present their recipe inside a```pythonfence — prose, not executed cells — and neither
simulator.pyis insmoke_tests.txt. Sodataset_jax = simulate(galaxies)looked like a workingcall while never running. Same failure mode as the six
likelihood_function.py__JAX__blocks removed in #181.Scripts Changed
scripts/guides/using_jax.py— rewrote__Writing @jax.jit Yourself__(claims 1-3); fixed the NUFFT sentence in__Custom Likelihood Functions__(claim 4)scripts/imaging/simulator.py— claims 1-3 in__JAX Variant__scripts/interferometer/simulator.py— claims 1-3 plus the stale nufftax-as-research-path paragraphNotebooks,
llms-full.txtandworkspace_index.jsonregenerated viaPyAutoHands/autohands/generate.py.Upstream PR
PyAutoLabs/PyAutoLens#665 — the same stale auto-call claim
in
autolens/jax/registration.py's module docstring. Docstring-only with zero APIsurface; nothing here imports new API, so merge order does not actually matter.
The
register_galaxies_classesfunction this PR now points readers at is alreadymerged (PyAutoGalaxy#537,
9594c00b).Test Plan
py_compileon every touched filepytree registration internally,already runs on JAX, and both reversed NUFFT claimsGenerated by the PyAutoLabs agent workflow.