feat(build): Automatic build workers leave one CPU thread free #89

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:feat/build-workers-leave-one into main 2026-11-15 17:27:30 +00:00
Owner

With Build workers on Automatic, the build ran one compiler per CPU thread (make_game's own automatic), which can make the PC hard to use while the game builds. Automatic now asks for every thread but one. A number set in Build workers is used as it is.

What changed

  • Core/SystemInfo.cs: the new AutomaticWorkers() returns the CPU threads less one, and at least 1.
  • App/ViewModels/BuildStepViewModel.cs: the build request passes AutomaticWorkers() when the setting is Automatic. On Linux that is --jobs, and on Windows LONGSHOT_JOBS, as for a set number. Before, nothing was passed and make_game took every thread.
  • App/ViewModels/SettingsStepViewModel.cs: the Build workers description says "{n-1} of {n} at once" and "{n-1} of {n} workers (automatic)". The time estimate (BuildThreads) uses the same count. The texts are unchanged, only their numbers, so no translation changes.
  • The compilers still take only the memory that is free (nx2/build.py MemoryGate), as before.

The Beanstalk test farm's agent makes the same change for its builds.

Tested (CachyOS, Linux 7.3)

  • python -I tests/test_launcher_core.py: 1163 checks passed, including a new check that AutomaticWorkers() is the threads less one. The App builds (Release), and the lock files are unchanged.
  • python -I tests/test_release.py: OK.

Not tested: a real build with it. A build with one worker fewer takes slightly longer on a PC with few threads; on a 4-thread PC that is 3 compilers instead of 4.

With Build workers on Automatic, the build ran one compiler per CPU thread (make_game's own automatic), which can make the PC hard to use while the game builds. Automatic now asks for every thread but one. A number set in Build workers is used as it is. **What changed** - `Core/SystemInfo.cs`: the new `AutomaticWorkers()` returns the CPU threads less one, and at least 1. - `App/ViewModels/BuildStepViewModel.cs`: the build request passes `AutomaticWorkers()` when the setting is Automatic. On Linux that is `--jobs`, and on Windows `LONGSHOT_JOBS`, as for a set number. Before, nothing was passed and make_game took every thread. - `App/ViewModels/SettingsStepViewModel.cs`: the Build workers description says "{n-1} of {n} at once" and "{n-1} of {n} workers (automatic)". The time estimate (`BuildThreads`) uses the same count. The texts are unchanged, only their numbers, so no translation changes. - The compilers still take only the memory that is free (`nx2/build.py` MemoryGate), as before. The Beanstalk test farm's agent makes the same change for its builds. **Tested** (CachyOS, Linux 7.3) - `python -I tests/test_launcher_core.py`: 1163 checks passed, including a new check that `AutomaticWorkers()` is the threads less one. The App builds (Release), and the lock files are unchanged. - `python -I tests/test_release.py`: OK. **Not tested:** a real build with it. A build with one worker fewer takes slightly longer on a PC with few threads; on a 4-thread PC that is 3 compilers instead of 4.
feat(build): Automatic build workers leave one CPU thread free
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
64998bbde5
Automatic used every CPU thread (make_game's own automatic), which can make
the PC hard to use while the game builds. It now asks for every thread but
one (SystemInfo.AutomaticWorkers); a number set in Build workers is used as
it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch feat/build-workers-leave-one 2026-11-15 17:27:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!89
No description provided.