pub struct VariableArityNode<G: DenseId, O: DenseId> {
pub global_id: G::Repr,
pub op: O::Repr,
pub start: usize,
pub end: usize,
pub flags: u8,
}Expand description
A node whose children live in a shared side pool, addressed by a [start, end) span.
start/end stay usize deliberately, and this is the one place in the store where
that is the right answer rather than an unfixed hardcoding. Everywhere else a stored index
drops to the id family’s Index word, because what it addresses is one-per-id and so its
population is bounded by the id capacity — ClassData::min_row is the pattern: one pool
row per class, so a row number cannot outgrow T::Index.
The child pool has no such bound. Its length is the sum of arities over every
variable-arity node, which no single population bounds: G::Index bounds the node count,
and nothing at all bounds the per-node arity. Narrowing these two words to G::Index
would therefore not track a width — it would install a fresh capacity cap at
G::Index::MAX children in total, reachable at the 31-bit config with a few large AC
terms, reintroducing the capacity cap this representation avoids. Pointer
width is the honest width for an offset into a pool whose population is Σ arity.
The size is asserted below, so this choice is priced rather than assumed: two usize
words are what put the node at 32 bytes.
Fields§
§global_id: G::Repr§op: O::Repr§start: usizeInclusive start of this node’s span in the child pool. usize, not G::Index — see
the type doc: the pool’s population is Σ arity, which the id capacity does not bound.
end: usizeExclusive end of this node’s span in the child pool. usize for the same reason as
start.
flags: u8