Skip to content

Add first-class MLIR to wasm32 compilation target - #529

Merged
godofecht merged 2 commits into
mainfrom
feat/mlir-wasm32-target
Aug 17, 2026
Merged

godofecht merged 2 commits into
mainfrom
feat/mlir-wasm32-target

Conversation

@godofecht

@godofecht godofecht commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Implements the compiler foundation for #528.

Adds the first direct Flow → MLIR → LLVM IR → WebAssembly compilation path without generated C or Emscripten. Includes a wasm compiler utility targeting wasm32-unknown-unknown and unit coverage that asserts the Flow compiler is invoked through --wasm32 --llvm and never --c.

This deliberately does not close #528 yet: stable browser exports/memory ABI, a freestanding runtime for allocation-heavy programs, real wasm instantiation/numerical parity CI, and flow-scikit migration remain follow-up acceptance work.

@godofecht
godofecht marked this pull request as ready for review August 17, 2026 09:20
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@godofecht
godofecht merged commit cce2c19 into main Aug 17, 2026
18 checks passed
@godofecht
godofecht deleted the feat/mlir-wasm32-target branch August 18, 2026 07:24
godofecht added a commit that referenced this pull request Aug 18, 2026
The MLIR to wasm32 path landed across #529 through #535 with no docs, and
docs/language/wasm.md still listed "Direct WASM emission (skip C)" as
deferred with no backend planned.

- New "Direct wasm32 (no Emscripten)" section covering the pipeline, the
  `python -m flow.wasm_compiler` flags, export validation, linear-memory
  marshalling, the `env.malloc` import and the bump allocator in
  runtime/wasm/flow_runtime.mjs, the toolchain requirement, and what
  .github/workflows/wasm32.yml actually executes.
- Replaced the stale deferred row. libc is the thing still missing under
  the freestanding target, so that is what the row now says.
- Status matrix, "what works today" list, and the ROADMAP row name the
  second route. The ROADMAP cell also had an unescaped pipe splitting the
  table; escaped it.
- DEVELOPMENT.md: the pipeline diagram stopped at "MLIR (experimental)"
  and never mentioned LLVM IR or wasm32. Added both plus a component entry
  for wasm_compiler.py.
- docs/language/wasm.md and wasm-crossings.md were built but unreachable
  from the mkdocs nav. Added both.
- Refreshed docs/library/stdlib-api.md, which build_wiki.py regenerates:
  six modules added since the last commit of it (bigint, checked_arith,
  dsp, keys, rf, units_si), 105 to 111.

check_doc_links, check_wiki_links, build_wiki all pass; mkdocs warning
count unchanged at 171.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
godofecht added a commit that referenced this pull request Aug 18, 2026
…#539)

* docs: cover the direct wasm32 target

The MLIR to wasm32 path landed across #529 through #535 with no docs, and
docs/language/wasm.md still listed "Direct WASM emission (skip C)" as
deferred with no backend planned.

- New "Direct wasm32 (no Emscripten)" section covering the pipeline, the
  `python -m flow.wasm_compiler` flags, export validation, linear-memory
  marshalling, the `env.malloc` import and the bump allocator in
  runtime/wasm/flow_runtime.mjs, the toolchain requirement, and what
  .github/workflows/wasm32.yml actually executes.
- Replaced the stale deferred row. libc is the thing still missing under
  the freestanding target, so that is what the row now says.
- Status matrix, "what works today" list, and the ROADMAP row name the
  second route. The ROADMAP cell also had an unescaped pipe splitting the
  table; escaped it.
- DEVELOPMENT.md: the pipeline diagram stopped at "MLIR (experimental)"
  and never mentioned LLVM IR or wasm32. Added both plus a component entry
  for wasm_compiler.py.
- docs/language/wasm.md and wasm-crossings.md were built but unreachable
  from the mkdocs nav. Added both.
- Refreshed docs/library/stdlib-api.md, which build_wiki.py regenerates:
  six modules added since the last commit of it (bigint, checked_arith,
  dsp, keys, rf, units_si), 105 to 111.

check_doc_links, check_wiki_links, build_wiki all pass; mkdocs warning
count unchanged at 171.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* ci: fire CI on docs-only changes

The version and doc-links jobs carry a comment saying they are
deliberately ungated at the job level, because the drift-prone files
(README.md, CITATION.cff, flow.toml, docs/LANGUAGE_SPEC.md) sit outside
every paths-filter. The workflow-level paths defeated that: no docs path
was listed, so a docs-only PR never started the workflow and neither job
ran. The docs PR this rides on got three checks, none of them the link
checker.

Added docs/**, mkdocs.yml, CITATION.cff and **.md to both triggers. Every
expensive job stays gated on the changes filter, so a docs-only run is
still just changes, version, doc-links and the aggregator.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* docs: mark the wasm32 backend covered now that it has a page

check_doc_coverage.py exempted backend:wasm_compiler with a reason naming
this branch. The page exists here, so the exemption becomes a real mapping.

Backends: 9/9 covered, nothing exempt.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

Add first-class Flow → MLIR → WebAssembly target

1 participant