Skip to content

Conversation

@copybara-service
Copy link

Fix one-off in dcheck.

How to prove correctness:

  1. when position is 0, max_length is allowed to be ringbuffer_size
  2. in other words: position + max_length <= ringbuffer_size
  3. ringbuffer_mask == ringbuffer_size - 1
  4. thus position + max_length <= ringbuffer_size + 1

@copybara-service copybara-service bot force-pushed the test_835164941 branch 3 times, most recently from 5bc51d9 to b199365 Compare November 24, 2025 11:04
How to prove correctness:
1) when `position` is `0`, `max_length` is allowed to be `ringbuffer_size`
2) in other words: `position + max_length <= ringbuffer_size`
3) `ringbuffer_mask == ringbuffer_size - 1`
4) thus `position + max_length <= ringbuffer_size + 1`

PiperOrigin-RevId: 836145553
@copybara-service copybara-service bot merged commit 486ed5b into master Nov 24, 2025
@copybara-service copybara-service bot deleted the test_835164941 branch November 24, 2025 11:05
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