Skip to content

echo.wasm exceeds the website's 25 MiB asset limit #12110

Description

@Anton-4-bot

The website (roc-lang/www.roc-lang.org) cannot switch to a current nightly's echo.wasm. It runs the module through wasm-opt -Oz --converge (binaryen version_130) and refuses anything over Cloudflare's 25 MiB asset limit (26,214,400 bytes, MAX_ASSET_SIZE in ci_scripts/prepare_compiler_wasm.mjs):

Error: Browser compiler exceeds Cloudflare's 25 MiB limit: 48530489 bytes

That was with nightly-2026-10-04-130536d. The website is still pinned to a legacy echo.wasm from 2026-07-10, which blocks the automated nightly update (roc-lang/www.roc-lang.org#154).

Where the bytes are (upstream main, c34079d4cd, ReleaseSmall)

Part Size
Builtin.artifact.bin (embedded, data section) 27.79 MB
Builtin.bin (embedded, data section) 11.76 MB
Other data (rodata, Builtin.roc source) 1.26 MB
Code 11.13 MB
Total 51.96 MB (48.5 MB after wasm-opt)
  • The two builtin blobs are 76% of the module. Playground does not embed Builtin.artifact.bin, which is why it is about half echo's size.
  • Code is almost all the real pipeline: postcheck 4.3 MB, check 2.0 MB, lir 1.4 MB, can 0.76 MB. No meaningful native-backend or LLVM code is linked (under 10 KB).
  • The blobs compress roughly 10x with zstd: 39.6 MB to 4.1 MB at level 9.
  • From published nightlies: Jul 10 to Aug 9 grew mostly in data (+7.5 MB, code +1.3 MB). Aug 9 to Oct 2 grew mostly in code (+5.1 MB, data +3.7 MB).
  • wasm-opt only trims about 7%, mostly zero runs inside the blobs.

Plan

  1. Embed the builtin blobs zstd-compressed in echo.wasm only. Decompress them with std.compress.zstd on the first compileAndRun. Native builds keep the raw blobs.
  2. Add zig build check-echo-wasm-size and run it in the web_wasm CI lane. It fails when the raw ReleaseSmall echo.wasm exceeds 25 MiB and warns from 90%.

Issue authored by Claude Opus 5.5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions