Open
Conversation
CvvT
commented
Feb 25, 2026
|
🤖 SemverChecks 🤖 No breaking API changes detected Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered. |
sangho2
approved these changes
Feb 25, 2026
Contributor
sangho2
left a comment
There was a problem hiding this comment.
Looks good to me! minor comments.
| fn grow(&mut self) -> Option<u32> { | ||
| let new_id = self.max_ids; | ||
| // Guard: bitmap.len() * 64 must fit in u32. | ||
| if self.bitmap.len() >= u32::MAX as usize / 64 { |
Contributor
There was a problem hiding this comment.
In the worst case, the size of this bitmap would be 512 MB. In practice, we might want to have a hybrid approach: growable with mem cap.
| // Safety of truncation: the guard above ensures bitmap.len() * 64 fits in u32. | ||
| #[allow(clippy::cast_possible_truncation)] | ||
| { | ||
| self.max_ids = (self.bitmap.len() as u32) * 64; |
Contributor
There was a problem hiding this comment.
self.max_ids = self.max_ids + 64?
| let start = if self.hint >= cap - 1 { | ||
| 0 | ||
| } else { | ||
| self.hint + 1 |
|
|
||
| /// Mark an ID as free so it can be reused. | ||
| /// | ||
| /// IDs beyond the current capacity and already-free IDs are silently |
Contributor
There was a problem hiding this comment.
sounds like a bug. debug_assert might be helpful.
|
|
||
| impl SessionIdPool { | ||
| /// Maximum recyclable session ID tracked by the bitmap. | ||
| const MAX_RECYCLABLE_SESSION_ID: u32 = 65535; |
Contributor
There was a problem hiding this comment.
With this new IdPool, 65536 might work now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As mentioned in #684, asked agent to move the bitmap-based ID generator to LiteBox to avoid duplication.