Skip to content

feat(wasm): build wasm32 and wasm64 Preview 2 plugins - #65

Draft
hlolli wants to merge 3 commits into
csound:developfrom
hlolli:feat/wasm-preview2-targets
Draft

hlolli wants to merge 3 commits into
csound:developfrom
hlolli:feat/wasm-preview2-targets

Conversation

@hlolli

@hlolli hlolli commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Depends on csound/csound#3556. Keep this draft until that PR merges and matching npm releases can replace the temporary source checkout in CI.

The current wasm32 double plugins do not match either new engine. Build Chua, image, linear algebra, and STK for both wasm32-wasip2 with float samples and wasm64-wasip2 with double samples, using the matching Csound SDKs and source-built Nix toolchains. Wasm64 assets use the -wasm64.wasm suffix.

@csound/plugins selects wasm32 float to match the default browser engine. The /wasm32 and /wasm64 entry points each export one plugins object. Use /wasm64 with the opt-in @csound/browser/wasm64.js module. Static dependencies follow the selected target, and the linear-algebra code now accepts float samples.

Each plugin keeps its own Preview 2 file descriptors while following the engine's working directory. Wasm64 plugins embed adapters for their WASI imports, including STK's directory creation. CI pins csound/csound#3556 at 623c6e8fa1f76ed02fc74dfe178061e7b6ef7aec, which includes the loader support and wasm32 browser default.

The existing npm dependency versions predate Preview 2. Until matching releases exist, CSOUND_WASM_PACKAGE selects a built upstream source tree; the README describes that setup and the release steps.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant