Repository navigation
perf(smoke-tests): trim the fixed per-leg overhead — depth-1 clones, pip wheel cache, setup_s as data - #218
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #216. Stacked on #217 (
feature/lib-tests-compile-caches): both editsmoke-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 Testsruns of autolens_workspace_test, 12 legs, from the Actions job-step timestamps (full per-leg table on #216):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
fetch --depth 1 origin "$BRANCH"+checkout -B "$BRANCH" FETCH_HEAD(verified against a scratch shallow clone; plaincheckout "$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 HEADstill answers for the dataset key, and a shallow source install still stamps9999.0.0.dev0—setup.py'sVERSIONdefault wins over setuptools_scm, checked by installing from shallow clones — so the intra-family>=floors are unaffected.actions/cache@v4on~/.cache/pip, keyed on the content of the chain's dependency declarations (*/pyproject.toml,*/setup.py, the workspace'srequirements*.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'scache: pipbecause that one cannot be non-fatal, cannot carry the epoch salt, and hard-errors whencache-dependency-pathmatches no file while the chain is caller-supplied text.setup_sas data:Mark job start(first step) andMark scripts start(immediately before the runner), both non-fatal and env-free; the recorder differences them into the sidecar assetup_s(nullwhen a mark is missing — never a fabricated 0).smoke_timings.parse_cache_state/cache_viewcarry it,timings/scripts/<repo>.jsonllines record it besidecache, and the board appends· setup Nsto the per-repo line only when known. The runner command is byte-identical.--no-depsfor 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,Nonewith neither).--depth 1flags and the fallback sequence, the cache step's key shape and non-fatality, the two marks' placement, the recorder'ssetup_s, and the runner command unchanged.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