Skip to content

[WIP] Move in-memory providers to diskann-inmem crate - blocked by orphan rules#713

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/move-inmem-provider-to-crate
Draft

[WIP] Move in-memory providers to diskann-inmem crate - blocked by orphan rules#713
Copilot wants to merge 3 commits intomainfrom
copilot/move-inmem-provider-to-crate

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Attempts to extract in-memory providers from diskann-providers into a standalone diskann-inmem crate. The refactoring is blocked by Rust's orphan rules - the inmem providers implement diskann-providers traits for diskann-providers types, which is only permitted within the same crate.

Changes Made

  • Created diskann-inmem crate: New workspace member with provider implementations moved from diskann-providers/src/model/graph/provider/async_/inmem/
  • Updated import paths: All moved files now import from diskann_providers:: instead of crate::
  • Migrated helper APIs: Moved diskann_async module and storage implementations to new crate
  • Updated consumers: diskann-benchmark and diskann-disk now depend on and import from diskann-inmem
  • Relocated SQError: Moved to diskann-providers/src/storage/sq_storage.rs to avoid circular dependencies

Orphan Rule Violations

Multiple trait implementations violate Rust's orphan rules:

// In diskann-inmem, attempting to implement diskann-providers trait
// for diskann-providers type - not allowed
impl CreateVectorStore for FixedChunkPQTable { ... }
impl<T> SetElementHelper<T> for FullPrecisionStore<T> { ... }

The code compiled when in diskann-providers because trait, implementation, and types were co-located.

Resolution Options

  1. Newtype wrappers: Wrap external types in diskann-inmem-defined newtypes
  2. Split trait/impl: Keep implementations in diskann-providers, move data structures only (creates circular deps)
  3. Revert: Keep inmem organized as submodule within diskann-providers
  4. Trait redesign: Define inmem-specific traits in diskann-inmem (larger refactor)

Current state: crate structure exists but doesn't compile. Requires architectural decision before proceeding.

Original prompt

This section details on the original issue you should resolve

<issue_title>Move in-mem provider from inside diskann-providers to its own crate</issue_title>
<issue_description>

In-memory providers are in diskann-providers/src/model/graph/provider/async_/inmem. Move them up to diskann-inmem crate</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 3, 2026 19:11
Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com>
… rule issues

Co-authored-by: harsha-simhadri <5590673+harsha-simhadri@users.noreply.github.com>
Copilot AI changed the title [WIP] Move in-mem provider to its own crate [WIP] Move in-memory providers to diskann-inmem crate - blocked by orphan rules Feb 3, 2026
Copilot AI requested a review from harsha-simhadri February 3, 2026 19:21
@harsha-simhadri
Copy link
Contributor

harsha-simhadri commented Feb 5, 2026

@copilot List all instances of orphan rule violations and lets work on resolving case by case

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.

Move in-mem provider from inside diskann-providers to its own crate

2 participants