Commit fc00636
committed
fix: coerce fnnls_cholesky inputs to numpy — JAX ZTx broke the numba buffer kernels
The sparse-operator inversion path hands fnnls_cholesky JAX arrays even when
the fit itself runs the numba CPU path. Indexing a JAX array yields another
JAX array, which numba maps to a *readonly* buffer — and the in-place buffer
kernels introduced by #453 (_cho_solve_buffer via
_solve_upper_transposed_buffer) overwrite their vector argument, so kernel
compilation fails with "Cannot modify readonly array" the first time the
solver runs on such input. The scipy solvers #453 replaced tolerated JAX
input by copying internally, which is why this never bit before.
Visible failure: HowToLens smoke on main, red since 2026-08-20 22:30 UTC —
tutorial_8_adaptive_pixelization and tutorial_11_brightness_adaption (the two
tutorials whose fits route through the sparse operator) died with
"During: Pass nopython_type_inference" on both CI Pythons, 21 minutes after
the #453 merge. This RED is what blocked the 2026-08-21 nightly release.
Coerce ZTZ / ZTx / P_initial once at the function boundary: fancy indexing a
numpy parent hands every downstream kernel a fresh writeable array. The new
regression test calls fnnls_cholesky with jnp arrays (importorskip'd) and is
verified to fail without the coercion.
test_autoarray: 1063 passed; the 3 test_transformer pynufft failures
reproduce identically on unmodified main in this environment (missing
[optional] extras) and are unrelated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015GsUfbCwPd4XC8kpsiUJp71 parent d29ad97 commit fc00636
2 files changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
0 commit comments