Skip to content

fix: calibrated wall model for phase-4 submit estimates (0.55–89.5× → 0.56–1.59×) - #70

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/validation-wall-model
Nov 16, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/validation-wall-model

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #69. Fixes the phase-4 wall-estimate bug (likelihood-lifecycle epic, phase 4; prompt validation_wall_estimates_miss_eval_count_and_sampler_floor.md).

What was wrong

validation_p4.py priced each stage as profiled per-call × an evaluation count. Against the SLURM walls of the completed phase-4 legs it missed by 0.55–89.5×, for three reasons. It had no per-evaluation sampler floor and no startup term. Its evaluation-count proxy was 2.7–2.9× low for multi_galaxy (the one leg that timed out, 414160). And its per-eval basis was wrong in places: parametric source_lp stages of pixelized chains were priced at the pixelized per-call, numba parallel efficiency was missing, and multi_dataset's profiled per-call is a vmap batch-3 OOM fallback. Reproduced on main 158257d: --list printed exactly the finding's estimates (106 s, 1 s, 11 s, 4835 s, 43239 s…).

The fix: one calibrated wall model (scripts/misc/wall/model.py)

evals   = 4.30 · n_live · d^1.637 · EVALS_FACTOR[dataset_type]     # per stage
seconds = evals · (14 ms floor + price)                             # price = the per-call the stage pays
job     = 30 s startup + Σ stages
  • d and n_live are the stage's free parameters and live points (properties of the model, read from the phase-4 stages.json rows by stage_shapes()).
  • price: Pulse's per-call; for numba, divided by cores × the cores-sweep efficiency (1/0.68/0.62/0.55/0.36/0.28); for a parametric source_lp stage of a pixelized chain, the dataset type's MGE per-call (numba: 3× the JAX CPU one); and two cited overrides where profiling doesn't price the fit's evaluation (multi_dataset's OOM-fallback per-call → its single-jit 110 ms; cluster image-plane's PointSolver per-eval cost).
  • Fitted to the completed, non-resumed phase-4 stages on 2026.10.25.1. Resumed stages are excluded (414362).

validation_p4.py prices every stage with it. The proxy tables (_4C2_IMAGING_EVALS, EVALS_FROM, the 4c-3 declared ceilings) are gone, and --time follows the new estimate (3× headroom, 6 h rounding, 5-day cap). The 43 submits are regenerated: 8 legs that were held at the 5-day containment cap are now priced, and multi_galaxy/mge JAX CPU goes from 6 h to 1 day. datacube/delaunay has no phase-4 row and stays at the cap.

Witness

python scripts/misc/campaigns/validation_p4.py --validate re-prices every leg with completed, non-resumed phase-4 rows against what it took (the summed stage total_wall_s of the slowest seed plus startup; on the 23 legs sacct was read for, the summed rows sit 1.00–1.09× below ElapsedRaw):

ok   0.56x  actual     1515 s  estimate     2719 s  submit_p4_validation_interferometer_mge_sma_jax_cpu_dense_nufft  (414155)
ok   0.71x  actual    23653 s  estimate    33352 s  submit_p4_validation_multi_dataset_delaunay_hst_jax_gpu_dense  (413976)
ok   0.78x  actual      338 s  estimate      434 s  submit_p4_validation_interferometer_mge_sma_jax_gpu_dense_nufft  (413973)
…
ok   1.46x  actual    31640 s  estimate    21632 s  submit_p4_validation_multi_galaxy_mge_hst_jax_cpu_dense  (414641)
ok   1.50x  actual    55064 s  estimate    36662 s  submit_p4_validation_group_rectangular_euclid_numba_cpu_sparse  (414153)
ok   1.59x  actual      539 s  estimate      340 s  submit_p4_validation_cluster_source_plane_simple_jax_gpu_na  (413967)
42 legs; 0 outside 0.5-2x (actual / estimate)

test_wall_model.py fails if any leg leaves 0.5–2×. check_submits --check: 70 submits, 0 failing. validation_p4 --check: clean. pytest: 471 passed, 2 skipped. Phase 5: wall/README.md says 5E reuses this model, and a line is queued for the likelihood-lifecycle epic (5E context) through the shift ledger.

Decision taken (decide-and-flag) — please judge

