Repository navigation
Description
Overview
This decides whether the certified solver's batched uncertified-lane guard (phase C2, a four-repo library change) is worth building. It captures real Nautilus proposal batches at the production batch size, n_batch=20 (the source_pix stages in euclid_strong_lens_modeling_pipeline/scripts/full_model.py). It replays them on an A100 in fp64 under library certified + certified_fallback="none" in jit(vmap) to measure the uncertified-lane rate, and runs a matched timing table. There are no library edits. It runs against the library mains, including the unreleased PyAutoArray#567; the release block was overridden by the human on 2026-09-24.
Plan
- Capture real Nautilus proposal batches at
n_batch=20on the HST fixed-light cell, for Delaunay N=1500 and rectangular. - Replay them on an A100 in fp64 under certified+none
jit(vmap). Report the uncertified-lane rate overall and by Nautilus phase, plus max passes against the budget of 16. - Time a matched table at B=16/20/50/100: PDIP vmap, certified+none vmap, scalar certified+PDIP, scalar PDIP. Every lane must be within 1e-9 of scalar library PDIP.
- Projected guarded cost = certified+none batch + rate × scalar re-run. Build C2 only if that is at least 15% below the best zero-code option at B=20 and the rate is near zero. The zero-code options are library PDIP vmap, or scalar certified via config opt-in plus
use_jax_vmap=Falseon the pixelized stages. - Write a verdict note that includes the vmap policy stated with its batch size, then update the Mind prompts.
Detailed implementation plan
Affected Repositories
- autolens_profiling (primary, and the only repo edited)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| lens/autolens_profiling | main | untracked dataset/abell_1201/ only |
Suggested branch: feature/certified-solver-phase-c1-lane-rate. The claim on autolens_profiling overlaps with point-source-cpu-p3, but the file sets don't overlap, so a parallel-claim is recorded.
Implementation Steps
- New
scripts/imaging/likelihood_breakdown/nautilus_batch_capture.py.- Reuse the
fixed_light_trace.pydataset, model and settings builder (the phase-B cell). - Run
af.Nautilus(n_batch=20, n_live=<pipeline value>)with the library PDIP default, cappingn_like_maxso the run takes about 1 h on the GPU. - A script-level
Fitness.call_wraprecorder saves each batch with its call index toresults/breakdown/imaging/nautilus_batches_{delaunay,rectangular}.npz, plus a provenance JSON.
- Reuse the
- Extend
fixed_light_trace.pywith--lanes captured --batches <npz> [--batch-sample K].- Rate pass (untimed): per-lane
certified/passesvia the existingjax.debug.callbackinjection (scripts/misc/likelihood_breakdown/library_solver_injection.py:356-400) under--solver certified --fallback off. - Timed pass: reuse the phase-B harness and the 1e-9 gate. Don't pin tighter than 1e-9, because of the Delaunay floor.
- Rate pass (untimed): per-lane
- New submit
hpc/batch_gpu/submit_breakdown_imaging_fixed_light_certified_lane_rate_a100_hst_fp64.- Array over mesh × {capture, rate, time@B∈{16,20,50,100}}; the replay tasks depend on capture.
--export PYAUTO_HPC_BASE=/mnt/ral/jnightin/PyAuto.- Static test
scripts/misc/test/test_fixed_light_certified_lane_rate_submit.py. - Run a laptop CPU witness (small capture + replay) first.
- Note
results/notes/certified_solver_phase_c1_lane_rate_2026_09.mdplus a job provenance JSON.- Rate overall and by phase, and max passes.
- Matched table per B, and memory limits at B=50/100.
- Projected guarded cost, a "vmap policy with batch size" section, and the verdict.
- Regenerate the README dashboards (
build_readme.py --check).
- Mind. The C1 verdict gates
draft/feature/autofit/certified_solver_batched_guard_c2.md, which already holds the guard design.
Key Files
scripts/imaging/likelihood_breakdown/fixed_light_trace.py: the phase-B cell, which gets the captured-lane mode.scripts/misc/likelihood_breakdown/library_solver_injection.py: extracts per-lane certified flags.hpc/batch_gpu/submit_breakdown_imaging_fixed_light_certified_policy_a100_hst_fp64: the template for the new submit.results/notes/certified_solver_policy_phase_b_2026_09.md: the phase-B baseline.
Original Prompt
Click to expand starting prompt
Certified solver phase C1 — uncertified-lane rate and batched timing on real Nautilus batches
Type: feature
Target: autolens_profiling
Repos:
- autolens_profiling
Themes: - profiling
- inversion
- hpc-gpu
Difficulty: medium
Autonomy: supervised
Priority: normal
Status: sliced 2026-09-24 — measurement only; release block overridden by the human ("Build it now against main", then "yes meaurement only"): runs against library mains incl. unreleased PyAutoArray#567, no library edits
Epic: certified-positive-solver
Phase: C1
Consequence: judge
Witness: captured real Nautilus proposal batches at production n_batch=20 (euclid pipeline source_pix stages) for HST Delaunay N=1500 and rectangular; A100 fp64 replay under library certified+fallback none jit(vmap) reporting the uncertified-lane rate (overall and by Nautilus phase) and max passes vs budget 16; matched timing table at B=16/20/50/100 (PDIP vmap, certified+none vmap, scalar certified+PDIP, scalar PDIP) with every lane <= 1e-9 against scalar library PDIP; a verdict note deciding C2 (draft/feature/autofit/certified_solver_batched_guard_c2.md).
Review-minutes: 20
Unattended: no
Filed: 2026-09-24
Scope (sliced 2026-09-24)
Only item 1 (measure) and item 4 (vmap policy stated with batch size) of the original What below.
Items 2-3 (flag + Fitness fallback) moved to C2. Verdict rule: build C2 only if projected guarded
cost (certified+none batch + rate x scalar certified+PDIP re-run) at B=20 is >= 15% below the best
zero-code option (library PDIP vmap; or scalar certified via config opt-in + use_jax_vmap=False on
the pixelized stages), with the rate near zero.
Why
Certified-solver phase B (autolens_profiling#300, PR #302; note
autolens_profiling/results/notes/certified_solver_policy_phase_b_2026_09.md) measured the library
solvers under the production composition jax.jit(jax.vmap(fn)) on an A100. Under vmap the
certified solver's PDIP fallback lax.cond becomes a select, so every lane pays both solvers:
certified+PDIP is slower than library PDIP at every B (B16: 45.6 vs 38.9 ms/lane Delaunay, 38.6 vs
30.7 rectangular). Certified with certified_fallback="none" is the fastest batched row (B16 1.50x
Delaunay / 1.25x rectangular over PDIP vmap) and passed the 1e-9 gate with 0 uncertified lanes, but
with none an uncertified lane silently returns the last active-set iterate.
The policy adopted by the human on 2026-09-24 ("This sounds good, follow the proposed plan.") keeps
library PDIP as the vmap default now and moves to certified+none only once an uncertified-lane guard
exists. This prompt is that guard (policy item 4), plus the measurement that decides whether it is
worth building.
What
- Measure first (autolens_profiling). The phase-B lanes were one seeded draw family near the
fiducial. Measure the uncertified-lane rate (and max passes vs the packaged budget 16) on real
Nautilus batches: lanes drawn across the prior / from an actual Nautilus run's proposal batches,
Delaunay and rectangular, at the batch size Nautilus uses in production. At a rate near zero the
guard is cheap; at a high rate the host-side second pass erodes the gain and the vmap default
should stay PDIP. Record the verdict before any library work. - Per-lane certified flag (small PyAutoArray / PyAutoGalaxy surface). The vmapped likelihood
also returns the per-lanecertifiedflag of the positive-only solve (the library already
exposes it through thestats=out-dict), threaded out through the fit soFitnesscan see it
without changing the scalar return contract. - Cond-free fallback (PyAutoFit).
Fitness._vmap(autofit/non_linear/fitness.py) runs the
batch with certified + fallback none, then re-evaluates only the uncertified lanes through the
scalar certified+PDIP program (a rare, host-side second pass outside the traced program) and
splices their values back. Result: certified+none batch cost with PDIP semantics. - State the vmap policy with the batch size (policy item 5): against the scalar certified
default the best batch wins only at B16 (1.14x / 1.15x), ties at B8 and loses at B4 — the policy
must name the Nautilus batch size it applies to; small batches stay scalar.
Context
- Epic: certified-positive-solver. Phase A = PyAutoArray#566 / PyAutoArray#567 (opt-in certified solver).
Phase B = autolens_profiling#300 (policy grid, A100 array 350588). - The scalar default flip (certified + PDIP fallback on
jit(fn)only) was retired 2026-09-24 as
superseded by this phase (complete/2026/09/certified-solver-scalar-default-flip.md): production
always runsjit(vmap), so this phase is the lever that reaches real fits. - Delaunay carries a ~2e-10 run-to-run nondeterminism floor and a ~2.5e-9 cross-composition
residual (program properties, not solver); do not draw pins tighter than 1e-9 on Delaunay.
Activity
Jammy2211 commentedon Sep 24, 2026
Progress: code done, A100 jobs submitted (2026-09-24)
Branch
feature/certified-solver-phase-c1-lane-rate, pushed with no PR yet:ae12a71: capture script,--lanes capturedreplay, A100 submit and tests.f59f84d: regularization freed with production priors, and--stage pix1|pix2added.source_pix_1.source_pix_2.pytest scripts/misc/test/: 834 passed, 5 skipped. ruff,build_readme --checkandcheck_submits --checkare clean.RAL (worktree
/mnt/ral/jnightin/autolens_profiling_wt/certified-solver-phase-c1-lane-rate; libraries are at the local mains, including #567):afterok:350659).Laptop test (CPU, n_batch=4, 60 lanes each, prior and exploration phases only; this proves the code runs and is not the measurement):
nonevalues differ from PDIP by up to 3e-4 relative.Remaining: pull the results, write the verdict note and provenance, apply the verdict rule, then run ship_workspace. B=100 may run out of GPU memory (the PSF cube is about 389 MB per lane).
fix(#304): rectangular pix2 capture frees Adapt, as production source…
fix(#304): forward PyAutoArray #572 `preconditioning`; rectangular pi…
results(#304): phase C1 lane-rate replay on A100 (array 350768) — gat…
docs(#304): record the human's C1 decisions (2026-09-25)
Jammy2211 commentedon Sep 25, 2026
Shipped to PR — 2026-09-25
PRs
Summary
Phase C1 replayed real
af.Nautilusproposal batches (HST fixed-light; Delaunay N=1500 and rectangular 39x39; pix1 and pix2) on an A100 in fp64 (RAL arrays 350659 / 350766 / 350768). The pre-registered own-composition 1e-9 gate FAILED. It is recorded as it came out and was not loosened. The uncertified-lane rate is 1.9–4.9% at B=20 and 0 in the late half of every run. B=50jit(vmap)returns wrong likelihoods on 44–50/50 lanes, which is filed asPyAutoMind/draft/bug/autoarray/batched_jit_vmap_b50_wrong_log_likelihood_a100.md. B=100 runs out of memory.Session Notes
## Decisions (human, 2026-09-25)section (results/notes/certified_solver_phase_c1_lane_rate_2026_09.md). C2 proceeds under a pre-registered near-peak nats gate. Rectangular pix1 stays on library PDIPjit(vmap).Heart RED override
Development-only override per
PyAutoBrain/AUTONOMY.md"Human override for Heart RED (development only)". It permits commit, push and opening the PR only. Merge is not authorized.Authorization (live human, 2026-09-25). The agent asked:
The human replied, verbatim: "do these:" followed by that item.
Heart RED reasons at ship time (verbatim):
release validation FAILED (stage integrate)Branch gates passed (78cd546):
build_readme.py --checkexit 0;check_submits.py --check11 contracted, 0 failing;pytest scripts/misc/test/834 passed, 5 skipped.Merge requires a separate human /prm with all required checks green. Heart remains RED for release purposes. This PR does not fix Heart.
Merge pull request #309 from PyAutoLabs/feature/certified-solver-phas…
Jammy2211 commentedon Sep 25, 2026
Shipped
Merged: #309 (merge commit 21875f3, 2026-09-25).
Phase C1: uncertified-lane rate on real Nautilus batches
n_batch=20(HST fixed-light, Delaunay N=1500 + rectangular pix1/pix2) on RAL (captures 350659 / 350766, replay 350768) and replayed them on an A100 at fp64 under certified + fallbacknonejit(vmap).noneiterates.draft/bug/autoarray/batched_jit_vmap_b50_wrong_log_likelihood_a100.md.results/notes/certified_solver_phase_c1_lane_rate_2026_09.md.Shipped under a recorded development-only Heart RED override (release validation FAILED at stage integrate, not caused by this branch).
Next: C2,
draft/feature/autofit/certified_solver_batched_guard_c2.md.