pub struct TreeDraft {
pub shape: TreeShape,
pub spine: Vec<u32>,
pub hedges: Vec<HedgeNode>,
}Expand description
A proposed draft tree: spine tokens + hedge leaves for one verify step.
Fields§
§shape: TreeShape§spine: Vec<u32>Spine tokens, spine[d-1] = top-1 draft at depth d.
hedges: Vec<HedgeNode>Hedges sorted by (depth, rank) — the row-layout order.
Implementations§
Source§impl TreeDraft
impl TreeDraft
Sourcepub fn rows(&self, root_token: u32) -> Vec<TreeRow>
pub fn rows(&self, root_token: u32) -> Vec<TreeRow>
Verify-row layout: [root, spine…, hedges…]. root_token is the
last committed token (the chain paths’ a.last_token).
Sourcepub fn accept_path(&self, rows: &[TreeRow], v: &[u32]) -> (Vec<usize>, u32)
pub fn accept_path(&self, rows: &[TreeRow], v: &[u32]) -> (Vec<usize>, u32)
Longest root-to-leaf accepted path given per-row target argmaxes
v[row] (the target’s next token after that row). Returns the
accepted rows in order plus the bonus token (the target argmax at
the last accepted row — row 0 if nothing accepted). Byte-identical
to greedy by induction: children of a row hold distinct tokens, so
at most one matches v[parent].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeDraft
impl RefUnwindSafe for TreeDraft
impl Send for TreeDraft
impl Sync for TreeDraft
impl Unpin for TreeDraft
impl UnwindSafe for TreeDraft
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more