Skip to content

fix(mlir): wasm32 ABI on MLIR→emcc path; CI mlir-18 (#230) - #247

Merged
godofecht merged 3 commits into
mainfrom
cursor/mlir-doom-e2e-b994
Aug 9, 2026
Merged

godofecht merged 3 commits into
mainfrom
cursor/mlir-doom-e2e-b994

Conversation

@godofecht

@godofecht godofecht commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Toward #230 (doom-flow end-to-end on MLIR).

On current main, doom.flow already emits MLIR and lowers to non-empty .ll (with a modern mlir-opt). The WASM link path was still wrong: without --wasm32, libc size_t/long stay i64 and emcc reports malloc/memcpy/… signature mismatches.

Changes

  • scripts/wasm_build.py: always pass --wasm32 on the MLIR→LLVM path used by ./flow wasm --backend=mlir
  • docs/language/wasm.md: document the ABI requirement
  • tests/integration/test_wasm_backends.py: assert --wasm32 is in the transpiler argv
  • .github/actions/install-toolchain: install mlir-18-tools (not 14) so CI’s mlir-opt understands convert-scf-to-cf / convert-func-to-llvm / finalize-memref-to-llvm
  • README / repository-stats.json tip refresh (absorbed from chore/repository-stats)

Verified locally

  • python3 -m flow.transpiler doom.flow --mlir --llvm --lenient → ~3.4 MB .ll
  • BACKEND=mlir doom wasm build with --wasm32 → doom.{js,wasm,data}, no signature-mismatch warnings
  • Unit test for --wasm32 passes

Follow-up (doom-flow repo)

scripts/build_wasm.sh still needs --wasm32 on the raw transpiler invocation (companion fix; push to that repo was 403). Browser IWAD smoke remains the last #230 checkbox.

Test plan

  • pytest tests/integration/test_wasm_backends.py::test_flow_to_llvm_ir_passes_wasm32
  • CI green on prior tip
  • Re-check CI after stats commit
  • Optional: ./flow wasm examples/wasm/hello_wasm.flow --backend=mlir if emcc available
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 9, 2026 14:22
doom-flow MLIR emit already works on main; the remaining #230 gap was
linking with LP64 size_t into wasm32. Always pass --wasm32 from
scripts/wasm_build.py, document it, and cover with a unit test.

Bump the shared toolchain action from mlir-14-tools to mlir-18-tools so
mlir-opt understands convert-scf-to-cf / convert-func-to-llvm /
finalize-memref-to-llvm (required for --llvm lowering).

Co-authored-by: Abhishek Shivakumar <[email protected]>
Absorb tip refresh from chore/repository-stats (attribute to fa4cd67).

Co-authored-by: Abhishek Shivakumar <[email protected]>
@godofecht
godofecht marked this pull request as ready for review August 9, 2026 14:43
@cursor

cursor Bot commented Aug 9, 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 6177333 into main Aug 9, 2026
16 checks passed
@cursor
cursor Bot deleted the cursor/mlir-doom-e2e-b994 branch August 9, 2026 15:19
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