WebAssembly / WebAssembly/binaryen

Regression on optimized module size depending on final markers

Open
#5,932 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

The commit https://github.com/WebAssembly/binaryen/commit/7df30640820c9b4acfc69ffc7616809a727d1241 introduced a severe size regression for fs.wasm.gz when optimized with

wasm-opt -all --closed-world -tnh -O3 --type-ssa --gufa -O3 --type-merging -O1

Before the change, it optimized to 1520024 bytes. After, it optimizes to 1890468 bytes.

The module declares all struct types as non-final. If it instead marks all types final that don't have any subtypes (ff.wasm.gz), the change introduces a smaller regression from 1540124 to 1639628 bytes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the regression with fs.wasm.gz and ff.wasm.gz using the wasm-opt command in the issue, then compare the behavior before and after commit 7df30640820c9b4acfc69ffc7616809a727d124. Trace the optimization change affecting final markers; done means the optimized module sizes no longer show the reported regression for these cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.