Skip to content

[MOD-14058] Generational arena#8408

Merged
LukeMathWalker merged 4 commits intomasterfrom
generational-arena
Feb 18, 2026
Merged

[MOD-14058] Generational arena#8408
LukeMathWalker merged 4 commits intomasterfrom
generational-arena

Conversation

@LukeMathWalker
Copy link
Copy Markdown
Collaborator

@LukeMathWalker LukeMathWalker commented Feb 17, 2026

Describe the changes in the pull request

Augment our fork of slab with generational indices, thus avoiding the ABA problem.
The PR is best reviewed commit-by-commit:

  • First changeset: Remove serde feature, since we won't need it and generational indices add complexity there
  • Second changeset: introduce a Key newtype that wraps around usize, the index of an entry into the slab.
  • Third changeset: change Key to be a (u32, u32) pair, tracking generation and position; update Entry to track generation for both vacant and occupied slots.
  • Fourth changeset: introduce a generation watermark to avoid "resurrecting" old keys after operations that remove vacant slots (clear/drain/compact/shrink_to_fit)

Which additional issues this PR fixes

  1. MOD-...
  2. #...

Main objects this PR modified

  1. ...

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

If a release note is required (bug fix / new feature / enhancement), describe the user impact of this PR in the title.


Note

Medium Risk
Touches low-level storage and key semantics (including panics/None behavior and compaction/shrink logic), so subtle correctness regressions could impact arena-backed structures, but changes are well-covered by expanded tests for stale-key invalidation.

Overview
Augments the generational_slab fork with generational indexing by introducing a (position, generation) Key and storing generations per slot, so lookups/removals with stale keys fail instead of aliasing reused slots (ABA prevention).

This is a breaking API shift: most slab APIs and iterators now use Key instead of usize, get_disjoint_mut gains a GenerationMismatch error, and internal behaviors update generation bookkeeping (including a generation_watermark to invalidate old keys across clear/drain/compact/shrink_to_fit). The PR also removes the serde feature and FromIterator<(usize, T)> path (deleting the builder/serde modules), updates numeric_range_tree’s NodeArena/NodeIndex to wrap the new Key, and refreshes tests/snapshots (including memory usage changes).

Written by Cursor Bugbot for commit 94a0589. This will update automatically on new commits. Configure here.

@LukeMathWalker LukeMathWalker changed the base branch from master to fork_slab February 17, 2026 14:43
@LukeMathWalker LukeMathWalker marked this pull request as ready for review February 17, 2026 14:56
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 97.97297% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.70%. Comparing base (04afa95) to head (94a0589).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/redisearch_rs/generational_slab/src/lib.rs 97.91% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8408      +/-   ##
==========================================
- Coverage   82.70%   82.70%   -0.01%     
==========================================
  Files         421      420       -1     
  Lines       60308    60425     +117     
  Branches    18246    18359     +113     
==========================================
+ Hits        49878    49974      +96     
- Misses      10244    10265      +21     
  Partials      186      186              
Flag Coverage Δ
flow 84.17% <ø> (-0.01%) ⬇️
unit 51.63% <97.97%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from fork_slab to master February 17, 2026 17:15
@LukeMathWalker LukeMathWalker force-pushed the generational-arena branch 2 times, most recently from d433a04 to df84f9c Compare February 18, 2026 07:49
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

gdesmott
gdesmott previously approved these changes Feb 18, 2026
gdesmott
gdesmott previously approved these changes Feb 18, 2026
@sonarqubecloud
Copy link
Copy Markdown

@LukeMathWalker LukeMathWalker added this pull request to the merge queue Feb 18, 2026
Merged via the queue into master with commit 54d28f3 Feb 18, 2026
50 checks passed
@LukeMathWalker LukeMathWalker deleted the generational-arena branch February 18, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants