Skip to content

perf(smoke-tests): trim the fixed per-leg overhead — measure, depth-1 clones, pip cache #216

Closed

Description

@Jammy2211

Overview

The legacy digest (timings/legacy_round_2026-09.md §1) measures the two _test flagships spending ~2–3 minutes per leg on checkout + install before the first script runs. That cost is identical on every PR and becomes the floor as phases 5–8 shrink the scripts. A first per-step read from the Actions jobs API, autolens_workspace_test run 34012149870 (main, both caches cold):

step py3.12 py3.13
Clone dependency chain + PyAutoHands 21 s 18 s
Set up Python 0 s 0 s
Install (base + the workspace's own epilogue) 86 s 78 s
Resolve keys / restores / measure / validate 1 s 1 s
Run the workspace runner 410 s 288 s
Record / upload / saves 3 s 2 s
job total 8 m 49 s 6 m 32 s

So the fixed cost is ~100–107 s per leg, four fifths of it pip install of the chain from source with no pip cache (lib-tests.yml has cache: pip; smoke-tests.yml does not), and the rest full clones of five libraries plus PyAutoHands.

Plan

  • Measure first, across the ten caller repos and the last N runs, and write the per-step table into this issue; the change is judged against it.
  • Depth-1 clones for the chain with the matching-branch fallback preserved exactly (a library PR must still be tested against its workspace).
  • A pip cache on setup-python (or an explicit actions/cache on ~/.cache/pip) so third-party wheels (jax, numpy, scipy, matplotlib, astropy) stop being re-downloaded; the PyAuto libraries themselves stay installed from source.
  • Record the fixed overhead as data (setup_s: job start → first script) beside the cache state so the board can show scripts vs overhead per leg.
  • Report on, do not do: --no-deps for the chain once deps are installed, prebuilt wheels, dropping --upgrade pip setuptools wheel.
Detailed implementation plan

Affected Repositories

  • PyAutoHeart (primary, only)

Branch Survey

Repository Current Branch Dirty?
./pyautoheart main (feature/lib-tests-compile-caches in progress for #215) clean

Suggested branch: feature/smoke-fixed-overhead — stacked on feature/lib-tests-compile-caches (#215) because both edit smoke-tests.yml; opened against main once #215 has merged, or rebased then.

Implementation Steps

  1. Measure: a small heart/ helper or one-off script that lists the last N Smoke Tests runs per caller repo via the Actions jobs API (HEART_TIMINGS_TOKEN path, as the ingester) and tabulates per-step seconds: checkout, chain clone, setup-python, arcticpy, install, restores, runner, record/upload/saves. Post the table here. If install is not the dominant fixed cost, stop and report.
  2. smoke-tests.yml clone step: git clone --depth 1 "https://github.com/$OWNER/$dep" "$dep"; the matching-branch fallback becomes git -C "$dep" fetch --depth 1 origin "$BRANCH" && git -C "$dep" checkout "$BRANCH"; the dataset-cache key's rev-parse HEAD still answers on a shallow clone.
  3. pip cache: actions/setup-python@v5 with cache: pip and cache-dependency-path covering the chain's requirements*.txt / pyproject.toml / setup.py files (they are cloned before setup-python runs, so the paths exist) — or an explicit actions/cache on ~/.cache/pip keyed on the hash of those files + python leg if setup-python's hashing cannot see them. Source installs of the PyAuto libraries stay from source.
  4. setup_s as data: record the seconds from job start to the runner step's start in the cache_state.json sidecar (or beside it) so smoke_timings can carry setup_s per leg and the record/board can show it; the drift rule is untouched.
  5. Wiring tests in tests/test_smoke_tests_wiring.py: the clone flags, the fallback fetch, the cache step, the runner command byte-identical, every new step non-fatal.
  6. Validate with a before/after per-step table on one _test repo from the Actions API (same runner class; never local numbers) after merge.

Key Files

  • .github/workflows/smoke-tests.yml — clone, setup-python, sidecar
  • heart/checks/smoke_timings.py, heart/timings.py, heart/dashboard.py — setup_s
  • tests/test_smoke_tests_wiring.py

Original Prompt

Click to expand starting prompt

PyAutoMind draft/feature/pyautoheart/smoke_workflow_fixed_overhead.md (moves to active/ with this issue). Measure the per-step fixed overhead of the reusable smoke workflow, then depth-1 clones with the matching-branch fallback preserved, a pip cache for the third-party wheels, and setup_s recorded as data; consider-and-report on --no-deps, prebuilt wheels and the --upgrade pip setuptools wheel line. Guard: runner command byte-identical, every new step continue-on-error, arcticpy path untouched unless measured.

Activity

  1. Jammy2211 commented on Sep 7, 2026

    @Jammy2211
    ContributorAuthor

    Per-step measurement (step 1 of the plan)

    Source: autolens_workspace_test Smoke Tests, the six most recent completed runs as of 2026-09-07, completed_at − started_at per job step in whole seconds. setup_s = job start → the runner step's start.

    Run Leg Chain clone setup-python Install Restores + measure Runner Saves setup_s Job total
    34012149870 (main) 3.12 21 0 86 1 410 2 111 529
    34012149870 (main) 3.13 18 0 78 1 288 1 100 392
    34011687612 (PR) 3.12 16 0 90 2 334 1 111 450
    34011687612 (PR) 3.13 15 0 87 4 320 2 108 435
    34011320470 (PR) 3.12 15 0 66 2 253 1 86 343
    34011320470 (PR) 3.13 16 0 83 2 356 1 103 464
    34009578427 (PR) 3.12 14 1 83 1 370 1 102 476
    34009578427 (PR) 3.13 16 0 80 1 245 1 100 350
    34008220773 (PR) 3.12 16 0 88 1 397 2 108 511
    34008220773 (PR) 3.13 13 0 86 1 383 1 102 490
    33908175450 (main, pre-cache) 3.12 14 0 85 — 436 — 101 540
    33908175450 (main, pre-cache) 3.13 24 0 91 — 434 — 119 559

    Aggregates over the 12 legs: chain clone 16.5 s mean (13–24), install 83.6 s (66–91), everything else before the runner ~4 s, setup_s 104.3 s = 22.6 % of the mean job total (462 s). Install is the dominant fixed cost (80 % of the overhead) and remarkably stable, which is what a step that is almost entirely third-party wheel download + install looks like; the clone is 16 %. The "~2–3 minutes per leg" in the legacy digest is an over-estimate against this window — it holds only if the runner-provisioning slack and queueing are counted.

    Both levers named in the plan target the right places: the pip wheel cache attacks the 84 s, depth-1 clones the 16.5 s. Ceiling if both land fully: setup_s → ~15–25 s.

    Reported, not done

    • pip install --no-deps for the chain once deps are installed. The epilogue runs three pip invocations, each re-resolving the whole third-party graph; resolving once and installing the five local trees --no-deps would plausibly save another 15–30 s per leg. Not done because --no-deps moves the guarantee that the intra-family >= floors are satisfied (e.g. autoarray needs autonerves>=2026.8.23.1 for the SMALLDAT regime stamp, whose violation is silent) from pip to whoever edits the epilogue — and the epilogue lives in each of eleven workspaces. Wants its own task, with the epilogue's resolved-version assertion extended to the family floors.
    • Prebuilt wheels for the chain. The libraries are pure Python, so the saving is only the five isolated build-backend invocations, maybe 10–20 s. It puts a second artefact of each library into the world and a new way for a gate to test something other than the commit it cloned; strictly worse than the --no-deps lever.
    • Dropping pip install --upgrade pip setuptools wheel. 3–6 s, less once the wheel cache lands. It is the one line that absorbs runner-image drift (pyproject.toml requires setuptools>=79.0); if ever removed, replace it with an explicit floor rather than nothing. Not worth touching on this measurement.

    Generated by Claude Code

  2. Jammy2211 commented on Sep 7, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    Merged in #218 (551f165), stacked on #217. The chain and PyAutoHands are --depth 1 clones with the matching-branch fallback preserved (fetch --depth 1 + checkout -B "$BRANCH" FETCH_HEAD); a pip wheel cache on ~/.cache/pip keyed on the dependency declarations + python leg + epoch salt; setup_s (job start → first script) is now a field in the sidecar, in timings/scripts/<repo>.jsonl and on the board's per-repo line. Tests 924 → 939.

    Baseline to judge against (the table above): setup_s 104 s mean per leg, install 84 s of it, clone 16.5 s. Read the post-merge value back from the record's setup_s after the callers' next main runs; the ceiling if both levers land fully is ~15–25 s. The three report-only levers (--no-deps, prebuilt wheels, the pip upgrade line) stay above as options, each wanting its own task. Mind record: PyAutoMind/complete/2026/09/smoke-fixed-overhead.md.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions