Skip to content

Introduce New Blocked Leaf Page Format - #29

Open
vidyasilai wants to merge 24 commits into
mathworks:mainfrom
vidyasilai:blocked_leaf_intro
Open

Introduce New Blocked Leaf Page Format#29
vidyasilai wants to merge 24 commits into
mathworks:mainfrom
vidyasilai:blocked_leaf_intro

Conversation

@vidyasilai

@vidyasilai vidyasilai commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

This PR adds some preliminary code for starting the transition to blocked leaf pages.

The changes in the PR can be grouped into these high-level categories:

  • Use of artc library, removal of ART code within turtle_kv.
  • PiecewiseFilter refactor.
  • Addition of PackedBlockedLeafPage and related code in the tree/leaf directory.
  • Addition of blocked leaf scanning and page loading.

File with notable changes recently:

  • tree/leaf/packed_blocked_leaf_page.ipp
  • tree/leaf/scan_blocked_leaf.hpp
  • tree/leaf/packed_blocked_leaf_page.test.cpp
  • tree/testing/in_memory_block_loader.hpp
  • tree/leaf/packed_blocked_leaf_page.sharded_live_ranges.hpp, tree/leaf/packed_blocked_leaf_page.sharded_live_ranges.ipp
  • tree/leaf/blocked_leaf_page_loader.hpp, tree/leaf/blocked_leaf_page_loader.cpp

@vidyasilai vidyasilai self-assigned this Aug 12, 2026
slice_reader.read_slice(Interval<usize>{0, this->block_size_},
this->slice_storage_,
this->pin_page_to_job_,
llfs::LruPriority{kTrieIndexLruPriority}));

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change the LRU priority here (and on line 62).

std::lower_bound(begin,
end,
key_range.lower_bound,
[](const PackedKeyValueSlotPtr& slot, const KeyView& key) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use KeyOrder for this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return block.status();
}

Slice<const PackedKeyValueSlotPtr> slice = std::get<Slice<const PackedKeyValueSlotPtr>>(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of std::get

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


llfs::PageId page_id_;
const PackedBlockedLeafPage* leaf_ = nullptr;
SmallVec<ConstBuffer, 256> cache_;

@tonyastolfi tonyastolfi Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe increase cache associativity -- e.g., store block i at cache_[i % 256]? The idea being to avoid heap allocation entirely -- we'll need to store i / 256 for each cache slot to make that work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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.

2 participants