Skip to content

Add wasm-only and webgpu-only scores#171

Open
rmahdav wants to merge 7 commits into
mainfrom
introducing-score
Open

Add wasm-only and webgpu-only scores#171
rmahdav wants to merge 7 commits into
mainfrom
introducing-score

Conversation

@rmahdav

@rmahdav rmahdav commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

This pull request updated the benchmark to tracking and displaying two independent performance metrics: WASM Score and WebGPU Score. Additionally, the score calculation scaling factor has been adjusted from 100,000 / geomean to 10,000 / geomean to produce more intuitive, readable score numbers across all workloads. The UI and test suites have also been updated to support these dual scores and ensure stable end-to-end reporting when running subset benchmarks.

Closes #170

@rmahdav
rmahdav force-pushed the introducing-score branch from 5b1f65f to 8829673 Compare June 17, 2026 22:01
@rmahdav
rmahdav force-pushed the introducing-score branch from b514574 to ada6b1f Compare July 1, 2026 22:57
@rmahdav
rmahdav marked this pull request as ready for review July 6, 2026 22:48
@rmahdav
rmahdav requested a review from danleh July 6, 2026 22:48

@danleh danleh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM with nits, thanks!


function geomeanToScore(geomean) {
return 1000 / geomean;
return 10000 / geomean;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Given that we are changing the score in a major way, do we want to bump the WebAI version to 0.3.0?

iterationMetric(i, "WASM-Total").description = `WASM test totals for iteration ${i}`;
iterationMetric(i, "WebGPU-Total").description = `WebGPU test totals for iteration ${i}`;
}
getMetric("WASM-Geomean", "ms").description = "Geomean of WASM test totals";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know it's a small thing, but it's important to many WebAssembly folks: It's Wasm not WASM (since it's not an acronym). Please change that everywhere (in both the metric names and text displayed on the results page etc.)

const score = 1000 / geomean;
const score = 10000 / geomean;

const { total: measuredTotal, mean: measuredMean, geomean: measuredGeomean, score: measuredScore } = runner._measuredValues;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it intentional that we are removing the *Total and *Mean from _measuredValues? IIUC, we now only have *Geomean and *Score each?

const mean = total / suite.steps.length;
const geomean = Math.pow(total, 1 / suite.steps.length);
const score = 1000 / geomean;
const score = 10000 / geomean;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Can we use geomeanToScore here instead, so we avoid an unnamed constant (which could be forgotten to be updated alongside the actual score calculation above)

geomean = Math.pow(product, 1 / values.length);
mean = total / values.length;
}
const wasmGeomean = !isNaN(iterationWasmMetric?.geomean) ? iterationWasmMetric.geomean : 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of silently producing a 0 score, could we instead assert that there are no NaN results?


let mean = 0;
if (values.length > 0) {
values.sort((a, b) => a - b); // Avoid the loss of significance for the sum.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mhm, I didn't have a look at this before, but why were we calculating another geomean here?

iterationWasmTotal.add(results.total);
} else if (suite?.tags?.includes("webgpu")) {
iterationWebgpuTotal.add(results.total);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we add an else { assert(false); } here to make sure there are not unaccounted-for suites that are neither Wasm or WebGPU?

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.

Introduce a Single Benchmark Score for Easier Comparison

2 participants