pub struct ContextBucket {
pub task_kind: TaskKind,
pub prompt_bucket_coarse: u32,
}Expand description
The context bucket that keys the bandit’s per-arm statistics.
Coarsened to keep the arm count dense: prompt_bucket_coarse = prompt_token_bucket / 2
halves the bucket resolution (floor(log2(n)) → floor(log2(n)/2) in effect), trading
granularity for faster warm-up.
ponytail: the ladder identity is not part of the key — in practice a given (TaskKind, prompt size) routes to the same ladder via the first-match routing rule. Would need to be included if operators run overlapping routes for the same context.
Fields§
§task_kind: TaskKindCoarse task classification from the request feature vector.
prompt_bucket_coarse: u32features.prompt_token_bucket / 2 — halved for denser arms.
Implementations§
Source§impl ContextBucket
impl ContextBucket
Sourcepub fn from_features(f: &Features) -> Self
pub fn from_features(f: &Features) -> Self
Derive a context bucket from a request’s feature vector.
Trait Implementations§
Source§impl Clone for ContextBucket
impl Clone for ContextBucket
Source§fn clone(&self) -> ContextBucket
fn clone(&self) -> ContextBucket
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 moreSource§impl Debug for ContextBucket
impl Debug for ContextBucket
impl Eq for ContextBucket
Source§impl Hash for ContextBucket
impl Hash for ContextBucket
Source§impl PartialEq for ContextBucket
impl PartialEq for ContextBucket
impl StructuralPartialEq for ContextBucket
Auto Trait Implementations§
impl Freeze for ContextBucket
impl RefUnwindSafe for ContextBucket
impl Send for ContextBucket
impl Sync for ContextBucket
impl Unpin for ContextBucket
impl UnsafeUnpin for ContextBucket
impl UnwindSafe for ContextBucket
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.