diff --git a/.github/workflows/lib-tests.yml b/.github/workflows/lib-tests.yml index 34b0d75f..ec89e3a7 100644 --- a/.github/workflows/lib-tests.yml +++ b/.github/workflows/lib-tests.yml @@ -326,6 +326,14 @@ jobs: # function cache out of the source trees (where it would be neither # restorable nor saveable) into the one directory those steps cache. JAX_COMPILATION_CACHE_DIR: ${{ github.workspace }}/.pyauto_jax_cache + # Persist EVERY compile, not only those over JAX's 1.0s default + # (autonerves setdefaults the same 1s whenever the cache dir is set; + # a preset value wins). Same reasoning and same knob as the smoke + # leg (PyAutoHeart#221): a unit suite is many small compiles, so + # under the 1s regime the restored cache holds almost nothing and + # every run re-pays them. The price is cache-artefact size; the way + # out is this one line, or an epoch bump to drop the fat caches. + JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS: "0" NUMBA_CACHE_DIR: ${{ github.workspace }}/.numba_cache run: | export JAX_ENABLE_X64=True diff --git a/tests/test_lib_tests_wiring.py b/tests/test_lib_tests_wiring.py index 7c2ae821..dce18efe 100644 --- a/tests/test_lib_tests_wiring.py +++ b/tests/test_lib_tests_wiring.py @@ -253,6 +253,17 @@ def test_the_suite_runs_under_both_cache_dirs_and_is_otherwise_untouched(): assert "--junitxml=test-results/junit.xml" in step["run"] +def test_the_suite_persists_every_compile_it_makes(): + """Same knob as the smoke leg (PyAutoHeart#221): JAX and autonerves only + persist an executable that took over a second to compile, and a unit suite + is many small compiles, so under that default the restored cache held + almost nothing. Exactly "0", not a smaller-but-nonzero value a faster + runner could silently drop a compile under.""" + step = _step(_steps("unittest"), "Run tests") + assert step["env"]["JAX_PERSISTENT_CACHE_MIN_COMPILE_TIME_SECS"] == "0" + assert "JAX_COMPILATION_CACHE_DIR" in step["env"] + + def test_the_record_step_runs_on_a_red_run_too_and_writes_the_sidecar(): """A red run's cache state is exactly as interesting as a green one's — and the artifact it rides in is uploaded either way."""