Repository navigation
feat(ci): JAX + numba caches in lib-tests.yml, numba cache in smoke-tests.yml - #217
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
This was referenced Sep 7, 2026
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 #215. Census option O1 of the
ci-timing-fast-testsepic, widened by one finding made while reading the workflows:smoke-tests.ymlcached JAX and datasets only — numba sat at/tmp/numba_cachewith no restore and no save, so every smoke run compiled numba cold.What changes
lib-tests.yml(unittestjob only;unittest-nojaxis untouched and its wiring test asserts that)PYAUTO_CACHE_EPOCHsalt;Resolve cache keys(jaxlib, full python version);Restore the JAX compile cacheper (OS, py leg, jaxlib);Restore the numba cacheper (OS, full python);Stamp source mtimes from content;Measure the caches before the run;Record cache statewritingtest-results/cache_state.json(jax + numba sections) so it rides the existingunit-timings-<py>artifact;Save …steps gated on a measured change, saving on red too.Run testsgains anenv:block naming both cache dirs; therun:text is byte-identical. Every new step iscontinue-on-error: true.smoke-tests.ymlNUMBA_CACHE_DIRmoves from/tmpto the restored-and-saved workspace path (env only, command unchanged); the sidecar gains anumbasection andnumba_changedoutput; the same content-stamp step.The one non-obvious mechanism. numba stamps every cache entry with its source file's
(st_mtime, st_size)(numba/core/caching.py) and stores it under a directory named for the source's directory. A fresh clone or a freshpip installgives every.pya new mtime, so a restored numba cache would miss every entry it holds. Both workflows therefore rewrite each.py's mtime as a function of its content hash before anything compiles: identical content hits, changed content misses. That is what makes the prefixrestore-keysfallback safe and lets the numba key carry no library commit.Ingest, record, board
smoke_timings.parse_cache_statereadsnumba(absent section →unknown, since older sidecars predate it — unlikejax/datasets, absence is not evidence of a miss);cache_viewcarries it;classify_driftgainsprev_cache_key(defaultcache_jax, unchanged for scripts).unit_timingsreads the sidecar into every leg, the rolluprepos[]carriescache, and the unit drift rule refuses two known but different combined states (heart.timings.unit_cache_state:hitonly when jax and numba both hit,missonly when both missed, elseunknown), carried in the record ascache_state.timings/unit/<repo>.jsonllines gaincache: {jax, numba}; scripts lines gainnumba; the board brackets the state on the unit suite line and extends the scripts bracket to[jax cache hit, numba hit]only when numba is known.timings/README.mdschemas updated; a dated correction appended to the census §5.3 (nothing rewritten).Validation
python3 -m pytest -q -n auto: 893 → 924 passing. Both workflows parse; every heredoc is valid Python; the stamp script was exercised against a scratch tree.timings/unit/<repo>.jsonlandtimings/scripts/<repo>.jsonlwith the daily runs after merge. GitHub cache scoping means a PR-branch save is invisible tomain, so the firstmainrun after merge misses and seeds and the second hits. The workflows are consumed@main, so the callers see this only after merge.Guard
Settings and caches only — the closed jax-compile-time arc's verdict is honoured exactly; no test, likelihood or sampler changed;
--xla_cpu_multi_thread_eigen=falseis untouched wherever it is set.Worth a reviewer's eye
cache_viewreadsdatasets: "miss"(the libraries' workflow has no dataset cache); it is contained — the unit record and the unit board line carry jax + numba only."1"and are independent knobs.🤖 Generated with Claude Code
https://claude.ai/code/session_01WYcmRnZf3cbC5Wth9bCkEg
Generated by Claude Code