pub enum EncodeDeploymentDecision {
Met {
measured_rows_per_sec: f64,
target_rows_per_sec: f64,
},
Unmet {
measured_rows_per_sec: f64,
target_rows_per_sec: f64,
},
Undetermined {
reason: EncodeDecisionBlocked,
},
}Expand description
Tri-state Stage-3 encode deployment / amortized-surrogate decision (#988, #1412).
The decision the throughput gate exists to make is empirical: does the EXACT
per-row encode clear the 100_000 rows/sec/GPU deployment target on a real
device? Only a real device measurement can answer it:
Self::Met— a device measurement CLEARED the target: ship the exact encode; the certified amortized surrogate is NOT needed.Self::Unmet— a device measurement MISSED the target: the certified amortized surrogate becomes justified.Self::Undetermined— no device measurement is available. The decision is BLOCKED on hardware; it is neither “surrogate unneeded” nor “surrogate justified”.
The critical anti-green-wash property (#1412): there is NO constructor that
takes a CPU rate. A CPU measurement, however fast, can never move the decision
out of Self::Undetermined. Projecting a CPU rate through an assumed
CPU→GPU factor to declare the target met was the exact #1412 defect and is
structurally impossible here — Self::Met / Self::Unmet come only from
Self::from_device_measurement with engaged == true.
Variants§
Met
A device measurement established the deployment target.
Fields
Unmet
A device measurement fell short of the deployment target.
Fields
Undetermined
No device measurement is available; the decision is blocked on hardware.
Fields
reason: EncodeDecisionBlockedWhy no device measurement could be made.
Implementations§
Source§impl EncodeDeploymentDecision
impl EncodeDeploymentDecision
Sourcepub fn from_device_measurement(
engaged: bool,
measured_rows_per_sec: f64,
) -> Self
pub fn from_device_measurement( engaged: bool, measured_rows_per_sec: f64, ) -> Self
The ONLY path to a Met/Unmet decision: a device measurement that
actually engaged the device and produced a usable rate. engaged == false
(false routing / CPU decline) or a non-finite / non-positive rate yields
Self::Undetermined — never a fabricated pass or fail.
Sourcepub fn from_device_measurement_against(
engaged: bool,
measured_rows_per_sec: f64,
target_rows_per_sec: f64,
) -> Self
pub fn from_device_measurement_against( engaged: bool, measured_rows_per_sec: f64, target_rows_per_sec: f64, ) -> Self
Self::from_device_measurement against an explicit target (for tests
that probe the decision logic without the global target constant).
Sourcepub fn blocked(reason: EncodeDecisionBlocked) -> Self
pub fn blocked(reason: EncodeDecisionBlocked) -> Self
Construct the blocked decision for a host that cannot measure the exact encode on a device. This is the honest CPU-only / no-device-kernel outcome — the deployment target is left undetermined rather than projected.
Sourcepub fn surrogate_unneeded(&self) -> bool
pub fn surrogate_unneeded(&self) -> bool
True ONLY when a device measurement cleared the target: the exact encode ships and no surrogate is built. Never true from a CPU proxy.
Sourcepub fn surrogate_justified(&self) -> bool
pub fn surrogate_justified(&self) -> bool
True ONLY when a device measurement missed the target: the certified amortized surrogate becomes justified. Never true without a measurement.
Sourcepub fn is_undetermined(&self) -> bool
pub fn is_undetermined(&self) -> bool
True when no device measurement is available and the decision is blocked
on hardware (neither Self::surrogate_unneeded nor
Self::surrogate_justified).
Trait Implementations§
Source§impl Clone for EncodeDeploymentDecision
impl Clone for EncodeDeploymentDecision
Source§fn clone(&self) -> EncodeDeploymentDecision
fn clone(&self) -> EncodeDeploymentDecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EncodeDeploymentDecision
Source§impl Debug for EncodeDeploymentDecision
impl Debug for EncodeDeploymentDecision
Source§impl PartialEq for EncodeDeploymentDecision
impl PartialEq for EncodeDeploymentDecision
Source§fn eq(&self, other: &EncodeDeploymentDecision) -> bool
fn eq(&self, other: &EncodeDeploymentDecision) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EncodeDeploymentDecision
Auto Trait Implementations§
impl Freeze for EncodeDeploymentDecision
impl RefUnwindSafe for EncodeDeploymentDecision
impl Send for EncodeDeploymentDecision
impl Sync for EncodeDeploymentDecision
impl Unpin for EncodeDeploymentDecision
impl UnsafeUnpin for EncodeDeploymentDecision
impl UnwindSafe for EncodeDeploymentDecision
Blanket Implementations§
impl<T> Boilerplate for T
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
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<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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>
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>
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