The fit is in-sample. The constants are fitted to the same phase-4 rows the witness checks. The checks that don't depend on that: the per-dataset-type factors are medians over many stages, not per leg. The source-plane point count is checked against committed sampler rows the fit never saw (4850 against a modelled 4855). Single stages scatter up to ~3× around the law; the model is accurate on whole jobs.

One cited override is effectively a measurement of its leg. PER_EVAL_OVERRIDE for cluster/image_plane (0.060 s A100, 0.049 s CPU) comes from that leg's own rows (413966, 414145). Its profiled per-call (0.2 ms vmap) does not price the image-plane PointSolver fit at all; without the override that leg reads 3–4×. The alternative is to leave it out of band and fix the profiling upstream. This is the decision for the human.

Ship gate (supervised, batch launch 2026-11-16-pm)

  • Tests: pytest scripts/misc/test -q: 477 passed, 2 skipped (full suite at 4ac3458); ruff check and format clean; build_readme --check and export_inference_summary --check clean. No downstream library.
  • Smoke: n/a. autolens_inference has no curated workspace smoke surface (scripts/misc only; the CI Smoke job runs on the PR).
  • Review (leg 3): independent Opus review: FINDINGS on a683263. It found (1) the band is in-sample and the cluster override is that leg's own cost, unstated; (2) the startup is added to both sides; (3) a test was dropped. All three were fixed in 4ac3458 (in-sample caveat with held-out numbers in model.py, wall/README.md and the epic note; the test restored). Re-review: CLEAN.
  • Heart: pyauto-heart readiness --dev --repos autolens_inference → green. Shown, non-blocking (organism YELLOW, acknowledged at launch in the shift brief): local-checkout behind/dirty rows, manifest drift, release rehearsal, PyAutoArray PR 13d.
  • Independent adversary (leg 5, Sonnet): Witness HOLDS on all four clauses. Checked independently against the finding's sacct ElapsedRaw: 20 legs at 0.59–1.61× sacct/estimate. 42 of 43 legs validated; datacube has no rows. Caveats (in-sample fit, the startup flattering the shortest legs) are disclosed above.

Tier: judge — merge mode: human /prm

🤖 Generated with Claude Code

Jammy2211 and others added 3 commits November 16, 2026 18:10
Phase-4 submit wall estimates missed the measured SLURM walls by 0.55-89.5x:
no per-evaluation sampler floor and no startup term, an evaluation-count
proxy 2.7-2.9x low for multi_galaxy, and a per-eval basis wrong in places
(numba parallel efficiency, parametric source_lp stages priced at the
pixelized per-call, the multi_dataset vmap OOM-fallback per-call).

- scripts/misc/wall/model.py: one calibrated model fitted to the completed,
  non-resumed phase-4 stages (2026.10.25.1): evals = 4.30 n_live d^1.637
  x a per-dataset-type factor; each evaluation costs a 14 ms floor plus the
  per-call the stage pays; 30 s startup per job; numba per-call over
  cores x the cores-sweep efficiency; cited overrides where profiling does
  not price the fit (multi_dataset OOM fallback, cluster image-plane solver).
- validation_p4.py prices every stage with it (stage shapes read from the
  phase-4 rows); the proxy tables (_4C2_IMAGING_EVALS, EVALS_FROM, the 4c-3
  declared ceilings) are removed; --time follows the new estimate; the
  submits are regenerated. --validate re-prices every completed phase-4 leg:
  42 legs, all 0.56-1.59x actual/estimate.
- Tests pin the witness (test_wall_model.py) and follow the model in the
  4c-1/4c-2/4c-3 tests. wall/README.md documents the model and that phase 5E
  reuses it.

Closes #69

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s_its_own_cell

Review findings on a683263: the 0.56-1.59x band is in-sample (constants fitted
to the rows --validate reads; the cluster image-plane override is that leg's
own cost); say so with the held-out numbers in model.py and wall/README.md;
document that actual_wall's startup flatters the shortest legs (sacct 0.59x);
restore the 4c-1 leaf/cell test the previous edit dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the decision-taken Unattended worker took a decision the plan did not settle label Nov 16, 2026
@Jammy2211
Jammy2211 merged commit 9f05aa9 into main Nov 16, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/validation-wall-model branch November 16, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

decision-taken Unattended worker took a decision the plan did not settle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: phase-4 wall estimates miss eval count, sampler floor and startup

1 participant