Skip to content

feat(smoke-tests): JAX compile + simulated-dataset caches across runs; cache state on every timing row - #211

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/ci-test-timing-epic-ke2lul
Sep 6, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
claude/ci-test-timing-epic-ke2lul

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #210. Phase 7 of the ci-timing-fast-tests epic (PyAutoMind draft/feature/pyautoheart/ci_timing_fast_tests_epic.md), pulled ahead of the phase-5/6 rebuild waves per the epic ledger's review: the waves then target what remains once compile is cached, and their before/after is measured on one cache state.

Summary

The reusable smoke workflow every workspace / _test / HowTo gate calls had no actions/cache step, so the JAX persistent compilation cache autonerves already writes was discarded between runs, and dataset/ (gitignored in every workspace) was re-simulated on every run. The legacy digest (#209) shows that in both _test flagships the time sits in ~15 compile-dominated jax_likelihood scripts.

  • JAX compile cache — JAX_COMPILATION_CACHE_DIR set to an explicit workspace path in the runner env (the runner copies the job env into every script subprocess, so all scripts share one cache); actions/cache/restore + save keyed on runner OS × Python leg × jaxlib version × a manual epoch salt (PYAUTO_CACHE_EPOCH, job-level env, bump to invalidate everything), run-id suffixed so each save is a fresh superset (accumulating-cache pattern). Saved even on a red run (an entry is complete or absent) and only when the cache actually changed.
  • Simulated datasets — workspace/dataset restored/saved keyed on the hash of every simulator script × the dependency-chain HEAD SHAs × the salt, with no broader fallback: a different simulator or library commit must miss. Not keyed on the Python leg. Safe by construction: should_simulate keeps a restored dataset only while its resolution regime matches and re-simulates otherwise. Saved only on a green run (a killed simulator can leave a truncated FITS that should_simulate would keep).
  • Cache state on every timing row — a Record cache state step (if: always()) writes test-results/cache_state.json (restored key, hit/miss, size and entry counts before/after) into the report dir the existing smoke-timings-<py> upload already globs. smoke_timings ingests it: legs, rollup items, board lines ( [jax cache hit|miss]) and the timings/scripts record carry cache, and drift is never classified across two known but different jax cache states — a cold run after a hot baseline is a recompile, not a regression. Artifacts from before the sidecar read unknown and compare exactly as before.
  • Blast radius — this workflow is referenced @main by eleven repos: every new step has continue-on-error: true, the runner command is byte-identical (its env: gained one variable), the upload step is untouched, and the whole diff is additive (243 insertions, 0 deletions in the workflow).

API Changes

No public API change. smoke_timings gains parse_cache_state / cache_view / read_cache_state, a cache= keyword on classify_drift, and additive cache / cache_jax / prev_cache_jax fields; timings record lines gain cache; previous_script_rows rows gain cache_jax.

Test Plan

  • python3 -m pytest -q -n auto — 864 → 893 passed (11 in new tests/test_smoke_tests_wiring.py pinning step order, non-fatality, key components, the single dataset restore-key, the if: conditions and the unchanged runner command; 11 + 4 + 3 appended). One existing exact-equality expected dict gained the new cache_jax: "unknown" key; nothing weakened.
  • yaml.safe_load on the workflow; the record step's Python and the two bash steps executed locally against a fake workspace; tenant firewall check OK
  • After merge: the first PR run on a _test repo restores nothing and saves; the second restores (cache_state.json shows hit, board line [jax cache hit]); compare jax_likelihood per-script seconds and gate p50 hot vs cold in timings/scripts/ and timings/gates.jsonl, and the restore/save overhead on autocti_workspace_test (3 entries). Numbers go into the issue's Shipped comment and the epic ledger.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba


Generated by Claude Code

…; cache state on every timing row (#210)

The reusable smoke workflow now restores and saves the JAX persistent
compilation cache (keyed on runner OS x Python leg x jaxlib x a manual epoch
salt) and the workspace's simulated datasets (keyed on the simulator-script
hash x the dependency-chain SHAs x the salt, no broader fallback), both as
non-fatal steps, and writes test-results/cache_state.json so every per-script
row the Heart ingests says whether it ran hot or cold. smoke_timings, the
timings/ record and the board carry that state additively, and drift is never
classified across two different known cache states. Readiness verdict and
badge untouched; the runner command is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
@Jammy2211
Jammy2211 merged commit bfcd302 into main Sep 6, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the claude/ci-test-timing-epic-ke2lul branch September 6, 2026 01:07
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.

feat(smoke-tests): CI caches — JAX compile cache + simulated datasets across runs, cache state on every timing row

2 participants