vx-lang / vx-lang/Vx

Epic: Migrate to Formal MLIR Rust Crate (`melior`) for Hardware Plugin IR Generation

Open
#32 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen runtime tracking
Dominant language
Rust
Stars
14
Forks
2
Avg merge
12h 42m
Merged PRs (30d)
61

Description

The current plugin architecture uses lightweight, string-based mocking for MLIR generation (Operation, Module structs in hardware_trait.rs). To fully comply with the formal VxHardwarePlugin contract, we must replace this mock strategy with robust, AST-based MLIR generation utilizing a proper Rust bindings crate (such as melior).

Rationale

Relying on string concatenation for IR generation does not scale to complex hardware topologies and hinders modular optimization passes. A formal MLIR crate ensures type safety, predictable lowering, and standard validation before binary generation.

Subtasks
  • Investigate and integrate melior (or another suitable MLIR Rust binding library) into the Vx build system.
  • Refactor codegen.rs to construct an actual MLIR Context, Module, and Operations using the library's AST instead of String accumulation.
  • Update VxHardwarePlugin trait to pass native melior::ir::Operation pointers.
  • Migrate AppleNPEPlugin (and any other reference plugins) to utilize the formal MLIR inputs for their vendor-specific passes and lowering.
  • Ensure the JIT execution (lli) and mlir-opt pipeline interacts correctly with the dynamically produced MLIR.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with hardware_trait.rs and codegen.rs to understand the current string-based Operation and Module flow, then inspect the Vx build system and AppleNPEPlugin integration. Review how lli and mlir-opt are currently invoked. Done means the formal MLIR crate is integrated, plugins use native IR inputs, and the JIT and optimization pipeline still interact correctly with generated MLIR.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.