tests: the supplied-runtime build keeps its --jobs 3 on a 2-vCPU machine (OLD-10056) #692

Manually merged
github merged 1 commit from gh-pr/692/head into gh-pr/692/base 2026-11-26 09:16:44 +00:00
Owner

@⁠Poussistar on GitHub · 2026-11-24 12:16 UTC · original
Poussistar:tests/make_game-pipelines-host-jobs → main · +4 −1 · 1 files · 1 commits · merged 2026-11-24 13:09 UTC

Claimed in the coordination issue as: OLD-10056

What

tests/test_make_game_pipelines.py::test_windows_reuses_the_checker_from_the_supplied_runtime_build asks for --jobs 3 and then compares the value that reached the checker. make_game.main() clamps --jobs to the host CPU count first (leonida_tui.clamp_jobs, make_game.py:2989), so on a machine with fewer than three logical CPUs the assertion compares the clamped value and fails with 2 != 3.

#83 pinned the two other assertions of this class and missed this one.

Change

Pin make_game.leonida_tui.os.cpu_count to 16 around that main() call, with the same wording as the two pins #83 added in this file. Test-only: clamp_jobs and make_game.py are untouched, and test_jobs_default_calculation_scenarios keeps the clamp covered.

This carries the tests/test_make_game_pipelines.py part of my old pull request 10056, which draft #322 reopened verbatim from old-pr/10056 and which conflicts with main since #83 merged.

Tested

Base 21625bca8 (current main), Linux x86-64, Python 3.14.7, no game files, no GPU. python -I implies -E, so PYTHON_CPU_COUNT never reaches the test: the core count is patched in-process instead.

cores tests/test_make_game_pipelines.py before after
2 1 failure: AssertionError: 2 != 3 Ran 18 tests ... OK
4 (this machine) OK OK
256 OK OK

tests/test_make_game_argparse.py also passes at 2, 4 and 256 cores before and after (untouched).

Negative control: with the pin removed, the 2-core run is red again (FAILED (failures=1)), so the pin is what makes it host-independent.

AI-assisted. No game files.

**@⁠Poussistar** on GitHub · 2026-11-24 12:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/692) `Poussistar:tests/make_game-pipelines-host-jobs` → `main` · +4 −1 · 1 files · 1 commits · merged 2026-11-24 13:09 UTC Claimed in the coordination issue as: `OLD-10056` ## What `tests/test_make_game_pipelines.py::test_windows_reuses_the_checker_from_the_supplied_runtime_build` asks for `--jobs 3` and then compares the value that reached the checker. `make_game.main()` clamps `--jobs` to the host CPU count first (`leonida_tui.clamp_jobs`, `make_game.py:2989`), so on a machine with fewer than three logical CPUs the assertion compares the clamped value and fails with `2 != 3`. #83 pinned the two other assertions of this class and missed this one. ## Change Pin `make_game.leonida_tui.os.cpu_count` to 16 around that `main()` call, with the same wording as the two pins #83 added in this file. Test-only: `clamp_jobs` and `make_game.py` are untouched, and `test_jobs_default_calculation_scenarios` keeps the clamp covered. This carries the `tests/test_make_game_pipelines.py` part of my old pull request 10056, which draft #322 reopened verbatim from `old-pr/10056` and which conflicts with `main` since #83 merged. ## Tested Base `21625bca8` (current `main`), Linux x86-64, Python 3.14.7, no game files, no GPU. `python -I` implies `-E`, so `PYTHON_CPU_COUNT` never reaches the test: the core count is patched in-process instead. | cores | `tests/test_make_game_pipelines.py` before | after | |---|---|---| | 2 | 1 failure: `AssertionError: 2 != 3` | `Ran 18 tests ... OK` | | 4 (this machine) | `OK` | `OK` | | 256 | `OK` | `OK` | `tests/test_make_game_argparse.py` also passes at 2, 4 and 256 cores before and after (untouched). Negative control: with the pin removed, the 2-core run is red again (`FAILED (failures=1)`), so the pin is what makes it host-independent. AI-assisted. No game files.
make_game.main() clamps --jobs to the host CPU count through
leonida_tui.clamp_jobs, so test_windows_reuses_the_checker_from_the_supplied_runtime_build
compared the clamped value: at 2 CPUs it asserts '2' != '3'. #83 pinned the
other two assertions that ask for more jobs than a small runner has and missed
this one.

