Skip to content

Fix: Keep reserve capacity exact and monotonic - #777

Merged
ashvardanian merged 1 commit into
unum-cloud:main-devfrom
bvolpato:bvolpato/bounded-reserve-capacity
Aug 22, 2026
Merged

ashvardanian merged 1 commit into
unum-cloud:main-devfrom
bvolpato:bvolpato/bounded-reserve-capacity

Conversation

@bvolpato

Copy link
Copy Markdown
Contributor

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
@ashvardanian
ashvardanian merged commit 88d9a5e into unum-cloud:main-dev Aug 22, 2026
@ashvardanian

Copy link
Copy Markdown
Member

Thank you, @bvolpato! Sorry it took a while to check this 🤗

ashvardanian pushed a commit that referenced this pull request Aug 22, 2026
### Patch

- Fix: Respect Cargo-selected Windows CRT #778 (6bf5f1b)
- Fix: Reserve the requested member capacity #777 (88d9a5e)
- Fix: Bound file-controlled sizes in `view()` (#776) (64d10d8)
- Make: Pin citations, deps, and CI versions (810c172)
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.

2 participants