Skip to content

Replace "Sum Total" synthetic row with "Geomean" - #341

Merged
cfallin merged 2 commits into
bytecodealliance:mainfrom
fitzgen:geomean
Oct 12, 2026
Merged

cfallin merged 2 commits into
bytecodealliance:mainfrom
fitzgen:geomean

Conversation

@fitzgen

@fitzgen fitzgen commented Oct 9, 2026

Copy link
Copy Markdown
Member

Otherwise, the heavy benchmarks dominate. This is especially bad for compile time, where one benchmark can be up to 40% of the total benchmarking budget.

r? @cfallin

Otherwise, the heavy benchmarks dominate.
@fitzgen
fitzgen requested a review from cfallin October 9, 2026 22:47

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing based on geomean sounds great (it's the best way to compare speedups/rates IMHO) but I'm not sure I understand something below -- clarification would be great:

Comment thread crates/analysis/src/geomean.rs Outdated
/// engine's own noise and does not cancel between two engines: a merely noisier
/// engine would be reported as faster. Rescaling is a constant factor per group,
/// so it moves the mean without touching the relative spread the confidence
/// interval is built from.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this paragraph: can you explain a bit more what is actually going on? Why are we trying to make arithmetic means and geometric means match?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we implemented sum total rows was to inject synthetic rows in the benchmark data for each iteration. The "benchmark" was "Sum Total" instead of an actual .wasm path and the count was the sum of all the benchmarks' counts for this iteration. From here on out, these rows were treated the same as any other, and this is how we got confidence intervals and significance tests for "Sum Total" rows For Free(tm).

We do the same thing for "Geomean" now. However, taking the average of averages introduces skew, IIUC, and this skew is related to how noisy the control/variable engine is. The rescaling is an attempt to bound this skew and keep it to a level that doesn't matter for our purposes, and we have tests enforcing this.

I don't love it, and I'm not married to it. The alternative would be to stop injecting these synthetic rows and getting the confidence intervals, significance tests, and all that For Free(tm) and instead have special-cased code to compute it at a higher level in the benchmark data analysis. I don't think we could reuse the existing crates/APIs we use for significance testing today if we did this because IIUC we would be working in log space, but I'm not 100% sure, I'd need to dig into it more.

For now, I've dialed back the detail on this comment, boiling it down to its essence. Let me know if you think we should continue with this PR's approach, or if I should start investigating the alternative.

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that seems reasonable -- the way this fits into the existing pipeline is fine, I just didn't understand it / couldn't parse that paragraph. Happy to see this ship and we can always refine/improve later. Thanks!

@cfallin
cfallin merged commit 9671398 into bytecodealliance:main Oct 12, 2026
12 checks passed
@fitzgen
fitzgen deleted the geomean branch October 12, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants