Repository navigation
Builder: let the player choose how much memory a build may take - #1090
Merged
hckrman101 merged 4 commits intoNov 10, 2026
Merged
Conversation
Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An update started from the game or the launcher shows no menu, so it always built with Automatic. The Build memory choice is now saved with the other builder settings and an update selects it before it runs. Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
corentinbonjour
force-pushed
the
builder/build-memory-choice
branch
from
November 10, 2026 18:50
93b0cb9 to
86ff22c
Compare
Contributor
Author
|
Rebased onto main with #1047 and went through the review inline. Screenshots are in the description now: the two menus, and Build memory open on a 32 GB PC. The choice is also saved now, so an update started from the game or the launcher uses it instead of always building with Automatic. |
The tick sat in the 160 px Build workers column and its label was cut to "Prepare shaders nov". It now spans both menus on the row below. Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
tests/test_builder_dlss_update.py compiles UpdateBuild alone, without the window's controls, so the selection there broke it. BeginUpdate runs before every UpdateBuild and already reads the saved settings. Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
soltros
added a commit
to soltros/Longshot
that referenced
this pull request
Nov 11, 2026
Adopts and adapts NotRexed/Hookshot#1090 by corentinbonjour, original head d08aaed17bb606c4aacd9f6b7bd5f296151de6f4. Preserve Longshot documentation and reject MB conversion overflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


A player whose other programs hold a lot of RAM is held near the memory gate's floor of compilers, even when asking for every thread, and has no way to let the build take more. This adds a Build memory choice for that.
What changed
The Windows builder gets a Build memory (GB) menu beside Build workers. Automatic is the default and leaves the free-memory policy as it is. The other choices go in 4 GB steps up to the step at or just above the PC's memory (32 on a 32 GB PC that Windows reports as 31.6).
A number sets
HOOKSHOT_MEM_LIMIT_GBfor that build's child process.MemoryGatethen starts a compile when the needs of the running compilers plus its own fit in that limit, whatever is free. The floor stays the same as Automatic's (up to 4 compilers on Windows, one on Linux), so a small number never runs fewer compilers than Automatic.The choice is saved in
builder-settings.jsonwith the other settings. An update started from the game or the launcher shows no menu, so it selects the saved choice before it runs; without one, or when this PC's menu no longer offers it, it uses Automatic.Prepare shaders now moves to its own row under both menus: in the 160 px Build workers column its label was cut to "Prepare shaders nov".
The variable also works from the command line and on Linux, which has no menu. It is documented in the readme and
CONTRIBUTING.md. A value that is not a finite number above 0 (many,0,nan,inf,1e309) falls back to Automatic.The build files path is hidden in this screenshot, and the install folder was set to a sample path.
Why
Build workers sets how many compilers may run, but the memory gate still decides how many do. A player with a lot of RAM in use by other programs has no way to say the build may take more, and is held near the gate's floor even when asking for every thread.
The trade-off is the player's: past the free memory, Windows pages and the PC slows down, and Linux may stop a compiler. A compiler that fails is already compiled again alone at the end.
How it was tested
tests/test_mem_limit.py, picked up bytests/run_all.py: invalid and non-finite values fall back to the free-memory policy, a limit never reads the free memory, keeps Automatic's floor, compiles wait and resume by the sum of their needs, the floor's compiles start even over the limit, and the countdown's estimate follows the limit.tests/test_mem_gate_leases.py(Keep compile memory reservations per invocation #1047) passes: it now also loadsmem_limit_mband runs with the variable empty.tests/builder_workers: the menu's choices, invalid selections, the value reaching the child process next to the DLSS SDK argument, the saved choice read back, settings saved before this change meaning Automatic and a 64 GB PC offered every step up to 64 (103 checks pass).dotnet buildof the builder: 0 warnings, 0 errors.tests/test_builder_dlss_update.pypasses (25 checks): it compilesUpdateBuildalone, so the saved choice is selected inBeginUpdate, which runs before everyUpdateBuild.python -I -B tests/run_all.pyon Windows, with the .NET 8 SDK onPATH: the same 63 failures as untouchedmainat 51de681, none new. On this PC they come from missing tools and symlink rights, and 141 checks are skipped. In CI the failing checks (test_present_ahead,test_present_semaphores,test_nup_out_of_space,test_wayland_libdecor_hint,test_draw_parameters, and thehookshot_vk.dlllink) fail onmainat 51de681 too.Not tested: a complete game build or update started with a limit, so there is no measured build time for any limit yet.
Notes
Rebased onto #1047's leases:
enterstill returns its ownlease = object()andrunningstays keyed by it, so each compile is counted on its own.Build workers is still not saved, so updates keep Automatic for it, as before.
Refs #502.