Skip to content

feat: integrate synth — WASM-to-ARM compiler as a hermetic toolchain - #468

Merged
avrabe merged 1 commit into
mainfrom
feat/integrate-synth
May 22, 2026
Merged

feat: integrate synth — WASM-to-ARM compiler as a hermetic toolchain#468
avrabe merged 1 commit into
mainfrom
feat/integrate-synth

Conversation

@avrabe

@avrabe avrabe commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

synth (pulseengine/synth) published its first real release — v0.3.1,
with 4 platform binaries + SHA256SUMS — so it graduates from "deferred" to a
first-class downloaded toolchain. synth is the final stage of the PulseEngine
pipeline: it AOT-compiles a WASM core module to an ARM Cortex-M ELF.

Until now synth_compile required a mandatory synth attr pointing at a
locally-built binary (synth had no releases). This PR adds the toolchain and
makes the rule use it.

Changes

  • checksums/tools/synth.json — JSON registry entry; 4 platforms
    (darwin/linux × amd64/arm64 — synth publishes no Windows binary), verified SHA256
  • toolchains/tool_registry.bzl — synth URL pattern
  • toolchains/synth_toolchain.bzl + toolchains/BUILD.bazelsynth_toolchain_type
    (stub-on-unsupported-platform pattern, like meld, so Windows builds that
    don't touch synth_compile still resolve)
  • wasm/extensions.bzlsynth module extension
  • MODULE.bazel — register the synth toolchain
  • wasm/private/synth_compile.bzl — resolve the synth binary from the
    toolchain; the synth attr is now optional (escape hatch for a
    locally-built binary) rather than mandatory
  • examples/synth_example — compiles a core module to an ARM Cortex-M ELF

Validation

//examples/synth_example:math_firmware builds — synth 0.3.1 downloads
checksum-verified and emits a 32-bit ARM EABI5 ELF (the two exported
functions compiled to ARM machine code).

Completes the tool-integration track (rivet DD-003): spar, witness, and now
synth are all first-class toolchains. synth is no longer deferred.

🤖 Generated with Claude Code

synth (pulseengine/synth) published its first real release — v0.3.1, with 4
platform binaries + SHA256SUMS — so it can now be a first-class downloaded
toolchain instead of a user-supplied binary. synth is the final stage of the
PulseEngine pipeline: it AOT-compiles a WASM core module to an ARM Cortex-M ELF.

- checksums/tools/synth.json — JSON registry entry, 4 platforms (no Windows),
  verified SHA256
- toolchains/tool_registry.bzl — synth URL pattern
- toolchains/synth_toolchain.bzl + toolchains/BUILD.bazel — synth_toolchain_type
- wasm/extensions.bzl — synth module extension
- MODULE.bazel — register the synth toolchain
- wasm/private/synth_compile.bzl — resolve the synth binary from the toolchain;
  the `synth` attr is now optional (escape hatch for a locally-built binary)
  rather than mandatory
- examples/synth_example — compiles a core module to an ARM Cortex-M ELF

Validated: //examples/synth_example:math_firmware builds — synth 0.3.1
downloads checksum-verified and emits a 32-bit ARM EABI5 ELF.

Completes the tool-integration track (rivet DD-003): spar, witness, and now
synth are all first-class toolchains — synth is no longer deferred.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe
avrabe merged commit 1f2805d into main May 22, 2026
28 checks passed
@avrabe
avrabe deleted the feat/integrate-synth branch May 22, 2026 04:10
avrabe added a commit that referenced this pull request Jun 14, 2026
…489) (#505)

* feat(wasm): wasm_component_import — adopt a prebuilt .wasm component (#489)

Adds a first-class rule to bring an already-built component (fetched release
asset, vendored, or committed fixture) into the build graph as a
WasmComponentInfo, so wasm_validate / wasm_optimize / meld_fuse / synth_compile
/ signing can consume it without rebuilding from source.

Per the issue direction:
- returns WasmComponentInfo (wasm_file set, component_type "component",
  profile "release", empty profile_variants, wit_info None)
- optional caller-declared imports/exports (default empty — does not hard-fail
  on a stripped/opaque component)
- wired into wasm/defs.bzl exports + a bzl_library in wasm/private/BUILD.bazel
- examples/component_import_example: adopt-then-validate build_test

Replaces the downstream adopt_wasm_component shim consumers (e.g. jess) carry.

Closes #489 (item 1; item 2 synth_compile already landed in #468/v1.1.0).

* fix(example): repoint wasm_component_import example at a real component

The example referenced prebuilt_component.wasm, which was never committed, so
//examples/component_import_example couldn't build. Point `wasm` at an existing
built component (//examples/basic:hello_component) instead — hermetic (no binary
in git) and proves the adopt -> validate path round-trips on a real component.

Verified: bazel test //examples/component_import_example:component_import_test
PASSES.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Ralf Anton Beier <rbeier57@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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