Skip to main content

FloatClaims

Struct FloatClaims 

Source
pub struct FloatClaims(/* private fields */);
Expand description

6-bit bitmask of claimed properties on floating-point samples.

Mirrors the exact invariants that magemath and SIMD quantization kernels use to elide per-lane NaN, infinity, subnormal, sign, and range guards.

Implementations§

Source§

impl FloatClaims

Source

pub const NONE: FloatClaims

No claimed properties (untrusted / arbitrary floats).

Source

pub const NO_NAN: FloatClaims

No channel sample is NaN.

Source

pub const NO_INFINITE: FloatClaims

No channel sample is +∞ or -∞.

Source

pub const NO_SUBNORMALS: FloatClaims

No channel sample is a subnormal float.

Source

pub const NON_NEGATIVE: FloatClaims

Every sample is >= 0.0 (including -0.0 flushed or non-negative).

Source

pub const POSITIVE: FloatClaims

Every sample is strictly > 0.0.

Source

pub const AT_MOST_ONE: FloatClaims

Every sample is <= 1.0.

Source

pub const FINITE: FloatClaims

Finite floats (NO_NAN | NO_INFINITE).

Source

pub const UNIT_INTERVAL: FloatClaims

Finite floats inside [0.0, 1.0] (NO_NAN | NO_INFINITE | NON_NEGATIVE | AT_MOST_ONE).

Subnormal values inside [0.0, 1.0] (e.g. near-black linear light 1e-40) satisfy UNIT_INTERVAL. Use NORMAL_UNIT_INTERVAL when NO_SUBNORMALS is also required.

Source

pub const NORMAL_UNIT_INTERVAL: FloatClaims

Finite floats inside [0.0, 1.0] with no subnormals (UNIT_INTERVAL | NO_SUBNORMALS).

Source

pub const fn bits(self) -> u8

Raw bitmask representation.

Source

pub const fn contains(self, other: FloatClaims) -> bool

Whether self contains all flags in other.

Source

pub const fn is_finite(self) -> bool

Whether all samples are claimed finite (NO_NAN | NO_INFINITE).

Source

pub const fn is_unit_interval(self) -> bool

Whether all samples are claimed finite and inside [0.0, 1.0] (subnormals allowed).

Source

pub const fn is_normal_unit_interval(self) -> bool

Whether all samples are claimed finite, inside [0.0, 1.0], and free of subnormals.

Source

pub const fn union(self, other: FloatClaims) -> FloatClaims

Combine two claim masks (union of claimed properties).

Source

pub const fn intersect(self, other: FloatClaims) -> FloatClaims

Intersect two claim masks (properties holding in both).

Source

pub fn measure_f32_slice(samples: &[f32]) -> FloatClaims

Measure exact FloatClaims across a slice of f32 samples.

Source

pub fn measure_f16_slice(samples: &[F16Sample]) -> FloatClaims

Measure exact FloatClaims across a slice of IEEE 754 binary16 (F16Sample) samples.

Classifies f16 subnormals, NaNs, infinities, signs, and <= 1.0 directly on binary16 bits.

Trait Implementations§

Source§

impl BitAnd for FloatClaims

Source§

type Output = FloatClaims

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: FloatClaims) -> FloatClaims

Performs the & operation. Read more
Source§

impl BitOr for FloatClaims

Source§

type Output = FloatClaims

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: FloatClaims) -> FloatClaims

Performs the | operation. Read more
Source§

impl Clone for FloatClaims

Source§

fn clone(&self) -> FloatClaims

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 FloatClaims

Source§

impl Debug for FloatClaims

Source§

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

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

impl Default for FloatClaims

Source§

fn default() -> FloatClaims

Returns the “default value” for a type. Read more
Source§

impl Eq for FloatClaims

Source§

impl Hash for FloatClaims

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FloatClaims

Source§

fn eq(&self, other: &FloatClaims) -> 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 FloatClaims

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> 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> 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> 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.