Skip to content

feat(fixed-light): lever 1 verdict — numba split-reg assembly 1.38x on numba CPU, A100 identity (#267) - #269

Merged
Jammy2211 merged 5 commits into
mainfrom
feature/fixed-light-numba-levers
Sep 16, 2026
Merged

Jammy2211 merged 5 commits into
mainfrom
feature/fixed-light-numba-levers

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Lever 1 of #267 (phase 3 of the fixed-lens-light-numba-cpu epic): the CPU A/B and A100 rows for PyAutoArray's numba split-regularization assembly (PyAutoLabs/PyAutoArray#553), the bit-identity witness, and the phase-3 verdict note with the lever 1 section written; levers 2 and 3 are appended to the same note when they land.

Verdict

On the production numba CPU path (HST Delaunay N=1500, source-only route b, cross-evaluation NNLS memo ON, 1 thread), the whole likelihood call goes 413.3 → 299.7 ms (1.38x); inversion.regularization_matrix 110.6 → 5.9 ms. All four cell gates pass in both arms; the H matrix is bit-identical to the retained pure-Python reference; the log evidence is unchanged to exactly 0.0 relative. The A100 row is identity (JAX branch untouched); the #536 compaction constants are inert at K = 4.

Scripts Changed

  • hpc/batch_cpu/submit_breakdown_imaging_fixed_light_numba_levers_delaunay_ral_hst_fp64 — new: two-arm (control = private merge-base PyAutoArray, feature) Leg D run on the gpu partition CPUs-only, no --gres, all thread env pinned to 1, provenance printed per arm; witness runs in the feature arm. RAL job 343345.
  • hpc/batch_gpu/submit_breakdown_imaging_fixed_light_numba_levers_delaunay_a100_hst_fp64 — new: two-arm delaunay.py breakdown on the A100, fp64, AdaptSplit. RAL job 343346.
  • scripts/imaging/likelihood_breakdown/fixed_light_numba_levers_witness.py — new: builds the route b S3 system on the numpy/numba path and asserts (W1) array_equal of the library H against the _reference chain, (W2) the interpolator's cached stencil tables are unmutated, (W3) log evidence with kernels vs monkeypatched references ≤ 1e-9 relative; writes a JSON.
  • results/breakdown/imaging/ — 4 JSON + 4 PNG (CPU control/feature, A100 control/feature) + the witness JSON.
  • results/notes/fixed_lens_light_levers_2026_09.md — new: the phase-3 note, lever 1 section.

Cross-reference

Library change: PyAutoLabs/PyAutoArray#553 (feature/fixed-light-numba-levers @ bae9296e, pending-release). This PR carries measurement scripts and results only; it does not depend on the library merge to run against main (the witness and A/B scripts take the PyAutoArray checkout from PYTHONPATH).

Tracked by #267 (lever 1 of 3; the issue stays open for levers 2 and 3).

Heart gate

pyauto-heart readiness was RED (score 20) at ship time with two release-chain reasons unrelated to this branch — "install verification FAILED (testpypi; checks F)" and "release validation FAILED (stage integrate)" — acknowledged by the human on 2026-09-16 for PR-open only. Merge stays a human act via /prm.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits September 16, 2026 10:17
…267)

Lever 1 of the numba CPU levers task replaced the two pure-Python loops in
PyAutoArray's split-regularization assembly (`reg_split_np_from`,
`pixel_splitted_regularization_matrix_np_from`) with numba kernels, keeping
the original loop bodies as `_reg_split_reference` /
`_pixel_splitted_regularization_matrix_reference`. This adds the measurement
and correctness legs for that lever.

* `hpc/batch_cpu/submit_breakdown_imaging_fixed_light_numba_levers_delaunay_ral_hst_fp64`
  — one job, two arms: phase 2's Leg D (route b, sparse_numba, memo ON,
  threads 1, n-repeats 16, iid) run against a private merge-base checkout
  (5e2bc0f4) and against the lever branch (bae9296e), each in its own
  subshell with its own PYTHONPATH prepend and numba cache, each printing
  `autoarray.__file__` and its checkout's HEAD. `gpu` partition CPUs-only,
  no --gres.
