Summary
The repository currently contains two separate WASM backend implementations:
- one under
compiler/src/backend/wasm.rs
- one under
compiler/src/codegen/wasm.rs
Tests and backend selection do not consistently go through the same implementation path.
Why this matters
- duplicated backend implementations create maintenance drift
- behavior can diverge silently if tests validate one path while the compiler driver uses another
- future WASM work is harder to prioritize when ownership is split
Current behavior
At least one test path uses the backend module directly, while backend selection in the main codegen wrapper goes through the codegen module's WASM backend.
Expected behavior
The project should have one authoritative WASM backend implementation, and tests plus driver code should exercise that same implementation path.
Suggested scope
- choose one WASM backend implementation as authoritative
- update tests and backend selection to use that path consistently
- delete, demote, or clearly isolate the non-authoritative implementation
- add a small regression check that ensures the tested path matches the production selection path
Acceptance criteria
- one implementation is the source of truth for WASM codegen
- tests and backend selection use the same implementation path
- duplicate backend code is removed or intentionally isolated with clear ownership
Summary
The repository currently contains two separate WASM backend implementations:
compiler/src/backend/wasm.rscompiler/src/codegen/wasm.rsTests and backend selection do not consistently go through the same implementation path.
Why this matters
Current behavior
At least one test path uses the backend module directly, while backend selection in the main codegen wrapper goes through the codegen module's WASM backend.
Expected behavior
The project should have one authoritative WASM backend implementation, and tests plus driver code should exercise that same implementation path.
Suggested scope
Acceptance criteria