WebGPU measurements

These measurements compare implementations with fixed fixtures. Each comparison used the same test environment for all variants. Compare the timing scope, precision, mode counts, and setup costs with each table. Timings depend on the hardware and browser.

For the implementation and accuracy limits, see WebGPU. The timing tools document commands, trial ordering, hashes, and memory metrics. All commands run from the repository root.

Initial resident solver

Before the shared polynomial basis update, Chrome 155 measurements on 22 October 2026 gave these full-run medians against up to eight WebAssembly threads. The fixture uses a generated circular equilibrium, toroidal modes 3 and 5, and a maximum frequency of 0.5. Six warm trials per backend cycled all six backend orders. Times include CPU equilibrium construction and final readback; they exclude initial shader compilation.

Surfaces × frequencies Wasm (ms) GPU f32 (ms) Speedup GPU paired f32 (ms)
5 × 65 436 381 1.14× 447
17 × 1,025 712 463 1.54× 679
33 × 4,097 1,930 889 2.17× 1,249
17 × adaptive 568 534 1.06× 1,109

All timed GPU surfaces were accepted without fallback. These are approximate backend comparisons: the largest case returned 548 modes on either GPU backend and 556 on the CPU; the 1,025-frequency case returned 253 and 286. Paired f32 was 1.54× faster than CPU on the largest case and about twice as slow on the adaptive case. The large f32 run uploaded 1.38 MB, including one equilibrium upload, and read back 9.60 MB in 12–13 batches. Adaptive readback remains a useful target for further reduction. Repeat the comparison with the benchmark script.

Shared polynomial basis

The shared polynomial sampler was compared with the old sampler on the same adapter, with BSplineInterpolation 2.2.0 in both builds. Six warm trials used all six CPU/old-GPU/new-GPU orders. Full f32 run medians were:

Surfaces × frequencies Old sampler (ms) New sampler (ms) Ratio
5 × 65 294 302 0.97×
17 × 1,025 377 370 1.02×
33 × 4,097 802 740 1.08×

The timing ranges overlap: the largest old runs took 664–1,022 ms and the new runs 673–938 ms. These trials do not establish a reliable full-run gain. Both builds returned the same mode counts; the largest nearest-frequency difference in either direction was 1.8e-7. All timed GPU surfaces were accepted. The large run uploaded 1.40 MB instead of 1.38 MB and kept the same 9.60 MB readback. It used 330 dispatches instead of 396 by skipping unused weight passes.

An isolated 8,193-node sampling benchmark measured 8–16× faster sampling with amplitude weights off, largely from skipping the serial minimum and normalization passes. With weights on, the gain was 0–5%. These stage timings include JavaScript encoding, submission, and a queue fence; they do not measure full solves. The spline checks found maximum scaled coefficient differences of 3.31e-6 for f32 and 4.14e-13 for paired f32 against native double evaluation, using abs(GPU - native) / max(1, abs(native)). The cases include shaped axis fields and knot sides. See the sampling checks and benchmark instructions.

Upload-time equilibrium preparation

Both comparisons above constructed the equilibrium inside each calculation. With upload-time preparation, the same 5 × 65 GPU calculation took a median 61 ms after Equilibrium ready, versus 295 ms in the previous app. Construction took 258–262 ms once on file selection, measured separately. The old and new GPU builds returned identical numerical arrays in six warm trials. This moves setup before Calculate; it does not make construction faster.

Selective polynomial conversion

Polynomial conversion now depends on expected reuse. Equilibrium construction prepares its quintic flux, current-profile, and angle-map splines only when the estimated work reaches 12 evaluations per active cell. Small workloads keep control-point evaluation; larger input grids need more reuse to justify the conversion. This policy applies to construction splines; the GPU sampler exports the final fields' cubic cell coefficients for repeated sampling.

Six fresh-upload trials per build compared this policy with control-point construction in Chrome 155. Each trial built a 256 × 256 equilibrium in one Wasm worker, from the same circular geometry with 128 boundary points:

Input grid Before (ms) Selective conversion (ms) Speedup
65 × 65 224 162 1.38×
129 × 129 251 202 1.25×
257 × 257 349 335 1.04×

These medians cover parsing and spline construction, including conversion. They exclude browser File reads, completion polling, and continuum solves. The policy converts the flux spline for the first two grids and skips its roughly 18 MB polynomial table for the third.

Old and new builds returned the same mode counts for 5 × 65 and 17 × 1,025 GPU calculations. Their largest nearest-frequency difference was 2.3e-16; the double-precision equilibrium payload changed by at most 1.1e-11. These comparisons describe these fixtures, not a general error bound.

Direct field polynomials

Chrome 155 measurements compared the app using shared basis tables with the app using direct field polynomials. Six warm trials per build and case cycled all six CPU/old-GPU/new-GPU orders. Both apps used an already prepared equilibrium. Warm calculation medians were:

Surfaces × frequencies Shared f32 → direct (ms) Ratio Shared paired → direct (ms) Ratio
5 × 65 61.0 → 58.6 1.04× 111.0 → 92.9 1.19×
17 × 1,025 135.7 → 118.7 1.14× 339.2 → 317.6 1.07×
33 × 4,097 448.7 → 457.0 0.98× 919.9 → 828.1 1.11×
17 × adaptive 210.9 → 198.7 1.06× 843.8 → 809.7 1.04×

Timing ranges overlap in every case. These ratios include caching: the baseline rebuilds and uploads its spline payload each run; the direct app reuses both. All measured direct warm runs performed zero equilibrium uploads. For the 17 × 1,025 case, solver uploads per warm run fell from 1.39 MB to 6.53 KB in f32, and from 2.78 MB to 7.34 KB in paired f32.

First use costs more. Single first-calculation observations after page load, with shared browser compilation caches, changed from 191 to 447 ms in f32 and from 423 to 750 ms in paired f32. These runs used about 125–170 ms to generate the direct export and 90–157 ms to pack, submit, and validate its installation. Wasm memory capacity grew to 81 MB, versus 29 MB and 35 MB in the baseline float and paired runs. Capacity includes free space and excludes JS and GPU allocations; it is not a measurement of live objects.

On a 16 × 64 equilibrium grid, the isolated 8,193-node sampling benchmark found mostly unchanged stage times: roughly 0.094 ms without amplitude weights and 1.03 ms with weights in f32. Paired axis sampling without weights changed from 0.127 to 0.100 ms; the other paired cases changed by 0–2%. These timings include JavaScript encoding, submission, and a queue fence. Their ranges overlap, so they do not establish a reliable gain from polynomial evaluation alone.

Mode counts matched in all before/after cases. Maximum nearest-frequency differences in either direction were 1.78e-7 for f32 and 9.28e-15 for paired f32; these compare the two GPU implementations, not their error against a reference solution.

Figure rendering

On the same adapter, ten alternating warm trials of a synthetic 100,000-point spectrum reduced CPU drawing work from 39.24 ms to 0.535 ms. The interval through two following animation frames fell from 53.68 ms to 35.76 ms (1.50×). Normal and cached figures had little change in frame time. These are browser timings, not GPU timestamps. The first raw-data upload is outside the warm redraw measurement.

See plot timing commands to measure drawing separately from solver work.