Skip to main content

Judge

Struct Judge 

Source
pub struct Judge {
    pub iterations: u32,
    pub warmup: u32,
    pub size_plan_override: Option<Vec<(OpKind, OpSize)>>,
    pub fixtures: Option<HashMap<(OpKind, DType, SizeClass), Vec<CorrectnessFixture>>>,
}
Expand description

The runner. Consumes a ProbeReport (so it knows which devices exist and which equivalence classes to share across), builds the full measurement matrix, and produces a ProfileReport.

Fields§

§iterations: u32§warmup: u32§size_plan_override: Option<Vec<(OpKind, OpSize)>>

Optional shrunk size ladder. None = use the full default ladder: three square/general sizes per op (up to 1024×1024 matmul / 2²⁰ elementwise), PLUS decode-shaped cells on the decode-attention path (seq_q=1 matmul GEMV; wide-k_len MaxReduce/SumReduce; decode-score-row Sub/Exp/Div). Tests supply a shrunk ladder to stay fast.

§fixtures: Option<HashMap<(OpKind, DType, SizeClass), Vec<CorrectnessFixture>>>

Optional pre-validated correctness fixtures keyed by (op, dtype, size_class). When a fixture covers a profiling cell, the Judge validates every CellRun’s output against it via validate_against_fixture and assigns each ProfileEntry::max_rel_error from the verdict, bypassing the inline pairwise-consensus path for that cell. Cells without a matching fixture fall back to the consensus path (today’s default behavior on multi-backend systems).

One key may map to multiple fixtures when capture used different input_seeds; the Judge applies the first whose fixture-shape and the cell’s regenerated input agree. If no fixture matches the cell’s input seed (mismatch logged), the fallback consensus path is used for the cell.

Implementations§

Source§

impl Judge

Source

pub fn with_fixtures_from(path: &Path) -> Result<Self>

Construct a Judge with the default measurement parameters and the fixture set loaded from path. The path may point at a single *.json file or a directory; in the directory case every *.json under the root is loaded recursively (the fuel-correctness-fixtures capture binary writes v1/<dtype>/<op>.json, so a single root covers an entire fixture distribution).

Returns an io::Error wrapped as a fuel-core Error if the path can’t be read or any file fails to parse as a FixtureFile.

Use: pass a fixture root once at Judge construction time; every cell the Judge profiles thereafter validates against the fixture (if one exists for that cell) instead of inline consensus. Cells with no matching fixture fall back to the consensus path.

Source

pub fn run(&self, probe: &ProbeReport) -> ProfileReport

Run the full profile matrix for every equivalence class in probe. Skips backends that aren’t compiled in; logs (stderr) any backend that’s present but hasn’t been wired into the Judge yet (e.g. Vulkan in this revision).

Reference-retirement note (2026-06-07): the loop order is inverted relative to the pre-retirement shape — outer over (op, size), inner over equivalence classes. This lets Judge collect all backends’ outputs at a given cell, compute pairwise consensus across them, and assign each entry’s max_rel_error relative to the consensus cluster (no privileged “reference output” required). When only one backend is available at a cell, consensus is trivial and max_rel_error = 0.0 (no peers to compare against — the caller treats the lone backend as authoritative).

Per-alternative measurement (2026-06-08): for each equivalence-class representative the Judge now walks KernelBindingTable::lookup_alternatives(op_kind, dtypes, backend) and emits one CellRun per registered alternative. One alternative is timed via the standard realizer path; its CellRun is attributed to the sibling the picker ACTUALLY dispatched (the bridge’s post-realize report — Session 3 rider, 2026-06-11 — with first-registered fallback when the plan had no entry for the measured root). The remaining alternatives at the same (op, dtypes, backend) key are timed via a direct kernel-pointer call so AOCL/MKL siblings get distinct latency numbers.

Trait Implementations§

Source§

impl Default for Judge

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Judge

§

impl RefUnwindSafe for Judge

§

impl Send for Judge

§

impl Sync for Judge

§

impl Unpin for Judge

§

impl UnsafeUnpin for Judge

§

impl UnwindSafe for Judge

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<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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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