logos.std.data.persistent.bt.shuttle

Module std · package logos-std

Types

structShuttleResult

struct ShuttleResult

Outcome of one branch-descent step: which child to enter and the adjusted target.

Fields

idx: u64

Index of the child to descend into.

remainder: u64

Adjusted target to carry into the recursive descent (e.g. target - prefix).

Functions

fnshuttle_max_k

fn shuttle_max_k(slots: *const Buffer<K>, target: K::ViewInStore) -> ShuttleResult

Generic MAX-dimension shuttle over K: returns the smallest i with slots[i] >= target. slots is the keys column of a BranchNode (i-th slot = max key in children[i]'s subtree); comparison goes through cmp_views. Out-of-range target clamps to the last child; remainder is always 0 (kept only for ABI parity with the SUM/MAX u64 shuttles).

fnshuttle_max_u64

fn shuttle_max_u64(slots: *const PrimVec<u64>, target: u64) -> ShuttleResult

Finds the first child whose max-key slot is >= target in a MAX-dimension branch. If none qualifies, target is past the last subtree — clamps to the last child.

fnshuttle_sum_u64

fn shuttle_sum_u64(slots: *const PrimVec<u64>, target: u64) -> ShuttleResult

Finds the child whose prefix-sum range brackets target in a SUM-dimension branch. Assumes target is in-range; caller must check len == 0 and the total beforehand. Out-of-range target clamps to the last child with full remainder.