Repository navigation
Conversation
- Counts retained outer/inner capacities; size() stays O(1). - Adds 3 regressions: capacity retention, growth, emit/reuse.
- Existing regression now checks evaluate(EmitTo::First(1)) output + remaining size, both min/max. - Kept direct full-emission byte-length checks.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26154 +/- ##
==========================================
+ Coverage 82.76% 82.77% +0.01%
==========================================
Files 1147 1147
Lines 450354 450850 +496
Branches 450354 450850 +496
==========================================
+ Hits 372714 373179 +465
- Misses 54932 54947 +15
- Partials 22708 22724 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kosiew
marked this pull request as ready for review
October 9, 2026 14:28
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.
Which issue does this PR close?
sizefunctions #23393Rationale for this change
Grouped byte MIN/MAX accumulators can underreport memory usage because their accounting is based on the current data length and number of group slots rather than the memory allocations they retain.
For example, replacing a 128-byte string with a one-byte string reuses the existing vector allocation, but the previous accounting reports only the new string length. Similarly, unused capacity in the outer group vector is not counted.
This change makes memory accounting reflect retained allocations, providing more accurate memory usage estimates for grouped MIN/MAX operations.
What changes are included in this PR?
total_data_capacitytoMinMaxBytesStateto track retained innerVec<u8>capacities independently oftotal_data_bytes, which remains responsible for output preallocation.set_value()to maintain capacity accounting when values are inserted, replaced, or cause an existing vector to grow.size()to account for the outermin_maxvector's capacity and the cached inner vector capacities, without double-counting the inlineOption<Vec<u8>>descriptors.size()O(1) by maintaining the inner capacity total incrementally.emit_to()to reset capacity accounting on full emission and subtract emitted inner vector capacities on partial emission.Are these changes tested?
Three regression tests are added:
size_counts_outer_capacity: Verifies that memory accounting includes allocated outer vector capacity, even when fewer group slots are initialized.size_retains_inner_capacity: Tests both MIN and MAX accumulators, verifying that replacing a long string with a shorter one preserves retained-capacity accounting and that partial and full emission update it correctly.size_tracks_growth_and_emit_reuse: Verifies capacity accounting when an inner vector grows, groups are partially emitted, and the state is reused after full emission.Are there any user-facing changes?
No changes to SQL MIN/MAX results or public APIs are intended.
The change corrects internal memory accounting for grouped byte MIN/MAX accumulators, allowing retained allocations to be reported more accurately.
LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed.