#[non_exhaustive]pub struct Report {
pub experiment: String,
pub repetitions: usize,
pub trials: Vec<TrialResult>,
pub summary: Vec<EvaluatorSummary>,
pub tokens: Tokens,
pub judge_tokens: Tokens,
pub latency: LatencySummary,
pub thresholds: Vec<ThresholdResult>,
}Expand description
What an experiment found.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.experiment: StringThe experiment’s name.
repetitions: usizeHow many times each case ran.
trials: Vec<TrialResult>Every trial, by case then repetition.
summary: Vec<EvaluatorSummary>Per evaluator, in the experiment’s order.
tokens: TokensModel tokens: the target’s and the LLM judges’.
judge_tokens: TokensThe part of tokens that LLM judges spent.
latency: LatencySummaryRun latencies.
thresholds: Vec<ThresholdResult>One per evaluator.
Implementations§
Source§impl Report
impl Report
Sourcepub fn compare(&self, baseline: &Report) -> Comparison
pub fn compare(&self, baseline: &Report) -> Comparison
Compares this report (the candidate) with baseline: per evaluator the
pass-rate and mean deltas, the cases that regressed or were fixed, the
cases only one report has, and the token and latency deltas.
Cases are matched by id. Trials that share an id within a report are pooled into one case: it passes only when all of them pass, and its failing evaluators are those of all of them. Repetitions of a case therefore count as one case here, not as separate cases.
An evaluator’s deltas are None unless both reports score it in at
least one trial.
use rig_evals::Report;
fn regressed(baseline: &Report, candidate: &Report) -> bool {
!candidate.compare(baseline).regressions.is_empty()
}Source§impl Report
impl Report
Sourcepub fn passed(&self) -> bool
pub fn passed(&self) -> bool
Whether every evaluator reached its threshold: the exit status for CI.
Sourcepub fn pass_at_k(&self, evaluator: &str, k: usize) -> Option<f64>
pub fn pass_at_k(&self, evaluator: &str, k: usize) -> Option<f64>
An evaluator’s pass@k estimate (Chen et al. 2021): per case, the chance
that at least one of k of its trials passed, from its n applicable
trials with c passed, as 1 - C(n - c, k) / C(n, k); then the mean
over the cases with n >= k. Cases with fewer applicable trials (for
example, N/A trials) are left out; errored trials count as scores, as in
pass_rate. None when k is 0 or no case has k trials.
With k = n it is the share of cases with any pass.
Sourcepub fn pass_hat_k(&self, evaluator: &str, k: usize) -> Option<f64>
pub fn pass_hat_k(&self, evaluator: &str, k: usize) -> Option<f64>
An evaluator’s pass^k (tau-bench): per case, the chance that all k
of its trials passed, as C(c, k) / C(n, k); then the mean over the
cases with n >= k. None when k is 0 or no case has k trials.
Sourcepub fn to_junit(&self) -> String
pub fn to_junit(&self) -> String
The report as JUnit XML: a test case per trial (failing when an evaluator failed it) and per threshold.
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
The report as Markdown: the outcome, a table per evaluator, tokens, latency, and the failed trials.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Report
impl<'de> Deserialize<'de> for Report
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Report
Auto Trait Implementations§
impl Forget for Report
impl Freeze for Reportwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<TrialResult>: Freeze,
PhantomData<EvaluatorSummary>: Freeze,
PhantomData<ThresholdResult>: Freeze,
impl Move for Report
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnsafeUnpin for Reportwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TrialResult>: UnsafeUnpin,
PhantomData<EvaluatorSummary>: UnsafeUnpin,
PhantomData<ThresholdResult>: UnsafeUnpin,
impl UnwindSafe for Report
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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