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

Merged
OreoFR merged 2 commits from upstream-pr/2924 into main 2026-12-01 19:30:09 +00:00
OreoFR commented 2026-12-01 18:39:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T18:39:01Z.


Claimed in the coordination issue as CI-STANDALONE-J8: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7321253464

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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5592109614 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2924). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T18:39:01Z. --- Claimed in the coordination issue as **CI-STANDALONE-J8**: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7321253464 ### 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](https://claude.com/claude-code)
merzleckeier commented 2026-12-01 18:53:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T18:53:28Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7321753596 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2924#issuecomment-7321753596). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T18:53:28Z. --- 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 commented 2026-12-01 18:57:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T18:57:48Z.

Review: DISMISSED


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6137950137 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2924#pullrequestreview-6137950137). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-01T18:57:48Z. **Review:** DISMISSED --- 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).
KelboLive commented 2026-12-01 19:05:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T19:05:18Z.

Review: COMMENTED


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6138078143 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2924#pullrequestreview-6138078143). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T19:05:18Z. **Review:** COMMENTED --- 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 commented 2026-12-01 19:28:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T19:28:30Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7322878359 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2924#issuecomment-7322878359). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T19:28:30Z. --- **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).
merzleckeier commented 2026-12-01 19:50:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T19:50:48Z.


Same-host timing for the full Linux standalone step at 93ffc482 vs its #2924 merge tree ab374c7d (be4e237e). I ran the exact workflow step from each tree three times on the same four physical Ryzen 7 7800X3D cores under Linux, using CPython 3.14.10.

Workers Wall time in seconds Median
4 130.381, 133.161, 134.916 133.161
8 113.994, 112.325, 116.852 113.994

The eight-worker median was 19.167 seconds (14.39%) shorter. Every run exited 0 with the same 655 unique test files and zero file failures. This measures the local Linux step under four-core affinity. MEASURED, AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7323545160 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2924#issuecomment-7323545160). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T19:50:48Z. --- Same-host timing for the full Linux standalone step at `93ffc482` vs its #2924 merge tree `ab374c7d` (`be4e237e`). I ran the exact workflow step from each tree three times on the same four physical Ryzen 7 7800X3D cores under Linux, using CPython 3.14.10. | Workers | Wall time in seconds | Median | | --- | --- | ---: | | 4 | 130.381, 133.161, 134.916 | 133.161 | | 8 | 113.994, 112.325, 116.852 | 113.994 | The eight-worker median was 19.167 seconds (14.39%) shorter. Every run exited 0 with the same 655 unique test files and zero file failures. This measures the local Linux step under four-core affinity. MEASURED, AI-assisted (Codex).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2924
No description provided.