Skip to main content

ToolExecutor

Struct ToolExecutor 

Source
pub struct ToolExecutor { /* private fields */ }
Expand description

APR Tool test executor for comprehensive tool coverage

Implementations§

Source§

impl ToolExecutor

Source

pub fn new(model_path: String, no_gpu: bool, timeout_ms: u64) -> Self

Create a new tool executor

Source

pub fn with_runner( model_path: String, no_gpu: bool, timeout_ms: u64, runner: Arc<dyn CommandRunner>, ) -> Self

Create a new tool executor with custom command runner

Source

pub fn execute_inspect(&self) -> ToolTestResult

Execute apr rosetta inspect (works with any format)

Source

pub fn execute_inspect_verified(&self) -> ToolTestResult

Execute apr rosetta inspect with metadata verification (T-GH192-01)

Parses --json output and validates that critical model metadata fields are present and non-zero. This catches models with missing or corrupted config (e.g., num_heads=0, hidden_size=0).

Gate: F-INSPECT-META-001

Source

pub fn execute_validate(&self) -> ToolTestResult

Execute apr validate

Source

pub fn execute_bench(&self) -> ToolTestResult

Execute apr bench

Source

pub fn execute_check(&self) -> ToolTestResult

Execute apr check

Source

pub fn execute_trace(&self, level: &str) -> ToolTestResult

Execute apr trace with specified level

Source

pub fn execute_profile(&self) -> ToolTestResult

Execute apr profile (standalone command)

Source

pub fn execute_profile_ci(&self) -> ToolTestResult

Execute apr profile in CI mode with assertions (F-PROFILE-006)

Tests the CI mode features:

  • --ci flag for CI mode with assertion checks
  • --assert-throughput minimum tok/s assertion
  • --warmup and --measure pass counts

Returns pass if CI mode runs and reports metrics correctly.

Source

pub fn execute_profile_ci_assertion_failure(&self) -> ToolTestResult

Execute apr profile CI with assertion failure test (F-PROFILE-007)

Tests that CI mode correctly fails when assertions are not met. Uses an impossibly high throughput assertion to guarantee failure.

Source

pub fn execute_profile_ci_p99(&self) -> ToolTestResult

Execute apr profile with p99 latency assertion (F-PROFILE-008)

Source

pub fn execute_profile_flamegraph(&self, output_path: &Path) -> ToolTestResult

Execute apr profile with flamegraph output (F-PROFILE-002)

Tests that profile can generate valid SVG flamegraph output. This feature may not be available in all apr versions.

Source

pub fn execute_profile_focus(&self, focus: &str) -> ToolTestResult

Execute apr profile with focus filtering (F-PROFILE-003)

Tests that profile –focus option works to limit scope. This feature may not be available in all apr versions.

Source

pub fn execute_backend_equivalence(&self) -> ToolTestResult

Execute backend equivalence test (F-CONV-BE-001)

Compares CPU vs GPU output to verify they produce equivalent results. Skips if GPU is not available.

Source

pub fn execute_serve_lifecycle(&self) -> ToolTestResult

Execute apr serve lifecycle test (F-INTEG-003)

Tests the full serve lifecycle:

  1. Start server
  2. Wait for health endpoint
  3. Make inference request
  4. Shutdown cleanly
Source

pub fn execute_all(&self) -> Vec<ToolTestResult>

Execute all tool tests

Source

pub fn execute_all_with_serve(&self, include_serve: bool) -> Vec<ToolTestResult>

Execute all tool tests, optionally including serve lifecycle

Trait Implementations§

Source§

impl Debug for ToolExecutor

Source§

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

Formats the value using the given formatter. 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> 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> Same for T

Source§

type Output = T

Should always be Self
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.
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