For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
index_key_layer_pages
def index_key_layer_pages[record_bytes: Int](blocks: TileTensor[.uint8, Engine=blocks.Engine, address_space=blocks.address_space, linear_idx_type=blocks.linear_idx_type], page_stride: Int, layer: Int) -> Tuple[Pointer[UInt8, MutUntrackedOrigin], Int]
Locates one layer's pages in a multi-layer paged index-key leaf.
The leaf is [blocks, 1, layers, page_size, 1, record_bytes]: each block
holds one page per layer, in layer order. The layer's page in block b
starts b * pitch bytes past the returned base and spans
page_size * record_bytes bytes, so its last page ends inside the leaf.
Parameters:
- βrecord_bytes (
Int): Bytes of one stored key.
Args:
- βblocks (
TileTensor[.uint8, Engine=blocks.Engine, address_space=blocks.address_space, linear_idx_type=blocks.linear_idx_type]): The leaf's blocks. - βpage_stride (
Int): Bytes from one block to the next, or-1when packed. - βlayer (
Int): The layer's index within the leaf.
Returns:
Tuple[Pointer[UInt8, MutUntrackedOrigin], Int]: The layer's page in block 0, and the block pitch in bytes.
Raises:
If the leaf does not hold record_bytes records, the pitch is not a
multiple of 16 holding a block, or the layer is out of range.