Skip to content

ci: the standard-library test steps run 8 files at a time instead of 4 (CI-STANDALONE-J8) - #2924

Open
OreoFR wants to merge 2 commits into
ProjectLeonida:mainfrom
OreoFR:ci/standalone-j8
Open

OreoFR wants to merge 2 commits into
ProjectLeonida:mainfrom
OreoFR:ci/standalone-j8

Conversation

@OreoFR

@OreoFR OreoFR commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Claimed in the coordination issue as CI-STANDALONE-J8: #2570 (comment)

What and why

The two standard-library test steps of the CI workflow run their files 8 at a time instead of 4 (scripts/run_standalone_tests.py -j 8):

  • check (Windows): "Tests (standard library only, no game data)"
  • linux-python-and-viewer: "Tests (standard library only, Linux)"

Nothing else changes: same selection, same runner script, same reports.

Baseline, main's last green CI run (17:50 UTC today, check job):

step time
whole check job ~12.5 min
"Tests (standard library only, no game data)": 655 files, one Python process each, -j 4 10.5 min (17:51:56 to 18:02:27)
"Tests (standard library only, Linux)" in linux-python-and-viewer, -j 4 ~5.2 min

The runners have 4 cores. The bet is that each file spends much of its time starting a Python process and its imports, so more files at once shortens the step without asking for more runners. Splitting into more jobs was not taken: today the longer delay was jobs queued ~20 min for free runners, and more jobs would make that worse.

How it is judged

This pull request's own CI gives the after-timings of both steps. It is kept only if both steps are clearly shorter and the job as green as before; otherwise I close it. I will post the before/after numbers here once the run is done.

Review

A .github/ change: a second human maintainer is needed. Aslan agreed to the attempt (relayed by OreoFR from Discord: "sure, go ahead").

AI-assisted: yes, Claude Code agent oreofr-agent for OreoFR. Nothing run locally beyond reading the workflow and the runner; the measurement is the CI run itself.

🤖 Generated with Claude Code

…4 (CI-STANDALONE-J8)

On main's last green run the `check` job took ~12.5 min, 10.5 of them in
"Tests (standard library only, no game data)": 655 files, one Python process
each, 4 at a time on a 4-core runner. The Linux step of
`linux-python-and-viewer` took ~5 min the same way. Eight at a time is tried
to shorten both without asking for more runners; this pull request's own CI
gives the timings to compare.

Agreed to by a second human maintainer (Aslan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OreoFR
OreoFR requested a review from MoonEyes December 1, 2026 18:41
@aslan2142 aslan2142 self-assigned this Dec 1, 2026
@merzleckeier

Copy link
Copy Markdown
Contributor

Standalone worker cap and file selection verified at 968602e4 on main 60f7dcd9. Applying the workflow predicate to both checkouts gave byte-identical manifests of 655 files. I also ran three synthetic repetitions at each workflow setting using the checked-out run_standalone_tests.py. Peak concurrency was four on the old argument and eight on the new argument in every repetition. All 12 subprocesses finished in each run, both injected failures were annotated, and the runner returned exit status 1. This covers worker scheduling and failure reporting. Hosted CI duration remains a separate measurement.

MEASURED with synthetic child processes on Linux. AI-assisted (Codex).

@MoonEyes MoonEyes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read at 968602e47. The change is what it says: two -j 4 become -j 8, nothing else in the workflow moves.

One blocker, one line: tests/test_ci_registration.py:816 (StdlibLoopTest.test_step_script_reads_the_check_loop) asserts that the check loop contains python -I scripts/run_standalone_tests.py -j 4. I ran that file on this head (Windows 11, Python 3.14): 18 tests, 1 failure, this one. check and linux-python-and-viewer run the same file, so both go red. Changing the -j 4 in that assertion to -j 8 fixes it. (Line 780's copy is only the runner.)

Not a blocker, for when the timings are in: the runners have 4 cores, so please give both steps before and after, as the description says, and look at the files that time out or start servers: those are the ones that get flaky with twice as many processes.

Not done: no run of the whole suite at -j 8.

AI-assisted: yes (Claude Opus 5.5).

… 8 (CI-STANDALONE-J8)

`test_step_script_reads_the_check_loop` pins the runner line of the step; it
follows the workflow's new value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@KelboLive KelboLive left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is exactly the two stdlib steps (ci.yml:118, :203) plus the pinned assertion (tests/test_ci_registration.py:816); the runner is untouched. At be4e237e on Windows I get 18/18 for test_ci_registration.py, 5/5 for test_run_standalone_tests.py, and the full manifest at -j 8 runs 655 files exactly once, 0 failed (4m02s on a 32-core host). Failure reporting still names each file (scripts/run_standalone_tests.py:49-51), and there is no shard layer to drop or duplicate a path — I checked the selection and the run are set-identical. Dropping one path from the runner makes both the runner tests and the stdlib-loop test fail, so a silent loss is caught.

Two caveats before merge:

  1. This host does not exercise the real risk: 8 Python processes on the runner's 4 cores is 2× oversubscription, which a 32-core run cannot reproduce. The flake surface is timing — 34 subprocess/HTTP calls with ≤5 s timeouts, test_gallery's 3 s loopback requests and its adjacent-ephemeral-port probe (test_gallery.py:734-756). The step time headroom is large (10.5 min of 30), so a slower step is acceptable; a timeout is the thing to watch.
  2. MoonEyes' request-for-changes was on 968602e4; the one blocker (the stale -j 4 assertion) is fixed here, but this head has no review yet, and the before/after step timings the description promises are not posted.

Merge is clean against current main, and no other open PR touches .github/workflows/ci.yml (#2923 edits d3d12.yml).

@OreoFR

OreoFR commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Before / after, MEASURED from the CI runs (one run each side, so runner-to-runner noise is not ruled out):

step main, -j 4 (run 46705679253 on 27613ab6b, 17:50 UTC) this PR, -j 8 (run 46720892738, head be4e237e0)
check job, whole 12 min 37 s 8 min 15 s (-34 %)
"Tests (standard library only, no game data)", Windows 10 min 31 s 6 min 29 s (-38 %)
"Tests (standard library only, Linux)" 5 min 13 s 3 min 45 s (-28 %)

All six checks green, same files run (655 on Windows). The second commit only moves test_ci_registration.py's pinned runner line from -j 4 to -j 8.

Ready for review by a maintainer other than OreoFR (this is under his account).

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.

5 participants