Replace bits-and-blooms/bitset with roaring bitmaps#2386
Replace bits-and-blooms/bitset with roaring bitmaps#2386ValentaTomas wants to merge 1 commit intomainfrom
Conversation
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit 4b07195. Bugbot is set up for automated code reviews on this repo. Configure here. |
fc7f1b4 to
0205899
Compare
6ec4c90 to
b81ec2a
Compare
b6fa8a5 to
b0717ba
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa35957fa3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7424c06 to
60f17c9
Compare
60f17c9 to
a55db6c
Compare
jakubno
left a comment
There was a problem hiding this comment.
Nice! 🚀 1 suggestion left in comments
2057d3d to
d975833
Compare
Use roaring v2.17.0 with the new Ranges() iterator throughout. Remove bitset as a direct dependency.
9e25080 to
4b07195
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4b07195. Configure here.
| // The caller must ensure no concurrent SetRange calls while using the result. | ||
| func (b *Bitset) ReadOnly() *ReadOnly { | ||
| return &ReadOnly{bm: b.bm} | ||
| } |
There was a problem hiding this comment.
ReadOnly view shares live bitmap without copying
Medium Severity
Bitset.ReadOnly() returns a view sharing the same underlying *roaring.Bitmap without copying. The old atomicbitset.BitSet() called b.bm.ToBitSet(), which produced a snapshot copy. In ExportToDiff, the returned DiffMetadata.Dirty now aliases c.dirty.bm; after the lock is released, any concurrent WriteAtWithoutLock → setIsCached → c.dirty.SetRange mutates the bitmap that downstream consumers (e.g. ToDiffHeader, ExportMemory) are reading, creating a data race.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4b07195. Configure here.


Replace all direct usage of
bits-and-blooms/bitsetwithroaring/v2(v2.17.0). Uses the newRanges()iterator (#522) for range iteration inCreateMappingandBitmapRanges.