Reproduced on 21625bca8 with os.cpu_count() patched in-process (python -I
implies -E, so PYTHON_CPU_COUNT never reaches the test): 2 CPUs = 1 failure,
4 and 256 CPUs = pass. With the pin: pass at 2, 4 and 256. Negative control:
removing the pin turns the 2-CPU run red again.

Test-only; clamp_jobs and make_game.py untouched. Carries old PR 10056
(tests/test_make_game_pipelines.py part), which #322 reopened as a draft.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:16:43 +00:00
github manually merged commit ce5d643b24 into gh-pr/692/base 2026-11-26 09:16:44 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 12:18 UTC · original · approved these changes

Technical Review: APPROVE (OLD-10056)

  1. Root Cause & Correctness:

    • Accurately addresses the remaining host CPU core count dependency in test_make_game_pipelines.py by pinning make_game.leonida_tui.os.cpu_count to 16.
    • Prevents spurious test assertion failures on 2-vCPU CI workers where clamp_jobs clamps --jobs 3 to 2.
    • Clean test-only patch matching the established pattern from #83.
  2. Clean-Room & Verification:

    • Clean-room confirmed via check_no_game_data.py.
    • Verified 18/18 tests pass in test_make_game_pipelines.py.
    • Clean merge against main at 21625bca8 (0 conflicts).

LGTM!

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 12:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/692#pullrequestreview-6039052794) · **approved these changes** ### Technical Review: APPROVE (OLD-10056) 1. Root Cause & Correctness: - Accurately addresses the remaining host CPU core count dependency in test_make_game_pipelines.py by pinning make_game.leonida_tui.os.cpu_count to 16. - Prevents spurious test assertion failures on 2-vCPU CI workers where clamp_jobs clamps --jobs 3 to 2. - Clean test-only patch matching the established pattern from #83. 2. Clean-Room & Verification: - Clean-room confirmed via check_no_game_data.py. - Verified 18/18 tests pass in test_make_game_pipelines.py. - Clean merge against main at 21625bca8 (0 conflicts). LGTM!
Author
Owner

@⁠Dezmonius on GitHub · 2026-11-24 12:44 UTC · original

Independent Windows 10 22H2 check of ce5d643 against 21625bc, CPython 3.14.7. I used the interpreter flag python -I -X cpu_count=N and confirmed that os.cpu_count() in each process reported the selected value.

Logical CPUs Pipeline tests on main Pipeline tests on PR Argparse JobsHandlingTest
2 17/18, supplied-runtime case reports '2' != '3' 18/18 4/4 on both
4 18/18 18/18 4/4 on both
16 18/18 18/18 4/4 on both

This confirms the failure from the #322 review is fixed in the narrowed follow-up. The full pipeline test file and the four job-handling tests used synthetic fixtures.

AI-assisted (Codex).

**@⁠Dezmonius** on GitHub · 2026-11-24 12:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/692#issuecomment-7131848901) Independent Windows 10 22H2 check of `ce5d643` against `21625bc`, CPython 3.14.7. I used the interpreter flag `python -I -X cpu_count=N` and confirmed that `os.cpu_count()` in each process reported the selected value. | Logical CPUs | Pipeline tests on main | Pipeline tests on PR | Argparse `JobsHandlingTest` | | --- | --- | --- | --- | | 2 | 17/18, supplied-runtime case reports `'2' != '3'` | 18/18 | 4/4 on both | | 4 | 18/18 | 18/18 | 4/4 on both | | 16 | 18/18 | 18/18 | 4/4 on both | This confirms the failure from the #322 review is fixed in the narrowed follow-up. The full pipeline test file and the four job-handling tests used synthetic fixtures. AI-assisted (Codex).
This discussion has been locked. Commenting is limited to contributors.
No description provided.