@onda-lang/binaryen-web 0.9.1 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -122,9 +122,8 @@ compares targeted edge cases and deterministic random bit patterns against Rust'
122
122
  `mul_add` oracle. Binaryen removes unused helper functions, so a program pays code size only for
123
123
  the math closure it calls. Generated modules need no default host imports.
124
124
 
125
- Compilation defaults to Binaryen O4 for speed, strict floating-point optimization, WebAssembly
126
- SIMD enabled, and Binaryen's ordinary inlining policy. Options are explicit and recorded in
127
- `artifact.metadata.optimization`:
125
+ Compilation defaults to Binaryen O4, strict floating-point optimization, and WebAssembly SIMD.
126
+ The selected options are recorded in `artifact.metadata.optimization`.
128
127
 
129
128
  ```js
130
129
  compileTrustedMir(mir, {
@@ -138,10 +137,14 @@ compileTrustedMir(mir, {
138
137
  });
139
138
  ```
140
139
 
141
- Loop-containing inlining remains opt-in because controlled measurements were workload-dependent:
142
- it helped the oversampling fixture but regressed the language and saturator fixtures. The compiler
143
- saves and restores Binaryen's process-global optimization settings around every module, so one
144
- compile cannot silently change another compile's numerical or inlining policy.
140
+ The backend passes MIR inline hints to Binaryen's inliner. `always` requests inlining even
141
+ for callees with loops, subject to Binaryen's combined-function size and iteration limits.
142
+ `never` keeps shared callees out of the inliner. At O2 and above or shrink level 2,
143
+ Binaryen's cost model applies to `auto`, `prefer`, and linked math routines. Modules with
144
+ `always` run the inliner before identical functions can merge. Lower optimization levels
145
+ run the inliner only for `always`. Setting `optimize: false` skips inlining entirely.
146
+ `allowInliningFunctionsWithLoops` tunes the normal cost model. The compiler restores
147
+ Binaryen's process-global settings after each build.
145
148
 
146
149
  O4 was selected by an affinity-pinned O3/O4 A/B over language, oversampling, saturator, and complete
147
150
  math workloads. It improved three workloads and left saturator effectively unchanged, at the cost
@@ -188,9 +191,6 @@ Current limitations are explicit:
188
191
  - scalar FMA and transcendental operations are software helpers on core Wasm targets, so LLVM may
189
192
  still use faster target instructions or platform libm implementations
190
193
  - recursive call graphs are rejected as unbounded realtime work
191
- - `inline: always` and `inline: never` are validated but remain advisory because Binaryen.js does
192
- not expose per-function inline/no-inline annotations; its module optimizer chooses whether to
193
- inline a call
194
194
  - this low-level package accepts MIR rather than source; the product-facing `onda-wasm` CLI lives in
195
195
  `@onda-lang/wasm-compiler`, while the native `onda compile` command does not yet emit linked Wasm
196
196
  - production consumers must package/cache Binaryen; Web Audio users can use the separate optional