Skip to content

Fix get_leaf boundary tolerance (keys lost after left root expansion) - #41

Open
vincy1068 wants to merge 1 commit into
microsoft:masterfrom
vincy1068:patch-1
Open

vincy1068 wants to merge 1 commit into
microsoft:masterfrom
vincy1068:patch-1

Conversation

@vincy1068

@vincy1068 vincy1068 commented Oct 31, 2026 •

Copy link
Copy Markdown

Fixes #40.

The get_leaf boundary tolerance was scaled by the predicted bucket number, but the
rounding error of a*key+b scales with |a*key| + |b|. After a left root expansion
(b += number of new children), boundary keys could be routed to an empty
neighbouring leaf and become unreachable.

Tested with alex_fuzz.cpp from #40 (400 random datasets, descending inserts,
g++ -O3 -DNDEBUG -march=native): 88/400 datasets lost keys before, 0/400 after,
reproduced on two different machines.

Added a comment explaining the rounding error related to the tolerance calculation.
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.

Keys become unreachable after left root expansion (get_leaf boundary tolerance too small)

1 participant