Skip to content

Provide partial WebAssembly support#55

Merged
jjjkkkjjj merged 36 commits intojjjkkkjjj:masterfrom
GoodNotes:master
Jan 21, 2026
Merged

Provide partial WebAssembly support#55
jjjkkkjjj merged 36 commits intojjjkkkjjj:masterfrom
GoodNotes:master

Conversation

@pedrovgs
Copy link
Contributor

This PR aims to be an initial entry point for WebAssembly support. We've basically followed these steps to build a first PR we can later iterate on and improve depending on our future needs.

  • Fix IOS CI and add CI support so we know if future changes are compatible with WASM.
  • Add some utility scripts to simplify the build and manual checks. These are used for CI as well.
  • Update the min Swift version.
  • Update the project README with some documentation.
  • Enable coverage reports so we know what we are covering with automated tests.
  • Disable all the features that we can't support on WASM for now because of different reasons.
  • Provide fallback implementation to a lot of features already implemented.

In the future we will continue contributing to this repository if you don't mind 😃 Thanks for all the hard work and the awesome library!

pedrovgs and others added 30 commits January 16, 2026 11:38
… should fail because the code is still not modified
Fix iOS CI, update WASM CI for testing and add some utility scripts
Copy link
Owner

@jjjkkkjjj jjjkkkjjj left a comment

Choose a reason for hiding this comment

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

Thank you so much for your hard work!!
I'm not very familiar with WASM yet, but I really appreciate this contribution — it will definitely help extend Matft’s use cases in the future.

// dynamic allocation
self.data_real = allocate_doubledata_from_flattenArray(&flatten_realArray, toBool: mftype == .Bool)
self.data_imag = allocate_floatdata_from_flattenArray(&flatten_imagArray, toBool: mftype == .Bool)
self.data_imag = allocate_doubledata_from_flattenArray(&flatten_imagArray, toBool: mftype == .Bool)
Copy link
Owner

Choose a reason for hiding this comment

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

Good catch!
This was fatal bug...


/// Tests for WASI fallback implementations
/// These tests validate the pure Swift implementations that are used when Accelerate is not available (e.g., on WASI)
/// The tests run on macOS to ensure the fallback logic is correct before deploying to WASI
Copy link
Owner

Choose a reason for hiding this comment

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

For the future, it would be nice if we could reuse the existing test suite and run the same tests against both Accelerate and WASI backends, but this is totally fine as a starting point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually configured the CI to execute the tests with the wasm toolchain as well, so these tests are executed with both toolchains. The comment is not correct.

@jjjkkkjjj jjjkkkjjj merged commit 93b6d43 into jjjkkkjjj:master Jan 21, 2026
1 check passed
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