Contributing to LIFT
Thanks for your interest in contributing to LIFT — a unified intermediate representation for AI and quantum computing.
This guide covers the development workflow, project layout, and how to get your changes reviewed and merged.
Table of contents
- Development setup
- Project layout
- Building and testing
- Code style
- Validation
- Publishing
- Commit conventions
- Opening a pull request
Development setup
Requirements:
- Rust 1.80 or newer (see
rust-versioninCargo.toml) - Cargo (comes with Rust)
Clone and build:
git clone git@github.com:rustnew/Lift.git
cd Lift
cargo build --workspace
Project layout
LIFT is a Cargo workspace of 13 published crates, organised by dependency layer:
| Layer | Crates | Purpose |
|---|---|---|
| L0 — Foundation | lift-core, lift-config | SSA IR, verifier; O0–O3 pipeline config |
| L1 — Dialects & Frontend | lift-ast, lift-tensor, lift-quantum | lexer/parser; AI ops; quantum gates & noise |
| L2 — Analysis & I/O | lift-opt, lift-sim, lift-export, lift-import, lift-hybrid | passes; cost model; backends; importers; fusion |
| L3 — Prediction | lift-predict | roofline / performance prediction |
| L4 — Tools | lift-cli, lift-codegen | CLI; programmatic model generation |
lift-tests is a private crate (publish = false) used for integration tests.
Building and testing
# Build the whole workspace
cargo build --workspace
# Run all tests
cargo test --workspace
# Build a single crate
cargo build -p lift-core
Code style
- Run
rustfmt— CI enforcescargo fmt --all --check. - Run
clippywith warnings denied — CI enforcescargo clippy --all-targets -- -D warnings. - Keep changes minimal and focused on a single concern.
cargo fmt --all
cargo clippy --all-targets -- -D warnings
Validation
Before submitting, run the end-to-end validation script, which exercises the
full pipeline (verify → analyse → optimise → predict → export) across all
example models:
bash examples/validate_all.sh
This is also run in CI on every push to main and on pull requests.
Publishing
Releases are published to crates.io. The process:
-
Bump the version in
Cargo.toml([workspace.package] version) and update version references acrossREADME.mdand the docs (LIFT_Guide.md,LIFT_Manual.md,LIFT_design.md,DIALECTS.md). -
Update
CHANGELOG.md. -
Push a version tag — the
publishworkflow publishes all 13 crates automatically in dependency order (L0 → L1 → L2 → L3 → L4) using Trusted Publishing (OIDC, no API token):git tag v0.4.4 git push origin v0.4.4Trusted Publishing is configured per crate on crates.io (Settings → Trusted Publishing) for
rustnew/Lift, workflowpublish.yml. The workflow can also be triggered manually via the Actions tab (workflow_dispatch).crates.io does not allow overwriting a published version — a fix to an already-published release requires a new version bump.
-
Create a GitHub release:
gh release create v0.4.4 --title "..." --notes "..."
Manual fallback
If you need to publish outside CI (e.g. the very first release of a new crate), publish in dependency order with the API token:
cargo publish -p lift-core
cargo publish -p lift-config
# ... then L1, L2, L3, L4 ...
Commit conventions
Use conventional commit prefixes:
feat:— new featurefix:— bug fixdocs:— documentation onlychore:— maintenance (bumps, metadata, tooling)refactor:— code change that neither fixes a bug nor adds a featuretest:— adding or updating tests
Example: docs: add vision, roadmap, and layer-graph diagrams to README
Opening a pull request
- Fork the repository and create a feature branch.
- Make your changes, keeping them focused.
- Run
cargo fmt,cargo clippy,cargo test, andbash examples/validate_all.sh. - Push your branch and open a pull request against
main. - CI runs automatically (fmt, clippy, tests, validation). All checks must pass before merge.
Thank you for contributing to LIFT!