Skip to main content

SecondOpinionAvailability

Struct SecondOpinionAvailability 

Source
pub struct SecondOpinionAvailability {
    pub trigger: SecondOpinionTrigger,
    pub scaling_retry_enabled: bool,
    pub mu_retry_enabled: bool,
    pub perturbed_start_retry_enabled: bool,
    pub already_mc64: bool,
    pub already_adaptive: bool,
    pub already_perturbed: bool,
    pub increase_quality_retry_enabled: bool,
    pub already_no_increase_quality: bool,
    pub baseline_quality_escalations: u64,
    pub baseline_scaling: Option<&'static str>,
}
Expand description

What the baseline options already provide, so a rung that would be a no-op can be dropped instead of burning a solve to re-derive the same answer.

Fields§

§trigger: SecondOpinionTrigger§scaling_retry_enabled: bool§mu_retry_enabled: bool§perturbed_start_retry_enabled: bool§already_mc64: bool§already_adaptive: bool§already_perturbed: bool

The baseline already displaces the start, so there is no displacement left for the third rung to add that the failing solve did not have.

§increase_quality_retry_enabled: bool

feral_increase_quality_retry (gh#857), rung 4’s own enable.

§already_no_increase_quality: bool

The baseline already ran with feral_increase_quality=no, so rung 4 would re-run the solve that just failed.

§baseline_quality_escalations: u64

How many times the failing solve’s linear solver actually accepted an increase_quality escalation — the quality_escalations statistic.

The only entry here that is a measurement of the solve rather than a reading of its options, and rung 4 is unimplementable without it: an escalation moves no field a report carries, so “did this solve take the rung that has a documented losing direction” cannot be answered from the verdict. 0 means provably not a candidate, and rung 4 is dropped — which is what stops a budget exit on a never-escalating model from paying for an extra solve.

It is a gate at >= 1, deliberately not a threshold. deb7 and square_flowsheet_resto’s base solve escalate exactly twice each on their exact legs, one gaining the solve and one losing it, so no count separates them; the verdict does.

§baseline_scaling: Option<&'static str>

feral_scaling tag naming the baseline’s resolved scaling strategy. None under ScalingStrategy::External, which drops rungs 2 and 3.

Now purely a gate. It was the tag those rungs wrote back to undo rung 1, and None meant there was nothing to write; the driver’s snapshot restores by set-ness instead, so no tag is needed and the External case would in fact be safe to run. The gate is kept because dropping it adds two rungs on externally-scaled models — a trajectory change, and a separate decision from this bug fix.

Implementations§

Source§

impl SecondOpinionAvailability

Source

pub fn from_options( options: &OptionsList, trigger: SecondOpinionTrigger, baseline_quality_escalations: u64, ) -> Self

Read everything the ladder needs to know about the baseline solve out of the options it ran under.

The scaling and barrier tags are read from the resolved strategy, not from the option strings. feral_scaling is applied only when set explicitly and otherwise FeralConfig::from_env() governs via POUNCE_FERAL_SCALING, so the option string reads auto for an env-configured run; writing that back would silently override the environment on the retry instead of restoring it. External is unreachable from the string option, and if it ever arrives here there is no tag to write, so the rungs that need one are dropped rather than guessed at. baseline_quality_escalations is the failing solve’s SolveStatistics::quality_escalations, and it is a required parameter rather than a defaulted setter for the reason gh#857 exists at all: the quantity is invisible everywhere else, so a caller that forgot it would silently pass 0, rung 4 would never open, and the recovery would look like a rung that simply does not fire. A missing argument is a compile error; a forgotten setter is a regression nobody can see.

Trait Implementations§

Source§

impl Clone for SecondOpinionAvailability

Source§

fn clone(&self) -> SecondOpinionAvailability

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 SecondOpinionAvailability

Source§

impl Debug for SecondOpinionAvailability

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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> 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<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> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more