Skip to content

perf(smoke-tests): trim the fixed per-leg overhead — depth-1 clones, pip wheel cache, setup_s as data - #218

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/smoke-fixed-overhead
Sep 7, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/smoke-fixed-overhead

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #216. Stacked on #217 (feature/lib-tests-compile-caches): both edit smoke-tests.yml, so this PR's diff shows #217's commit until that merges, after which it shrinks to its own commit (72be605). Merge #217 first.

Measured first

Six most recent Smoke Tests runs of autolens_workspace_test, 12 legs, from the Actions job-step timestamps (full per-leg table on #216):

quantity mean min max
chain clone 16.5 s 13 24
install (base + epilogue) 83.6 s 66 91
everything else before the runner ~4 s
setup_s (job start → first script) 104.3 s = 22.6 % of the job 86 119
runner (the scripts) 352 s 245 436

Install is the dominant fixed cost (80 % of the overhead), the clone is next (16 %), and the legacy digest's "~2–3 minutes per leg" over-estimates it — the measured range is 86–119 s.

What changes

  • Depth-1 clones of the chain and PyAutoHands, on the clone and on the matching-branch fetch alike. A shallow clone is single-branch, so the fallback becomes fetch --depth 1 origin "$BRANCH" + checkout -B "$BRANCH" FETCH_HEAD (verified against a scratch shallow clone; plain checkout "$BRANCH" fails with "did not match any file(s) known to git"). Its meaning is unchanged: a library PR is still tested against its workspace. rev-parse HEAD still answers for the dataset key, and a shallow source install still stamps 9999.0.0.dev0 — setup.py's VERSION default wins over setuptools_scm, checked by installing from shallow clones — so the intra-family >= floors are unaffected.
  • A pip wheel cache: actions/cache@v4 on ~/.cache/pip, keyed on the content of the chain's dependency declarations (*/pyproject.toml, */setup.py, the workspace's requirements*.txt) + python leg + PYAUTO_CACHE_EPOCH, prefix fallback, continue-on-error. The PyAuto libraries stay source installs; the wheels cached are the third-party ones underneath (jax, numpy, scipy, matplotlib, astropy). An explicit cache rather than setup-python's cache: pip because that one cannot be non-fatal, cannot carry the epoch salt, and hard-errors when cache-dependency-path matches no file while the chain is caller-supplied text.
  • setup_s as data: Mark job start (first step) and Mark scripts start (immediately before the runner), both non-fatal and env-free; the recorder differences them into the sidecar as setup_s (null when a mark is missing — never a fabricated 0). smoke_timings.parse_cache_state/cache_view carry it, timings/scripts/<repo>.jsonl lines record it beside cache, and the board appends · setup Ns to the per-repo line only when known. The runner command is byte-identical.
  • Reported, not done (on perf(smoke-tests): trim the fixed per-leg overhead — measure, depth-1 clones, pip cache #216): --no-deps for the chain once deps are installed (15–30 s more, but it moves the intra-family floor guarantee from pip to eleven workspace epilogues), prebuilt wheels (10–20 s, a second artefact per library that could serve the wrong commit), dropping --upgrade pip setuptools wheel (3–6 s, and it is the line that absorbs runner-image drift).

Validation

  • python3 -m pytest -q -n auto: 924 → 939 passing; the workflow parses; the recorder heredoc was executed standalone (setup_s = 104 with both marks, None with neither).
  • Wiring tests pin the --depth 1 flags and the fallback sequence, the cache step's key shape and non-fatality, the two marks' placement, the recorder's setup_s, and the runner command unchanged.
  • The before/after per-step table is read back from the Actions API after merge (same runner class), never from local numbers; the ceiling if both levers land fully is setup_s → ~15–25 s, roughly 80–90 s per leg across ~22 legs per PR wave.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WYcmRnZf3cbC5Wth9bCkEg


Generated by Claude Code

Jammy2211 and others added 2 commits September 6, 2026 23:58
…ests.yml

Census option O1 of the ci-timing-fast-tests epic, widened by one finding:
library CI is compile-bound and `lib-tests.yml` restored no JAX and no numba
cache, and `smoke-tests.yml` — which the census said "has both" — cached JAX
and datasets only, with numba at /tmp/numba_cache and no restore or save.

- lib-tests.yml (`unittest` job only): epoch salt, JAX compile cache per
  (OS, py leg, jaxlib), numba cache per (OS, full python), the
  `cache_state.json` sidecar riding the unit-timings artifact, saves gated on
  a measured change; every new step continue-on-error, pytest command
  byte-identical apart from env. `unittest-nojax` untouched.
- smoke-tests.yml: the numba cache beside the JAX one, the runner's
  NUMBA_CACHE_DIR moved under the workspace, a `numba` section in the sidecar.
- Both workflows stamp every source .py's mtime from its content hash: numba
  keys each entry on (mtime, size), so a fresh clone or pip install would
  otherwise miss every restored entry. Identical content hits, changed
  content misses, so the prefix fallback is safe and the numba key names no
  library commit.
- Ingest/record/board: `numba` in the sidecar parse (absent → unknown), unit
  legs and rows carry `cache`, the unit drift rule refuses two known but
  different combined jax+numba states (`cache_state`), the board brackets the
  state on both the scripts and the unit lines. README schemas updated; a
  dated correction appended to the census §5.3.

Tests 893 → 924. Hot-vs-cold lands in timings/unit and timings/scripts with
the daily runs after merge; a PR-branch save is invisible to main, so the
first main run seeds and the second hits.

Closes #215

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYcmRnZf3cbC5Wth9bCkEg
…pip wheel cache, setup_s as data

Measured over the six most recent Smoke Tests runs of one `_test` workspace
(12 legs, Actions job-step timestamps): the seconds before the first script
runs are 104 s mean = 22.6% of the job, and inside that the install is 83.6 s
(80%), the dependency-chain clone 16.5 s (16%), everything else ~4 s. The
"~2-3 minutes per leg" in the legacy digest over-estimates it; measured range
is 86-119 s. Table on PyAutoHeart#216.

- Chain + PyAutoHands clones are `--depth 1`, on the clone and on the
  matching-branch fetch alike; a shallow clone is single-branch, so the
  fallback is `fetch --depth 1 origin "$BRANCH"` + `checkout -B "$BRANCH"
  FETCH_HEAD` (verified against a scratch shallow clone; plain `checkout
  "$BRANCH"` fails). `rev-parse HEAD` still answers for the dataset key, and a
  shallow source install still stamps 9999.0.0.dev0 (setup.py's VERSION
  default wins), so the intra-family `>=` floors are unaffected.
- A pip wheel cache (`actions/cache@v4` on ~/.cache/pip) keyed on the content
  of the chain's dependency declarations + python leg + the epoch salt, prefix
  fallback, continue-on-error — an explicit cache rather than setup-python's
  `cache: pip` because that one cannot be non-fatal, cannot carry the salt,
  and hard-errors on a `cache-dependency-path` that matches no file while the
  chain is caller-supplied text.
- `setup_s` (job start -> first script) is now data: two non-fatal `Mark ...`
  steps and the recorder differences them into the sidecar (`null` when a
  mark is missing); `smoke_timings` and the record carry it, the board appends
  `· setup Ns` to the per-repo line only when known. Runner command untouched.
- Reported, not done (on the issue): `--no-deps` for the chain, prebuilt
  wheels, dropping `--upgrade pip setuptools wheel`.

Stacked on feature/lib-tests-compile-caches (#217): both edit this workflow.
Tests 924 -> 939.

Closes #216

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WYcmRnZf3cbC5Wth9bCkEg
@Jammy2211
Jammy2211 merged commit 551f165 into main Sep 7, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/smoke-fixed-overhead branch September 7, 2026 02:23
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.

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

1 participant