Skip to main content

OrderedRhoBounds

Struct OrderedRhoBounds 

Source
pub struct OrderedRhoBounds { /* private fields */ }
Expand description

A validated, finite, ordered ρ (log-λ) seed interval [lo, hi].

Every seed clamp in the outer-optimizer prepass and the candidate lattice derives a trial ρ and pins it into a single uniform box assembled from two independently-owned constants — the outer ρ lower wall (options.rho_lower_bound) and an over-smoothing ceiling (RHO_BOUND or an effective-df crossing). When those constants drift apart the interval inverts (lo > hi): the #2370 disease, where an edf-ceiling that used to equal -rho_lower_bound was moved by #2356 and the emitted upper bound dropped below the lower one. The historical response — silently swapping the pair (normalize_seed_bounds) — does not make the fit correct; it makes the optimizer solve a different, silently substituted box and return a model as if nothing were wrong. That is strictly worse than the panic it replaced: a panic is loud, a silently-wrong λ-box is not.

This type makes the inverted state unrepresentable. It is constructed only through OrderedRhoBounds::new, which refuses an inverted or non-finite interval with the same typed EstimationError::InvalidInput the outer entry (run_outer_uncertified) now enforces (#2379 / #2370). Every downstream clamp then operates on an interval that is ordered by construction, so f64::clamp’s min <= max precondition can never be violated.

Implementations§

Source§

impl OrderedRhoBounds

Source

pub fn new(lo: f64, hi: f64) -> Result<OrderedRhoBounds, EstimationError>

Validate and wrap a [lo, hi] ρ interval. Refuses (rather than silently reorders) an inverted (lo > hi) or non-finite interval, naming both endpoints. lo == hi is a valid degenerate single-point box.

Source

pub fn lower(self) -> f64

The (validated) lower endpoint.

Source

pub fn upper(self) -> f64

The (validated) upper endpoint.

Source

pub fn clamp(self, value: f64) -> f64

Clamp value into [lo, hi]. Infallible: the interval is ordered by construction, so f64::clamp’s min <= max precondition always holds.

Source

pub fn with_upper_at_least(self, floor: f64) -> OrderedRhoBounds

Raise the upper endpoint to at least floor, preserving orderedness.

The criterion-ranked prepass widens its over-smoothing bound to the full range the outer optimizer can reach (RHO_BOUND) so a genuinely large λ seed is not clipped to the seed band. This only ever raises hi, so the interval stays valid by construction. A non-finite floor is ignored to preserve the finiteness invariant (callers pass the finite RHO_BOUND).

Trait Implementations§

Source§

impl Clone for OrderedRhoBounds

Source§

fn clone(&self) -> OrderedRhoBounds

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OrderedRhoBounds

Source§

impl Debug for OrderedRhoBounds

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for OrderedRhoBounds

Source§

fn eq(&self, other: &OrderedRhoBounds) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OrderedRhoBounds

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V