* `hpc/batch_gpu/submit_breakdown_imaging_fixed_light_numba_levers_delaunay_a100_hst_fp64`
  — the same two arms of `delaunay.py --regularization adapt_split
  --split-setup --vmap-batch 16`. Lever 1 changed only the `xp == np` branch
  and this cell builds H with `xp=jnp`, so the expectation is identity; the
  row exists to confirm the #536 compacted scatter is the path that runs and
  to record the measured H.
* `scripts/imaging/likelihood_breakdown/fixed_light_numba_levers_witness.py`
  — W1 bit-identity of `inversion.regularization_matrix` against the
  reference chain (`np.array_equal`), W2 the interpolator's cached stencil
  tables are unmutated, W3 the fit's `figure_of_merit` is unchanged when both
  numpy entry points are monkeypatched to the references. PASSes locally on
  the HST Delaunay N=1500 source-only AdaptSplit system with all three
  differences exactly 0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…n numba CPU, A100 identity (#267)

RAL job 343345 (gpu partition CPUs-only, 1 thread, private merge-base control):
route b memo-ON whole call 413.301 -> 299.709 ms, inversion.regularization_matrix
110.599 -> 5.924 ms; all cell gates PASS; witness W1-W3 PASS (H bit-identical,
tables unmutated, log evidence relative diff 0.0). RAL job 343346 (A100 fp64):
identity to 0.03 % on the H prefix; the #536 compaction constants are inert at
K=4. Note: results/notes/fixed_lens_light_levers_2026_09.md (levers 2-3 pending).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Jammy2211 and others added 3 commits September 16, 2026 22:56
… submits (#267)

test_fixed_light_cell.py's single-arm contracts caught the lever submits
through its glob: `^python3 -u` misses the indented subshell arms, lever 1
runs delaunay.py (no --mesh, its own config names, no cache by design — a
verbatim copy of the adapt_split submit), and levers 2/3 wipe per-arm caches
as JAX_CACHE_{CONTROL,FEATURE} rather than the single-arm string. Exclude
the family there, as the library family already is, and give it
test_fixed_light_numba_levers_submits.py: two arms, private checkouts on
PYTHONPATH, provenance echoes, paired _control/feature config names, mesh
and harvest prefix and per-arm cache wipe where the cell is fixed_light.py.
No submit script changes: the recorded RAL runs depend on their text.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…#267)

The lever-3 submit's header describes its provenance heredoc in prose
(`$(cat <<'EOF' ...)` — the explanation for why it is not `read -r -d ''`),
and the arm parser read that as a real `EOF` heredoc opener, swallowed the
rest of the file and found zero `( ... )` arms. Skip comment lines when
looking for an opener; the parser now finds two arms on all three levers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…oth submit-family exclusions kept (#267)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 11d95d5 into main Sep 16, 2026
1 check failed
@Jammy2211
Jammy2211 deleted the feature/fixed-light-numba-levers branch September 16, 2026 22:15
@Jammy2211

Copy link
Copy Markdown
Contributor Author

Closed as superseded by #272, not merged — every commit on this branch lands on main through #272, which is stacked on it and was retargeted to main on 2026-09-16.

Why not merged in stack order: the lint workflow checks out PyAutoArray main, which since PyAutoArray #555 merged (91240e43) already carries all three levers. This branch's copy of scripts/misc/test/test_fixed_light_numba.py pins the pre-lever-3 library (test_curvature_reg_matrix_is_recomputed_more_than_once, test_route_d_np_reaches_route_bs_evidence_on_a_real_fit — patched() without factor), so its lint run can no longer go green on its own (run 35156146275: those 2 failures, 534 passed). The verdict in this PR's body stands as the lever's review record; the results, note sections and submit scripts are unchanged in #272. Tracked by #267.

@Jammy2211

Copy link
Copy Markdown
Contributor Author

Correction to the note above: GitHub marked this PR merged automatically once its commits reached main through #272's merge commit cea41bb (the PR was never merged on its own — no separate merge commit, no separate CI pass). Same content, same outcome: every commit on this branch is on main.

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