Skip to content

Fix: Keep reserve capacity exact and monotonic - #777

Open
bvolpato wants to merge 1 commit into
unum-cloud:main-devfrom
bvolpato:bvolpato/bounded-reserve-capacity
Open

Fix: Keep reserve capacity exact and monotonic#777
bvolpato wants to merge 1 commit into
unum-cloud:main-devfrom
bvolpato:bvolpato/bounded-reserve-capacity

Conversation

@bvolpato

Copy link
Copy Markdown

Summary

  • Keep member reserve monotonic across later thread-limit changes.
  • Stop propagating hash-table load-factor slack into vector and graph capacities.
  • Add regression covering exact requested capacity, no shrink, and full insertion.

A/B evidence

New test against unmodified main-dev failed: requesting 10 members produced capacity 42. Same test on this branch passes with capacity 10 and remains 10 after a smaller reserve request.

Validation

  • cargo test -p usearch --no-default-features: 19 passed
  • Rust doc tests: 2 passed, 3 ignored
  • cargo clippy -p usearch --no-default-features --all-targets -- -D warnings

Draft notes

Opening as draft for allocator and capacity-contract review before maintainer submission.

@bvolpato
bvolpato marked this pull request as ready for review July 28, 2026 16:08
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.

1 participant