build(release): a smaller longshot-builder, and updates that resend little of the game's Rust #3094
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3094
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:build/smaller-builder"
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?
Summary
longshot-builder is a 260 MB download on Linux and 190 MB on Windows, and an update between two nightlies is often 33 to 36 MB.
This change:
--rsyncable. A small change in it then changes a small part of the compressed bytes, so today's whole-file deltas resend little of it. Old builders read it as before; the update format and signing are unchanged.KEEP). A player further behind than about 15 releases downloads the whole file.Read first:
builder/crates/build-driver/src/sources.rs(the member's compression and its key), thenscripts/longshot_builder.py(the stripping).Testing
Tested: Linux, RTX 3090, driver 620.70.06.
dev.py smoke: PASS, in play from kokiri-start for 900 frames, the menu opened..rdatadiffers, the output's name).build-driver,releaseandlongshot-packager: clean. Their tests: one failure,dev_runtime::tests::a_copy_links_the_builders_files_clones_the_rest_and_refreshes_in_place("game_folder_busy"), in a file this PR does not touch.tests/run_all.py: 866 passed, 10 failed, 12 skipped. The failures have not yet been compared withmain.Still to test:
--rsyncable: a release run with publish off after merge, expectingrelease sourcesto pass (by hand). If a runner's zstd refuses it, releases fail at that step; there is no fallback.Measurements
Verdict: the full builder is about 35 MB smaller on each platform, and a delta between two recent nightlies about a sixth of today's (estimates from rebuilt builders; no release has been made with this).
Setup: "before" is the published nightly-1022 (main at
b4d56f52); "after" is that builder rebuilt with this PR's stripped files and rsyncable member, not a release made from the PR's commit; this PC's zstd 1.5.7; deltas are nightly-1021 to 1022.The numbers still hold on this PR's base, main
1c91b18f: its published builder (nightly-1039) is the same size, 260.2 MB on Linux and 190.5 MB on Windows.b4d56f52c31e6588Risks
module+offsetcrash reports,HOS_PROFILEand developers' own builds are unchanged.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (run; failures not yet compared withmain)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e2fJhRpDrY7pgVx6oJ
Possibly related, for context:
@review
Recommendation: Request changes. Reducing delta coverage makes players 11–25 releases behind download the full builder where a delta chain could previously be used. The reported size savings are promising, but the release workflow that enables stripping and a game built with the stripped library still need verification.
The change adds optional symbol stripping, makes the carried Rust library’s compression more delta-friendly, and reduces the number of release delta bases. It can reduce downloads for recent updates, at the cost of much larger downloads for some players who update less often and less direct crash information.
Blocking (1): must change before merging.
builder/crates/longshot-packager/src/release_deltas.rs:36: Keeping only two bases makes updates substantially larger for players who are more than ten releases behind. (more on the line) Do: Keep five delta bases, or provide another update path that preserves coverage for those players while reducing release work.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
scripts/longshot_builder.py:597: The stripped library has not yet been used to build and play the game. (more on the line) Do: Build and play with the release-style stripped library on Linux and Windows, checking that the build and game work as before.builder/crates/build-driver/src/sources.rs:742: The actual release runners and shipping artifacts have not yet demonstrated the claimed download savings. (more on the line) Do: Run release packaging without publishing on both release runners, compare full and representative delta sizes against the base, and verify the resulting packs can be read.@fixcan do L1.Questions (2) (not confirmed from the code; they don't hold the recommendation)
builder/crates/build-driver/src/sources.rs:1734: Is there a current input or configuration where the compressor omits the rsyncable arguments despite these tests passing?Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven for the shipping release. The PR reports rebuilt Linux and Windows builders shrinking from 260.3 to 224.9 MB and 190.5 to 156.2 MB, and one nightly delta shrinking from 36.0 to 4.1 MB and 32.9 to 5.3–7.1 MB. These are estimates from rebuilt artifacts, not releases made by the changed workflow; the comparison is against a published nightly rather than a measured base-commit release.
Other systems: Both platforms consume the changed packs and stripped library. The author reports that both stripped programs start and that linking all library members produced equivalent code and data, but has not built and played a game with the stripped library. Release-runner zstd compatibility and stripping on a Windows host are also untested. The delta retention change affects both channels and platforms; saves, settings, rendering, audio and input are not directly changed.
Switches: Adds --symbols to build and game-rust, both absent by default; absence preserves the existing unstripped output. The release workflow must opt in. No player-facing environment switches are added or changed.
Reviewed:
87a945b8dbagainst1c91b18f86: Read the repository rules, PR template, commit messages, diff, changed Python and test files, and the relevant compression, delta selection, chain and release-documentation paths. Skimmed the remaining portions of the large Rust source files, Cargo.toml and reference documents. docs/review-checklist.md and the adjacent Tooling checkout were not present; the separate release workflow was not available in this checkout.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run, as requested. The PR reports game-free Linux tests and Windows startup under Wine before the last rebase; CI is still running.
Overlaps and merge order: The PR describes a separate release-workflow change, but its identity and merge order were not available in the supplied context.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -733,0 +739,4 @@/// compressed bytes of what is far from it as they were, and a delta between releases resends less of the member: for/// 0.4 to 0.7 MB more of it. `-B256KB` asks for the smallest blocks; zstd raises it to its own least (512 KB since/// 1.5, 1 MB before). It needs a zstd built with threads, as the distributions' are.pub const RSYNCABLE_ZSTD: [&str; 2] = ["--rsyncable", "-B256KB"];L3 (should fix): The actual release runners and shipping artifacts have not yet demonstrated the claimed download savings.
When: The release now requires a zstd supporting these arguments, while the measured sizes came from local rebuilt builders and an estimate for the older runner. A runner that rejects the arguments fails release packaging, and its actual delta sizes may differ.
Do: Run release packaging without publishing on both release runners, compare full and representative delta sizes against the base, and verify the resulting packs can be read.
@ -35,1 +34,3 @@pub const KEEP: usize = 5;/// How many earlier releases of the channel a release has deltas from: each is a builder compared and uploaded per/// platform; a launcher further behind applies a chain of them (the release crate's chain.rs) or takes the full file.pub const KEEP: usize = 2;L1 (blocking): Keeping only two bases makes updates substantially larger for players who are more than ten releases behind.
When: Once releases use this retention consistently, a player with a builder 11–25 releases behind cannot reach the target within the five-hop limit and downloads the full builder. With five bases per release, the chain can reach up to 25 releases back when the retained releases and deltas are available.
Do: Keep five delta bases, or provide another update path that preserves coverage for those players while reducing release work.
@ -479,2 +596,2 @@shutil.copyfile(built, out + ".new")os.replace(out + ".new", out)out = os.path.join(os.path.abspath(a.out), "liblongshot_rs.a")if a.symbols:L2 (should fix): The stripped library has not yet been used to build and play the game.
When: A release that opts into --symbols will carry the rewritten archive and player builds will link it; the reported member-link comparison does not exercise the complete player build and game.
Do: Build and play with the release-style stripped library on Linux and Windows, checking that the build and game work as before.
87a945b8dbc31e658830WIP: build(release): a smaller longshot-builder, and updates that resend little of the game's Rustto build(release): a smaller longshot-builder, and updates that resend little of the game's RustHumanBean referenced this pull request2026-12-03 18:12:38 +00:00
llun referenced this pull request2026-12-03 20:16:18 +00:00