pub struct LexicalCost;Expand description
The v1 default cost model: 1 - gestalt_ratio over the steps’ token sequences.
A step’s comparable text is "{name}: {outputs}" capped at [TEXT_CAP] characters —
outputs only, not inputs, because outputs carry the step’s observable behavior while inputs
largely echo the previous step’s outputs (spike 001 design, kept). The text is tokenized to
lowercase ASCII-alphanumeric runs, the same vocabulary a future tf-idf model would use.
Perf note: tokens are recomputed on every call, so a full alignment does O(n·m) tokenizations where O(n+m) would do. Deliberate at current scale (the gestalt DP dominates; the whole dev set diffs in ~2s unoptimized) — this is the first place to cache if very long runs ever feel slow.
Trait Implementations§
Source§impl Clone for LexicalCost
impl Clone for LexicalCost
Source§fn clone(&self) -> LexicalCost
fn clone(&self) -> LexicalCost
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LexicalCost
Source§impl CostModel for LexicalCost
impl CostModel for LexicalCost
Source§impl Debug for LexicalCost
impl Debug for LexicalCost
Source§impl Default for LexicalCost
impl Default for LexicalCost
Source§fn default() -> LexicalCost
fn default() -> LexicalCost
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LexicalCost
impl RefUnwindSafe for LexicalCost
impl Send for LexicalCost
impl Sync for LexicalCost
impl Unpin for LexicalCost
impl UnsafeUnpin for LexicalCost
impl UnwindSafe for LexicalCost
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