Skip to content

[web] Add Skwasm artifact variant test support#188614

Closed
MarlonJD wants to merge 1 commit into
flutter:masterfrom
MarlonJD:skwasm-artifact-variant-test-support
Closed

[web] Add Skwasm artifact variant test support#188614
MarlonJD wants to merge 1 commit into
flutter:masterfrom
MarlonJD:skwasm-artifact-variant-test-support

Conversation

@MarlonJD

@MarlonJD MarlonJD commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds explicit Skwasm artifact selection and browser-test coverage for Safari and Firefox.

The new tests prove which Skwasm artifact was loaded and verify that the run did not silently fall back to CanvasKit.

Why now

#188797 fixed the stock RenderCanvas CSS-size drift observed on Safari, and the corresponding issue #188723 is now closed.

With that specific rendering blocker addressed, the next gap is artifact-level confidence. Safari and Firefox automatically select skwasm_heavy, but existing tests do not prove which runtime files were loaded. This makes it possible to accidentally measure another Skwasm variant, Wimp, or a CanvasKit fallback.

This PR makes that selection explicit and testable.

Changes

  • Adds skwasmVariant with auto, normal, and heavy options.
  • Adds Felt support for selecting a Skwasm variant.
  • Adds non-CI Safari and Firefox Skwasm suites.
  • Verifies that the expected Skwasm JavaScript and Wasm files were loaded.
  • Verifies that other Skwasm variants and CanvasKit were not loaded.
  • Tracks Wimp artifacts separately so Skwasm-only suites do not copy or depend on them.

The default remains auto; existing production selection behavior is unchanged.

Local validation

A three-pass local macrobenchmark comparison used the same SDK and browser harness for CanvasKit and Skwasm. The metric is drawFrameDuration.average; lower is better.

Browser Artifact selected Card Lazy text Wrapbox
Chrome skwasm 1.69× faster 1.46× faster 1.92× faster
Firefox skwasm_heavy 1.37× faster 1.48× faster 1.28× faster
Safari skwasm_heavy 2.26× faster 1.75× faster 2.56× faster

The selected artifact was recorded on every run, and the direction did not change across the three passes.

A controlled variant check also showed why this proof matters: forcing normal skwasm on Safari or Firefox fails during text layout because Intl.v8BreakIterator is unavailable. skwasm_heavy includes the required text-segmentation data and runs successfully.

These are local results supporting the test infrastructure in this PR. They are not a default-enablement or CI-readiness claim.

Scope

This PR does not:

  • enable Skwasm by default on Safari or Firefox;
  • change the rendering or presentation path;
  • add Safari or Firefox Skwasm suites to CI.

Related: #178893, #188797.

Tests

  • dart analyze test/skwasm/artifact_loading_test.dart dev/felt_config.dart dev/felt_config_test.dart dev/test_platform.dart dev/test_runner.dart dev/steps/copy_artifacts_step.dart
  • dart test dev/felt_config_test.dart
  • ./dev/felt test --suite=firefox-dart2wasm-skwasm-skwasm --suite=safari-dart2wasm-skwasm-skwasm test/skwasm/artifact_loading_test.dart

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. platform-web Web applications specifically team-web Owned by Web platform team labels Jun 26, 2026
@MarlonJD

Copy link
Copy Markdown
Contributor Author

Closing this draft because it is no longer needed for the Safari enablement path. Safari already selects skwasm_heavy through the existing auto logic, and the remaining enablement work is tracked in #178893 and #186600. The artifact-loading test can still be reused later if maintainers want that coverage.

@MarlonJD MarlonJD closed this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant