build: make_game leaves one CPU thread free by default, as the launcher's Automatic does #932
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!932
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:build/jobs-leave-one-free"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: build · Risk: low · Tested on: Linux, game-free checks · Needs: none
Why
A build from the command line started one compiler per CPU thread, so for its whole length the PC had no thread to spare:
the desktop, a browser or a game in another window lagged while it built. The launcher's Automatic already leaves one
thread free (
SystemInfo.AutomaticWorkers: every thread but one). Builds without the launcher now do the same. I searchedthe tracker (
forge.py issue list) and found no issue for this.What changed
make_game.pystarts at most one compiler per CPU thread but one when neither--jobsnorLONGSHOT_JOBSnames anumber, never fewer than one. The free-memory gate (issue 418) still holds any of them back as before.
default_jobs()innx2/make_game.pyreturnsmax(1, threads - 1); its log line says so.tests/test_default_jobs.pycutsdefault_jobsout of the source and runs it with the CPU count stubbed(24, 16, 8, 4, 2, 1 and unknown).
docs/development.md, theLONGSHOT_JOBSrow.Measurements
Nothing to measure in the game: a build script's default, held by its new check (at most one compiler fewer, so the compile stage takes at most about 1/23 longer on 24 threads).
Flags and settings
LONGSHOT_JOBS/--jobskeep their meaning; only the automatic default changes.LONGSHOT_JOBSunset (automatic)Testing
Tested: On Linux (24 threads), with
--jobs 23:python -I -B tests/test_default_jobs.py(3 tests OK) andpython -I -B tests/run_all.py build_log default_jobs(2 passed). I also ran the whole suite with the Vulkan, SPIR-V andVMA headers given: 588 passed, 20 failed, 22 skipped. The same 20 fail on another branch without this change. They
don't run
default_jobs(sandboxed sockets and disk, and checks that need tools not on this PC):test_linux_update,test_make_game_cache,test_lift_cleanup_error,test_bake_portability,test_crt_options,test_crash_dialog,test_env_on,test_appimage_player_build,test_linux_preflight,test_missing_nup,test_options_budget_once,test_pipeline_states,test_mods_size_table,test_pipeline_tour,test_readback_late,test_replay_write_order,test_nonuniform_image_arrays,test_vk_pgo,test_walk_key,test_vk_occlusion_queries.Not tested: A full game build with the new default. The function only picks a number, and that number goes to
build.py --jobsas an explicit--jobswould.Must be tested: None.
Risks
What could break: Nothing functional. A build with no
--jobson a 2-thread PC now compiles one file at a timeinstead of two.
Turning it off:
LONGSHOT_JOBS=<threads>for the old count, or revert the commit.Compatibility: Nothing changes for a player: the launcher passes its own number, and the AppImage's builds now
leave one thread free too.
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.🤖 Generated with Claude Code
Measurements as one line: a build default, held by tests/test_default_jobs.py
WIP: build: make_game leaves one CPU thread free by default, as the launcher's Automatic doesto build: make_game leaves one CPU thread free by default, as the launcher's Automatic does