Skip to content

refactor: convert mlxcel-core and mlxcel-surgery into workspace members #7

Closed

Description

@inureyes

Follow-up to #1 / #3 — discovered while writing the OSS release follow-up and verified against past notes.

Problem

The repo's root Cargo.toml is a single-package manifest (no [workspace]), and src/lib/mlxcel-core / src/lib/mlxcel-surgery are pulled in via path = ... dependencies. Each of those crates carries its own Cargo.lock, which causes several developer-experience problems:

  1. Running cargo test -p mlxcel-core from the repo root fails on dev-dependency resolution (e.g. tracing-test not resolved against the root lock). Contributors have to cd src/lib/mlxcel-core to test the core library.
  2. cargo deny check from the repo root only audits the root lock; the mlxcel-core and mlxcel-surgery per-crate locks are not covered unless re-run inside each directory.
  3. Per-crate Cargo.lock files can drift apart, producing builds where the same transitive dep resolves to different versions depending on entry crate.
  4. Dependabot in PR chore: add OSS security automation and community health files #3 needs three separate directory: entries (root, mlxcel-core, mlxcel-surgery) precisely because of this layout; a true workspace would need only one.

Tasks

  • Add [workspace] to the root Cargo.toml with members = ["src/lib/mlxcel-core", "src/lib/mlxcel-surgery"] (or use members = [".", "src/lib/*"])
  • Remove the per-crate Cargo.lock files from src/lib/mlxcel-core/ and src/lib/mlxcel-surgery/
  • Verify cargo build --release --features metal,accelerate still works end-to-end on macOS Apple Silicon
  • Verify cargo test -p mlxcel-core from the repo root resolves dev-deps correctly
  • Verify cargo deny check from the repo root now covers all three crates' deps
  • Update .github/dependabot.yml to a single root-level cargo entry (the three sub-entries become redundant once the workspace lock is unified)
  • Verify the MLX C++ build cache markers (src/lib/mlx-cpp/CMakeLists.txt, src/lib/mlxcel-core/build.rs MLX_EXPECTED_COMMIT) still trigger correctly with the workspace layout

Risks

  • The current independent-lock layout was chosen historically for a reason (per-crate version pinning for the C++ FFI side?). Verify with git log Cargo.lock and the original author before deleting.
  • Some transitive deps may resolve to a different version under a unified lock and behave subtly differently. Run the full test suite and a representative model inference benchmark before / after.

Refs

Activity

  1. added
    type:refactor
    priority:medium
    status:ready
    area:core
    on May 18, 2026
  2. self-assigned this
    on May 18, 2026
  3. added
    status:in-progress
    status:review
    and removed
    status:ready
    status:in-progress
    on May 18, 2026
  4. added a commit that references this issue on May 18, 2026
    db35c68
  5. added
    status:done
    and removed
    status:review
    on May 18, 2026
  6. added this to the 0.1 milestone on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:corepriority:mediumstatus:donetype:refactor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions