Skip to content

Split hashbrown dependency between Python-space and rustworkx-core#1552

Merged
IvanIsCoding merged 1 commit intoQiskit:mainfrom
jakelishman:split-hashbrown
Feb 16, 2026
Merged

Split hashbrown dependency between Python-space and rustworkx-core#1552
IvanIsCoding merged 1 commit intoQiskit:mainfrom
jakelishman:split-hashbrown

Conversation

@jakelishman
Copy link
Member

rustworkx-core exposes hashbrown types in its own public API, which requires downstream crates match their resolved hashbrown versions to the one used by rustworkx-core in its API (up to potentially using a re-export of hashbrown from rustworkx-core, but one isn't provided, and it's not really scalable for rustworkx-core to claim it dictates the version of such a commonly used package).

The Python-space rustworkx package passes hashbrown types between PyO3 and petgraph interfaces, so requires hard matches to the resolved versions used by those libraries, but that's a tighter constraint.

These separate concerns motivate splitting the allowed bounds on hashbrown, so that downstream Rust-space consumers of rustworkx-core can use newer versions of hashbrown without being held back by the Python-space package. For example, with this commit, Qiskit can now upgrade its internal use to hashbrown 0.16.1, including extracting those objects from (a newer) PyO3 and passing them to rustworkx-core.

`rustworkx-core` exposes `hashbrown` types in its own public API, which
requires downstream crates match their resolved `hashbrown` versions to
the one used by `rustworkx-core` in its API (up to potentially using a
re-export of `hashbrown` from `rustworkx-core`, but one isn't provided,
and it's not really scalable for `rustworkx-core` to claim it dictates
the version of such a commonly used package).

The Python-space `rustworkx` package passes `hashbrown` types between
PyO3 and `petgraph` interfaces, so requires hard matches to the resolved
versions used by those libraries, but that's a tighter constraint.

These separate concerns motivate splitting the allowed bounds on
`hashbrown`, so that downstream Rust-space consumers of `rustworkx-core`
can use newer versions of `hashbrown` without being held back by the
Python-space package.  For example, with this commit, Qiskit can now
upgrade its internal use to `hashbrown 0.16.1`, including extracting
those objects from (a newer) PyO3 and passing them to `rustworkx-core`.
@jakelishman
Copy link
Member Author

Just to draw attention to it: I've not modified the lockfile in this PR (and cargo build should leave it unchanged), so in practice this isn't actually tested by the repo at present. I didn't immediately have a sensible way in mind to do that, but I did test the build of rustworkx-core at the head of this PR against Qiskit and verified it can all compile using hashbrown@0.16.1 as a resolved dependency.

@IvanIsCoding
Copy link
Collaborator

I will take a look at this shortly

@coveralls
Copy link

Pull Request Test Coverage Report for Build 22074012743

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.167%

Totals Coverage Status
Change from base Build 22042501908: 0.0%
Covered Lines: 18388
Relevant Lines: 19527

💛 - Coveralls

@IvanIsCoding IvanIsCoding added this pull request to the merge queue Feb 16, 2026
Merged via the queue into Qiskit:main with commit d1379aa Feb 16, 2026
37 checks passed
@jakelishman jakelishman deleted the split-hashbrown branch February 16, 2026 19:19
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.

3 participants

Comments