b+tree: move and shift a node's whole entry, not just its key - #156
Open
psiha wants to merge 1 commit into
Open
Conversation
psiha
force-pushed
the
bt/3-node-bounds
branch
from
September 9, 2026 10:34
7d85677 to
7488e14
Compare
psiha
force-pushed
the
bt/4-entry-mover
branch
from
September 9, 2026 10:34
79ef721 to
e389feb
Compare
psiha
force-pushed
the
bt/3-node-bounds
branch
from
September 9, 2026 10:39
7488e14 to
b47e72a
Compare
psiha
force-pushed
the
bt/4-entry-mover
branch
from
September 9, 2026 10:39
e389feb to
8790b31
Compare
psiha
force-pushed
the
bt/3-node-bounds
branch
from
September 9, 2026 10:43
b47e72a to
0b01005
Compare
psiha
force-pushed
the
bt/4-entry-mover
branch
2 times, most recently
from
September 9, 2026 10:49
faa88ab to
f807694
Compare
psiha
force-pushed
the
bt/3-node-bounds
branch
from
September 9, 2026 10:56
0b01005 to
5bec902
Compare
psiha
force-pushed
the
bt/4-entry-mover
branch
from
September 9, 2026 10:56
f807694 to
940536b
Compare
psiha
force-pushed
the
bt/3-node-bounds
branch
from
September 9, 2026 11:13
5bec902 to
7681361
Compare
psiha
force-pushed
the
bt/4-entry-mover
branch
from
September 9, 2026 11:13
940536b to
b15e5f7
Compare
Every site that relocates values inside or between nodes named the key array directly - move_keys, rshift_keys/lshift_keys, and nine raw std::shift_left/ right calls on node.keys. That is the same thing as assuming an entry IS a key, which holds only for a set. The three helpers now carry whatever arrays make up an entry, keyed off the node type: a map's leaf has a parallel array of mapped values that has to move by the same indices, in the same direction, at the same time. Child slots are deliberately not part of an entry - relocating those has to re-index and dirty every child touched, which is what move_chldrn is for. No behavioural change: with no node carrying values yet, every added branch is constant-false and compiles away.
psiha
force-pushed
the
bt/3-node-bounds
branch
from
September 9, 2026 12:01
7681361 to
de2a93a
Compare
psiha
force-pushed
the
bt/4-entry-mover
branch
from
September 9, 2026 12:01
b15e5f7 to
d0381cd
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.
Every site that relocates values inside or between nodes named the key array directly —
move_keys,rshift_keys/lshift_keys, and nine rawstd::shift_left/shift_rightcalls onnode.keys. That is the same thing as assuming an entry is a key, which holds only for a set.The three helpers now carry whatever arrays make up an entry, keyed off the node type: a map's leaf has a parallel array of mapped values that has to move by the same indices, in the same direction, at the same time. Child slots are deliberately not part of an entry — relocating those has to re-index and dirty every child touched, which is what
move_chldrnis for.No behavioural change: with no node carrying values yet, every added branch is constant-false and compiles away.
Stacked on #155.