GeezerVison is showing github.com — id(roc): F11.15 smaller example modules — wasm-opt -Os + strip, all 7 rebuilt ≤400 KB (#555) by dezren39 · Pull Request #1453 · developing-today/code
Conversation
dezren39
commented
Oct 27, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
F11.15 — smaller example modules (#555)
Implements #555 (Path to Phase 12, #1235 step 12). Every checked-in Roc example module was 526–686 KB because the builds used --debug with no optimize/strip step.
Change (all 7 pkgs/id/examples/*/build.sh):
- Drop
--debug from the roc build invocation.
- Resolve
wasm-opt the same way the scripts already resolve wasm-tools (env override → PATH → nix store binaryen → nix run nixpkgs#binaryen --).
- After the build:
wasm-opt -Os --all-features, then wasm-tools strip (DWARF/custom sections; the name section is kept so Wasmtime trap traces still resolve), then wasm-tools validate.
--all-features is required: the current Roc nightly emits post-MVP features (e.g. bulk-memory memory.copy, newer reference types) that binaryen's default feature set rejects at validation (Fatal: error validating input). The optimized output is re-validated by wasm-tools validate in the script and by the sandbox suite in CI.
Toolchain used for this rebuild: roc --version = nightly-2026-10-06-c34079d (the compiler pin itself is #541, step 13, sequenced after this step in #1235).
Sizes (bytes, committed blobs)
| Module |
Before |
After |
| lounge |
678,409 |
168,963 |
| roc-chat |
685,561 |
168,328 |
| roc-counter |
526,219 |
29,894 |
| roc-grid |
572,968 |
53,477 |
| roc-screen |
578,754 |
74,455 |
| territory |
674,452 |
167,239 |
| tic-tac-toe |
532,356 |
33,130 |
All seven are now ≤ 400 KB (409,600 bytes) — a 4–18× reduction.
Instantiate time
Measured on the build laptop with Bun's WebAssembly.instantiate, before (extracted from HEAD) and after modules measured back-to-back in one run, median of 50 instantiations after one warmup:
| Module |
Before (median) |
After (median) |
| lounge |
1.08 ms |
1.79 ms |
| roc-chat |
1.15 ms |
1.25 ms |
| roc-counter |
0.59 ms |
0.48 ms |
| roc-grid |
0.72 ms |
0.66 ms |
| roc-screen |
0.78 ms |
0.93 ms |
| territory |
0.90 ms |
1.48 ms |
| tic-tac-toe |
0.55 ms |
0.59 ms |
Honest read: instantiate time is roughly unchanged within measurement noise — the laptop was under multi-agent load during measurement and run-to-run variance was large (a second after-only run under lighter load read 0.24–0.43 ms across modules). In the JS engine instantiation is compile-dominated and does not scale down with the removed debug/custom sections. The concrete win of this change is the 4–18× byte reduction (download/transfer for every joiner, per #555's motivation); no instantiate regression beyond noise was observed. Wasmtime instantiation in the sandbox may behave differently and is covered by the CI suite below.
Verification
- Each
build.sh was run end-to-end on the laptop; all seven rebuilt modules pass wasm-tools validate, and the committed blob sizes above are the script outputs (verified from the commit tree).
- CI on this PR runs the pkgs/id sandbox suite + fuel budgets (the F11.6 budget test covers every checked-in example).
Queue task 1314 · closes #555 on merge.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…+ strip (#555)
All 7 checked-in Roc example modules rebuilt with roc nightly-2026-10-06-c34079d: 526-686 KB -> 30-169 KB each (all <= 400 KB). build.sh resolves wasm-opt like wasm-tools (PATH / nix store binaryen / nix run nixpkgs#binaryen); wasm-opt needs --all-features for the Roc nightly post-MVP features. Queue task 1314.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 47 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
181d9bf7-0ec7-4324-89fe-1a3b54984e0b
Commits
-
Reviewing files that changed from the base of the PR and between 95cd41f and 9c5ba73.
Files ignored due to path filters: 7
-
pkgs/id/examples/lounge/lounge.wasm is excluded by !**/*.wasm
pkgs/id/examples/roc-chat/roc-chat.wasm is excluded by !**/*.wasm
pkgs/id/examples/roc-counter/counter.wasm is excluded by !**/*.wasm
pkgs/id/examples/roc-grid/roc-grid.wasm is excluded by !**/*.wasm
pkgs/id/examples/roc-screen/roc-screen.wasm is excluded by !**/*.wasm
pkgs/id/examples/territory/territory.wasm is excluded by !**/*.wasm
pkgs/id/examples/tic-tac-toe/tic-tac-toe.wasm is excluded by !**/*.wasm
Files selected for processing: 7
-
pkgs/id/examples/lounge/build.sh
pkgs/id/examples/roc-chat/build.sh
pkgs/id/examples/roc-counter/build.sh
pkgs/id/examples/roc-grid/build.sh
pkgs/id/examples/roc-screen/build.sh
pkgs/id/examples/territory/build.sh
pkgs/id/examples/tic-tac-toe/build.sh
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-27T16:04:36.886457Z |
9c5ba73 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 28, 2026
This was referenced Nov 1, 2026
This was referenced Nov 4, 2026
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
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.
|