func RangeNodes(begin, end uint64) []NodeID {
	left, right := Decompose(begin, end)
	ids := make([]NodeID, 0, bits.OnesCount64(left)+bits.OnesCount64(right))
	pos := begin
	for bit := uint64(0); left != 0; pos, left = pos+bit, left^bit {
		level := uint(bits.TrailingZeros64(left))
		bit = uint64(1) << level
		ids = append(ids, NewNodeID(level, pos>>level))
	}
	for bit := uint64(0); right != 0; pos, right = pos+bit, right^bit {
		level := uint(bits.Len64(right)) - 1
		bit = uint64(1) << level
		ids = append(ids, NewNodeID(level, pos>>level))
	}
	return ids
}
RangeNodes returns node IDs that comprise the [begin, end) compact range.
package compact
import "math/bits"
type NodeID struct {
	Level uint
	Index uint64
}
func NewNodeID(level uint, index uint64) NodeID {
	return NodeID{Level: level, Index: index}
}