Repository navigation
Account for per-leaf codec overhead exactly - #28
Merged
Merged
Conversation
IncidenceCodec charged one byte per entry for its flags byte and column bitmaps, which undercounted leaves under 8 entries and only worked because of the layout reserve. Codecs can now declare a per-leaf overhead, and leaf sizes and bulk building include it.
venkat1701
force-pushed
the
fix/exact-leaf-accounting
branch
from
October 4, 2026 08:29
abf109a to
b6b94d9
Compare
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.
Closes #14
IncidenceCodec.maxSizecharged one byte per entry to cover the flags byte and the column bitmaps. For leaves under 8 entries that came up short by up to 7 bytes, and it only worked becauseLayoutkeeps a 32-byte reserve.ValueCodecnow has aleafOverhead(entries)hook (0 by default).IncidenceCodecreturns1 + columns * ceil(n / 8)and no longer adds a byte per entry.Leaf.bytes()andBulkBuilderinclude the overhead when deciding splits. The reserve is still there, but nothing relies on it anymore.For large leaves the new bound is a bit tighter than before (
1 + 6 * ceil(n/8)instead ofn), so leaves can hold slightly more entries. The on-disk encoding doesn't change.IncidenceCodecTest:Full
./mvnw installpasses locally, including the crash matrix.