build(tools): Linux's compiler is built for x86 alone, half the size #3120

Merged
HumanBean merged 1 commit from HumanBean/Longshot:build/llvm-x86 into main 2026-12-03 21:34:53 +00:00
Owner

Summary

The Linux builder carries a compiler that can target every processor LLVM knows, though a game build only ever targets x86. It is the biggest thing in the download.

tools.lock's linux-x64 llvm is now LLVM 23.1.5 built from source with the X86 target alone: the same file list and version, built as upstream builds its release (ThinLTO, PGO, BOLT). The Linux builder gets about 50 MB smaller (estimate). Windows uses llvm-mingw and is unchanged.

Read first: builder/tools/llvm-from-source/build.sh (how the package was made) and the new paragraph in docs/dev/reference/releases.md.

Two things this gives up:

  • The builder's end-to-end test no longer runs in CI. The synthetic game is AArch64, which this clang cannot target, so LONGSHOT_E2E=1 is removed and the test says it is skipped.
  • The package is not reproducible. It was built on a team member's own PC and uploaded by hand (llvm-linux-x64 23.1.5-x64-2, SHA-256 8e4df133ad3588fd14eb1d62020deea7b4802b1bf2d1d7e23d30c85503d62c92). make.sh and the Longshot tools workflow do not make it.

Testing

Tested: Linux, RTX 3090: a full game build with the new compiler (dev.py game: 878 of 878 units, none failed, 4 min), then dev.py smoke on it: PASS, in play from kokiri-start for 900 frames, the menu opened. tests/test_tools_pins.py and test_tools_check.py pass. The binaries list x86 and x86-64 only, need at most GLIBC 2.34, and hold no home-folder paths. mise run test was not run.

Still to test:

  • Any Linux PC without AVX-512 (Intel before Ice Lake, AMD before Zen 4) beyond the build measured below: build the game and play, expecting no difference (by hand)
  • Shader preparation and upscaler builds with this compiler: a release build with them, expecting them to work as before (by hand)

Measurements

Verdict: half the compiler's size, with the same build time and the same compiled objects.

Setup: the AMD lab PC (i7-9700K), cold game builds from source of main 6167e8aa, no shader preparation or upscalers, runs interleaved. Runs with a CI job on the PC at the same time are left out.

Before: main @ 6167e8aa After: this PR @ 49178b6d
Compiler archive 96.3 MB 48.6 MB
Unpacked 407 MB 199 MB
Game build, wall (2 runs) 497, 497 s 498, 493 s
Game build, CPU 3359, 3349 s 3330, 3324 s
Peak memory, one process 2.76 GiB 2.74 GiB

The "after" column used the package this PR names. All 879 objects were byte-identical between the two compilers; longshot-game's code is the same size and the file differs by 256 bytes, cause not found. The numbers still hold on ca5d3078: the compiler and the compile flags are unchanged since 6167e8aa as far as this change goes.

Risks

  • A compiler fault would show as a failed or wrong game build on a player's PC. Reverting the tools.lock line restores the old package, which stays in the store.
  • Builder regressions that only the end-to-end test catches can now reach main.
  • Nothing changes in saves or settings. A player's next build recompiles everything once.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (not run)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ

## Summary The Linux builder carries a compiler that can target every processor LLVM knows, though a game build only ever targets x86. It is the biggest thing in the download. `tools.lock`'s linux-x64 `llvm` is now LLVM 23.1.5 built from source with the X86 target alone: the same file list and version, built as upstream builds its release (ThinLTO, PGO, BOLT). The Linux builder gets about 50 MB smaller (estimate). Windows uses llvm-mingw and is unchanged. Read first: `builder/tools/llvm-from-source/build.sh` (how the package was made) and the new paragraph in `docs/dev/reference/releases.md`. **Two things this gives up:** - **The builder's end-to-end test no longer runs in CI.** The synthetic game is AArch64, which this clang cannot target, so `LONGSHOT_E2E=1` is removed and the test says it is skipped. - **The package is not reproducible.** It was built on a team member's own PC and uploaded by hand (`llvm-linux-x64` `23.1.5-x64-2`, SHA-256 `8e4df133ad3588fd14eb1d62020deea7b4802b1bf2d1d7e23d30c85503d62c92`). `make.sh` and the *Longshot tools* workflow do not make it. ## Testing **Tested:** Linux, RTX 3090: a full game build with the new compiler (`dev.py game`: 878 of 878 units, none failed, 4 min), then `dev.py smoke` on it: PASS, in play from kokiri-start for 900 frames, the menu opened. `tests/test_tools_pins.py` and `test_tools_check.py` pass. The binaries list x86 and x86-64 only, need at most GLIBC 2.34, and hold no home-folder paths. `mise run test` was not run. **Still to test:** - Any Linux PC without AVX-512 (Intel before Ice Lake, AMD before Zen 4) beyond the build measured below: build the game and play, expecting no difference (by hand) - Shader preparation and upscaler builds with this compiler: a release build with them, expecting them to work as before (by hand) ## Measurements **Verdict:** half the compiler's size, with the same build time and the same compiled objects. Setup: the AMD lab PC (i7-9700K), cold game builds from source of main 6167e8aa, no shader preparation or upscalers, runs interleaved. Runs with a CI job on the PC at the same time are left out. | | Before: main @ 6167e8aa | After: this PR @ 49178b6d | |---|---|---| | Compiler archive | 96.3 MB | 48.6 MB | | Unpacked | 407 MB | 199 MB | | Game build, wall (2 runs) | 497, 497 s | 498, 493 s | | Game build, CPU | 3359, 3349 s | 3330, 3324 s | | Peak memory, one process | 2.76 GiB | 2.74 GiB | The "after" column used the package this PR names. All 879 objects were byte-identical between the two compilers; `longshot-game`'s code is the same size and the file differs by 256 bytes, cause not found. The numbers still hold on ca5d3078: the compiler and the compile flags are unchanged since 6167e8aa as far as this change goes. ## Risks - A compiler fault would show as a failed or wrong game build on a player's PC. Reverting the `tools.lock` line restores the old package, which stays in the store. - Builder regressions that only the end-to-end test catches can now reach `main`. - Nothing changes in saves or settings. A player's next build recompiles everything once. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). (not run) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
Author
Owner

Tested in game: Linux, RTX 3090, NVIDIA 620.70.06: full game build with the new compiler, then headless dev.py smoke: in play from kokiri-start, 900 frames, the menu opened.

Tested in game: Linux, RTX 3090, NVIDIA 620.70.06: full game build with the new compiler, then headless dev.py smoke: in play from kokiri-start, 900 frames, the menu opened.
build(tools): Linux's compiler is built for x86 alone, half the size
Some checks failed
PR description / Title and description (pull_request_target) Failing after 6s
49178b6dc7
tools.lock's linux-x64 llvm is now LLVM 23.1.5 built from source with the X86 target only
(builder/tools/llvm-from-source/build.sh): 48.6 MB against 96.3 MB compressed, 199 MB against 407 MB unpacked.
It cannot target AArch64, so CI no longer demands the synthetic game's end-to-end test, which then skips.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
HumanBean changed title from WIP: build(tools): Linux's compiler is built for x86 alone, half the size to build(tools): Linux's compiler is built for x86 alone, half the size 2026-12-03 21:34:48 +00:00
HumanBean deleted branch build/llvm-x86 2026-12-03 21:34:53 +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/Longshot!3120
No description provided.