From d46ab3a1d79952b727ee1be04dcc40752132dea5 Mon Sep 17 00:00:00 2001 From: Illia Polosukhin Date: Wed, 18 Feb 2026 01:04:57 -0800 Subject: [PATCH] fix: resolve all clippy warnings in benchmarks crate Remove unused fields, methods, and error variants. Allow dead_code on public API types intended for future use. Drop needless Default spread. Co-Authored-By: Claude Opus 4.6 --- benchmarks/src/adapters/gaia.rs | 2 -- benchmarks/src/channel.rs | 5 ----- benchmarks/src/error.rs | 9 --------- benchmarks/src/instrumented_llm.rs | 1 + benchmarks/src/main.rs | 1 - benchmarks/src/results.rs | 12 +----------- benchmarks/src/suite.rs | 2 ++ 7 files changed, 4 insertions(+), 28 deletions(-) diff --git a/benchmarks/src/adapters/gaia.rs b/benchmarks/src/adapters/gaia.rs index 0d2ea168..5142babf 100644 --- a/benchmarks/src/adapters/gaia.rs +++ b/benchmarks/src/adapters/gaia.rs @@ -20,8 +20,6 @@ struct GaiaEntry { level: Option, #[serde(alias = "file_name", default)] file_name: Option, - #[serde(alias = "Annotator Metadata", default)] - annotator_metadata: Option, } /// GAIA benchmark suite. diff --git a/benchmarks/src/channel.rs b/benchmarks/src/channel.rs index 0525be11..83131bb8 100644 --- a/benchmarks/src/channel.rs +++ b/benchmarks/src/channel.rs @@ -64,11 +64,6 @@ impl BenchChannel { pub fn capture(&self) -> Arc> { Arc::clone(&self.capture) } - - /// Get a clone of the message sender for injecting follow-up messages. - pub fn sender(&self) -> mpsc::Sender { - self.msg_tx.clone() - } } #[async_trait] diff --git a/benchmarks/src/error.rs b/benchmarks/src/error.rs index 1eb27f22..06646c32 100644 --- a/benchmarks/src/error.rs +++ b/benchmarks/src/error.rs @@ -14,9 +14,6 @@ pub enum BenchError { #[error("Task {task_id} failed: {reason}")] TaskFailed { task_id: String, reason: String }, - #[error("Timeout after {seconds}s for task {task_id}")] - Timeout { task_id: String, seconds: u64 }, - #[error("Scoring error for task {task_id}: {reason}")] Scoring { task_id: String, reason: String }, @@ -31,10 +28,4 @@ pub enum BenchError { #[error("Agent error: {0}")] Agent(#[from] ironclaw::Error), - - #[error("Results directory error: {0}")] - ResultsDir(String), - - #[error("Resume failed: no completed tasks found in {path}")] - ResumeEmpty { path: PathBuf }, } diff --git a/benchmarks/src/instrumented_llm.rs b/benchmarks/src/instrumented_llm.rs index d3f041d9..165261a8 100644 --- a/benchmarks/src/instrumented_llm.rs +++ b/benchmarks/src/instrumented_llm.rs @@ -15,6 +15,7 @@ use ironclaw::llm::{ /// Recorded metrics from a single LLM call. #[derive(Debug, Clone)] +#[allow(dead_code)] pub struct LlmCallRecord { pub input_tokens: u32, pub output_tokens: u32, diff --git a/benchmarks/src/main.rs b/benchmarks/src/main.rs index 3d188d55..94a6e331 100644 --- a/benchmarks/src/main.rs +++ b/benchmarks/src/main.rs @@ -179,7 +179,6 @@ async fn main() -> anyhow::Result<()> { let session = ironclaw::llm::create_session_manager(ironclaw::llm::SessionConfig { auth_base_url: ironclaw_config.llm.nearai.auth_base_url.clone(), session_path: ironclaw_config.llm.nearai.session_path.clone(), - ..Default::default() }) .await; session.ensure_authenticated().await?; diff --git a/benchmarks/src/results.rs b/benchmarks/src/results.rs index e859f6b0..2013ed26 100644 --- a/benchmarks/src/results.rs +++ b/benchmarks/src/results.rs @@ -1,7 +1,6 @@ use std::collections::HashSet; use std::io::{BufRead, Write}; use std::path::{Path, PathBuf}; -use std::time::Duration; use chrono::{DateTime, Utc}; use uuid::Uuid; @@ -23,12 +22,6 @@ pub struct Trace { pub hit_timeout: bool, } -impl Trace { - pub fn wall_time(&self) -> Duration { - Duration::from_millis(self.wall_time_ms) - } -} - #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct TraceToolCall { pub name: String, @@ -73,6 +66,7 @@ pub struct RunResult { impl RunResult { /// Build aggregate from individual task results. + #[allow(clippy::too_many_arguments)] pub fn from_tasks( run_id: Uuid, suite_id: &str, @@ -113,10 +107,6 @@ impl RunResult { finished_at: Utc::now(), } } - - pub fn total_wall_time(&self) -> Duration { - Duration::from_millis(self.total_wall_time_ms) - } } /// Append a single task result as one JSON line to the JSONL file. diff --git a/benchmarks/src/suite.rs b/benchmarks/src/suite.rs index 05874f4c..2ef663f9 100644 --- a/benchmarks/src/suite.rs +++ b/benchmarks/src/suite.rs @@ -44,6 +44,7 @@ pub enum ResourceType { /// What the agent produced for scoring. #[derive(Debug, Clone)] +#[allow(dead_code)] pub struct TaskSubmission { pub response: String, pub conversation: Vec, @@ -108,6 +109,7 @@ impl BenchScore { /// Each suite (GAIA, Tau-bench, custom, etc.) implements this trait /// to provide task loading, scoring, and optional lifecycle hooks. #[async_trait] +#[allow(dead_code)] pub trait BenchSuite: Send + Sync { /// Human-readable name (e.g., "GAIA Validation"). fn name(&self) -> &str;