Skip to content

Reduce test runtime and split CI into four shards - #1366

Merged
MilesCranmer merged 9 commits into
astroautomata:masterfrom
MilesCranmerBot:ci-shards
Sep 16, 2026
Merged

MilesCranmer merged 9 commits into
astroautomata:masterfrom
MilesCranmerBot:ci-shards

Conversation

@MilesCranmerBot

@MilesCranmerBot MilesCranmerBot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Split Linux, macOS, Windows, Conda and beartype test jobs into four deterministic shards after test filtering.
  • Preserve every environment/group invocation, test assertion and required Linux check name.
  • Reuse identical Julia test types to reduce compilation, and stop two checkpoint searches once their target loss is reached. Their assertions remain unchanged.

Verification

On hetzner-dev, the original suite took 35m22s; the optimized unsharded suite took 29m48s. Four isolated shards took 7m40s, 8m31s, 7m47s and 6m11s. These exclude CI setup and are not end-to-end GitHub timings.

The recorded acceptance run passed all 204 tests (203 original plus one sharding regression), four shards of 51 tests, and all 15 JAX/Torch tests. Exact test inventories and skips match. Preservation checks cover 227 original test methods and all 13 CI environment/group combinations. The sharding regression and actionlint were rerun before publication.

Upstream dependency

The clean full-suite and notebook acceptance used the installed wheel from JuliaPy/PythonCall.jl#818. Released JuliaCall can still hit the pre-existing Linux pytest shutdown crash. This PR does not pin an unreleased dependency, disable diagnostics, skip tests or relax timeouts. GitHub CI will measure the unchanged dependency configuration.

GitHub CI results

The initial sharded CI run passed all six workflows: Linux, macOS, Windows, Documentation, CodeQL and slurm. Elapsed time from workflow creation to final job completion, including setup and queueing:

Workflow Elapsed
Linux 16m37s
macOS 11m31s
Windows 17m00s

The earlier Linux baseline run 34501985449 took 38m15s; this run took 16m37s, about 57% less elapsed time. These are separate hosted-runner runs, not a controlled benchmark. The Linux sum of job runtimes increased from 244.1 to 337.4 minutes because each shard repeats setup and compilation.

This CI run passed with the existing dependency configuration and no PythonCall override. The upstream shutdown crash did not reproduce here; the earlier local acceptance caveat remains relevant.

Published-package canary

The canary run completes all 189 tests on both Windows versions after capturing output through a regular file, avoiding the Julia asynchronous-output hang. Five matrix jobs pass. Windows Python 3.10 still fails the existing worker-executable test in both import orders. The upstream fix is JuliaPy/PythonCall.jl#820; the canary continues to test released packages without dependency overrides or weaker assertions.

The upstream source-build comparison passes all 189 main/startup tests on both Windows Python 3.10 and 3.14, with the same three skips and the PySR 0.9.35 compatibility assignment removed. Both import orders also launch Python successfully from a Julia worker. The original startup-test file is identical across all eight configurations. These results verify the upstream repair; deployment still requires a coordinated PythonCall/JuliaCall release and a PySR dependency-range update.

Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pysr/_cli/main.py 63.63% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

MilesCranmerBot and others added 2 commits September 12, 2026 13:55
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
MilesCranmer
MilesCranmer previously approved these changes Sep 12, 2026
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
MilesCranmer
MilesCranmer previously approved these changes Sep 12, 2026
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
MilesCranmerBot and others added 3 commits September 12, 2026 19:33
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@MilesCranmer
MilesCranmer merged commit 1129d79 into astroautomata:master Sep 16, 2026
54 of 55 checks passed
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.

2 participants