Skip to content

build: pack the app with LZMA and the x86 branch filter (17.6 MB) - #3

Merged
PAumedes merged 2 commits into
mainfrom
build/lzma
Oct 14, 2026
Merged

PAumedes merged 2 commits into
mainfrom
build/lzma

Conversation

@PAumedes

@PAumedes PAumedes commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

The download goes from 20.8 MB to 17.6 MB, and the first start of a version from ~7 s to ~5 s.

  • The app's tar now goes through 7-Zip's x86 branch filter (BCJ: call/jump targets made absolute, so calls to one function repeat) and is compressed with LZMA (64 MB dictionary, longest matches), using the LZMA SDK's public-domain C# code (Queueify.Launcher/Lzma).
  • Dropping Brotli also takes its native code out of the starter: 2.4 MB → 1.6 MB.
  • The starter refuses an archive header the packer never writes (bad dictionary size, literal settings, length) as "damaged", before allocating anything.
  • package.ps1's size budget goes from 24 to 20 MB. ADR-0008 records the measurements (Brotli 18.4, Brotli+BCJ 16.8, LZMA 17.6, LZMA+BCJ 15.9 MiB for the archive).

Tests: X86FilterTests (round trip on random data and real program code; calls to one function look alike after filtering), Bundle round trip with real executables, wrong headers under a matching id. The adversarial review fuzzed the filter against the reference Bra86.c (200,000 seeds, real DLLs, an 80 MB buffer) with no mismatch, and approved.

🤖 Generated with Claude Code

The download goes from 20.8 MB to 17.6 MB: 7-Zip's branch filter makes
call targets repeat, LZMA (the LZMA SDK's public-domain C# code) finds
them, and the starter loses Brotli's native code. First start ~5 s.
A bad dictionary size or literal setting under a matching id now says
"damaged" instead of a raw overflow. Review nits: comments, ADR units.
@PAumedes
PAumedes merged commit 4a84fa1 into main Oct 14, 2026
1 check passed
@PAumedes
PAumedes deleted the build/lzma branch October 14, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant