Skip to content

feat: migrate wasm_optimize to native loom toolchain v1.1.14 (#512)#514

Open
avrabe wants to merge 2 commits into
mainfrom
feat/loom-native-toolchain
Open

feat: migrate wasm_optimize to native loom toolchain v1.1.14 (#512)#514
avrabe wants to merge 2 commits into
mainfrom
feat/loom-native-toolchain

Conversation

@avrabe

@avrabe avrabe commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Completes #512 (native-loom migration; builds on the merged #513 registry entry). loom v1.x is native-only (no loom.wasm), shipping signed per-OS binaries with the loom#172/#196/#220 correctness fixes.

Native loom toolchain:

  • toolchains/loom_toolchain.bzlloom_repository (download + extract the tarball, expose the loom binary; stub for unsupported/Windows hosts) + loom_toolchainToolchainInfo. Mirrors meld_toolchain.bzl (meld is a bare binary; loom is a tarball).
  • loom_toolchain_type + bzl_library + tool_registry URL pattern; @loom_toolchain registered in MODULE.bazel (v1.1.14).

wasm_optimize rewire:

Verification (local)

  • bazel build @loom_toolchain//:loom — fetches + extracts loom 1.1.14.
  • bazel build //test/p3:hello_p2_optimizednative loom optimizes a real component (4/4 core modules, "Optimization complete").
  • ⏳ The meld → loom → synth fused falcon path needs @avrabe's //:falcon-optimized e2e — please verify against this branch (it should also let jess drop the dead-stores override per the issue).

Notes

  • Windows loom (loom.exe) is stubbed (follow-up).
  • tools/loom_wrapper is now unused by loom; left in place, removable in cleanup.

🤖 Generated with Claude Code

avrabe and others added 2 commits June 15, 2026 07:56
loom v1.x ships native per-OS binaries (no loom.wasm). Add a hermetic loom
toolchain, mirroring meld_toolchain.bzl but extracting the tarball (meld ships a
bare binary):
- toolchains/loom_toolchain.bzl: loom_repository (download+extract loom-v{ver}-
  {triple}.tar.gz, expose the loom binary; stub for unsupported/Windows hosts)
  + loom_toolchain rule -> ToolchainInfo(loom=...).
- toolchains/BUILD.bazel: loom_toolchain_type + bzl_library.
- toolchains/tool_registry.bzl: _URL_PATTERNS["loom"] (tarball; strip_prefix ""
  and binary "loom" via the existing defaults).
- wasm/extensions.bzl + MODULE.bazel: register @loom_toolchain (v1.1.14).

Registered but not yet consumed — wasm_optimize still uses the @loom_wasm 0.3.0
component; the rewire to the native toolchain is the next step (#512). Windows
loom (loom.exe) stubbed for now (follow-up).

Verified: `bazel build @loom_toolchain//:loom` fetches + extracts loom 1.1.14
for the host and resolves the binary.

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

Rewire wasm_optimize to the native loom toolchain (added in the previous
commit) instead of running the loom.wasm component under wasmtime:
- executable = ctx.toolchains[loom_toolchain_type].loom; args `optimize <input>
  -o <output> [flags]` (loom CLI unchanged). Native loom reads the input
  directly through the OS, so the wasmtime/WASI-preopen/symlink workaround
  (#490, loom_wrapper) and the wasmtime toolchain dep are no longer needed and
  are removed from the rule.
- Drop the @loom_wasm 0.3.0 wasm_component_download from MODULE.bazel.
- Add //test/p3:loom_optimize_build_test (wasm_optimize on the P2 component) for
  coverage.

Verified locally: //test/p3:hello_p2_optimized builds — native loom 1.1.14
optimizes the component (4/4 core modules, "Optimization complete").

(tools/loom_wrapper is now unused by loom; left in place — wasmsign2 patterns
may still reference the approach — removable in a cleanup follow-up.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avrabe avrabe changed the title feat(toolchains): add native loom toolchain (#512 step 2) feat: migrate wasm_optimize to native loom toolchain v1.1.14 (#512) Jun 15, 2026
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