feat(measure): component-aware harness with meld + code-section deltas (v0.9.1 PR-R)#114
Merged
Merged
Conversation
…s (v0.9.1 PR-R)
Three additions, all surfaced during the 'as fair as possible' comparison
the user requested.
## 1. Component support via meld fusion
wasm-opt cannot process Component-Model components (errors on byte 0:
component magic differs from core wasm). `meld fuse` produces a single
core module from a component; that fused core is wasm-opt-ingestible.
Each component fixture now gets a meld-baseline row showing wasm-opt
and LOOM deltas relative to the meld output.
Findings:
simple_component 90 B → wasm-opt 90 (+0%) / LOOM 41 (-54.4%)
calc_component 135 B → wasm-opt 135 (+0%) / LOOM 86 (-36.3%)
calculator_root 2.29 MB → wasm-opt 1.93 MB (-16%) / LOOM timeout
LOOM dominates on the small adapter-heavy core forms; wasm-opt dominates
on the large calculator_root core (where LOOM hits the timeout).
## 2. Code-section measurement (the optimizer-relevant metric)
The pre-fix code_section_bytes returned 0 for every fixture because it
parsed 'wasm-tools dump' output where the code-section size is
LEB128-encoded ('0a ab 06' = 811 bytes), but the parser was grabbing
the first integer from the address column ('0x3ab' → '0'). Replaced
with awk over 'wasm-tools objdump' which prints decimal byte counts in
a clean pipe-separated table; sums across multi-module components.
Now the report shows TWO tables:
- File size — total bytes incl. type/import/export/custom sections
- Code section — bytes the optimizer actually changes
The code view reveals what file size hid:
gale: 811 → LOOM 795, wopt 795 (tied at -2.0%)
calculator_root: 106017 → LOOM 96515 (-9.0%) wopt errors
small components have 9-33 byte code sections (mostly adapter)
## 3. Per-run timeout (safety net)
with_timeout wrapper bounds each tool invocation to PER_RUN_TIMEOUT
(default 300s; CI can lower it). Built because three concurrent
'meld + LOOM optimize' invocations on the 2.3MB calculator melded
core hung for >60 minutes each before being killed by hand. Uses
gtimeout or timeout (coreutils on macOS); skip-without-bound if neither
is on PATH.
## 4. Bugfix: missing-fixture rows now match the new column schema
The two ROWS+= sites that insert n/a rows for missing fixtures were
updated to emit 15 fields (was 10) to match the new code-section
columns. Without this the n/a rows printed the fixture description in
the 'Baseline (code)' column.
Trace: REQ-3, REQ-14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
User-requested fairness pass on the v0.9.0 measurement harness:
meld fuseto produce a comparable core form, then run wasm-opt + LOOM on that.Key finding
The original
code_section_byteswas returning 0 for every fixture because it parsedwasm-tools dumpoutput where the code-section size is LEB128-encoded (0a ab 06= 811 bytes), but the parser grabbed the first integer from the address column (0x3ab→0). Every prior code-section number in the report was silently zero. New parser useswasm-tools objdumpwhich prints decimal byte counts in a clean pipe-separated table.Honest results matrix
File size (total bytes):
Code section (optimizer-relevant):
Components via meld (fused-core baseline):
What the new data shows
Code changes
scripts/measure_corpus.sh:with_timeoutwrapper, component magic-byte detection,meld fuseintegration, fixedcode_section_bytes(LEB128 bug), 15-field row schema with code-section columns, two report tables.docs/measurements/v0.9.0-corpus-baseline.md: regenerated with real numbers.🤖 Generated with Claude Code