Skip to main content

RunStats

Struct RunStats 

Source
pub struct RunStats {
Show 15 fields pub turns: u32, pub usage: Usage, pub cost_usd: Option<f64>, pub usage_complete: bool, pub stop_cause: Option<StopCause>, pub exhausted: bool, pub ended_on_failed_call: bool, pub tool_calls: u32, pub tool_errors: u32, pub tool_denied: u32, pub tool_staged: u32, pub malformed_tool_args: u32, pub blocked_sends: u32, pub compactions: u32, pub taint: Taint,
}
Expand description

How a run went, in numbers a machine can compare across sessions.

Every field is a deterministic count taken from crate::agent::RunOutcome — nothing here is a model’s opinion, and nothing is derived from the content of a tool result. That is the property that lets this be an input to automated grading: a counter carries no instructions, so a corpus of these cannot be an injection surface the way a corpus of transcript excerpts would be.

Every field defaults, so a session written before this record existed loads, and a field added later does not invalidate the ones already recorded.

Fields§

§turns: u32§usage: Usage§cost_usd: Option<f64>§usage_complete: bool

False when usage is a lower bound rather than a measurement.

§stop_cause: Option<StopCause>

Why the loop stopped. The single most informative field here: it separates “the model decided it was done” from every way the harness cut it short, and none of that is visible in the answer text.

§exhausted: bool§ended_on_failed_call: bool

The model stopped of its own accord with its last call failed.

§tool_calls: u32

Tool calls attempted, and how they went. errors counts the environment refusing (including a call to a tool that does not exist); denied counts a human or a policy refusing, which is the harness working and must not be averaged in with failure.

§tool_errors: u32§tool_denied: u32§tool_staged: u32§malformed_tool_args: u32§blocked_sends: u32§compactions: u32§taint: Taint

What had entered the conversation by the end. Recorded here as well as in Record::Taint because this record is read on its own, by a reader that is counting rather than reconstructing.

Implementations§

Source§

impl RunStats

Source

pub fn absorb(&mut self, o: &RunOutcome)

Fold another run’s outcome in.

An episode — a replayed session, a multi-turn eval case, a batch item — is several runs on one conversation, and is one row. Counters sum, because the episode really did spend all of it. Three fields do not, and the split is the whole reason this is a method rather than a loop at each call site:

  • stop_cause, exhausted and ended_on_failed_call describe how the episode ended, so the last run wins. An episode whose first turn ended on a failure and whose second recovered has not finished over a failure, and summing would say it had.
  • taint merges and never resets: it is a property of the conversation, and a later clean run does not un-read what an earlier one read.
  • usage_complete is an AND: one lower-bound turn makes the total a lower bound.

Trait Implementations§

Source§

impl Clone for RunStats

Source§

fn clone(&self) -> RunStats

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 Debug for RunStats

Source§

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

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

impl Default for RunStats

Source§

fn default() -> RunStats

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

impl<'de> Deserialize<'de> for RunStats

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&RunOutcome> for RunStats

Source§

fn from(o: &RunOutcome) -> Self

Converts to this type from the input type.
Source§

impl Serialize for RunStats

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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, <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.
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