Skip to content

fix(bench): resolve runtime panic and clap CSV arg parsing; add tests#912

Merged
starpit merged 1 commit into
IBM:mainfrom
starpit:fix/bench-runtime-and-csv-args
Feb 26, 2026
Merged

fix(bench): resolve runtime panic and clap CSV arg parsing; add tests#912
starpit merged 1 commit into
IBM:mainfrom
starpit:fix/bench-runtime-and-csv-args

Conversation

@starpit
Copy link
Copy Markdown
Member

@starpit starpit commented Feb 25, 2026

Summary

  • Replace custom parse_csv_usize value_parser with clap's built-in value_delimiter to fix type mismatch (parse_csv_usize returned Vec<usize> but clap expected usize for Vec fields)
  • Wrap sync benchmark runners (haystack, niah, ruler) in spawn_blocking to avoid nested tokio runtime panic caused by criterion and reqwest::blocking running inside an async context
  • Remove now-unused parse_csv_usize helper
  • Add 49 unit tests across bench modules covering pure scoring functions, arg parsing, and string metrics (no model or network calls at test time)

Test plan

  • cargo clippy -p spnl-cli --features bench,rag,spnl-api,vllm,k8s,gce,local,metal --tests --no-deps -- -D warnings passes clean
  • cargo test -p spnl-cli -Fbench -- bench:: — all 49 tests pass
  • cargo run -Fbench -- bench ruler no longer panics at startup
  • cargo run -Fbench -- bench niah no longer panics at startup
  • cargo run -Fbench -- bench haystack no longer panics at startup

🤖 Generated with Claude Code

Replace custom parse_csv_usize value_parser with clap built-in
value_delimiter to fix type mismatch (parser returned Vec<usize> but
clap expected usize for Vec fields). Wrap sync benchmark runners in
spawn_blocking to avoid nested tokio runtime panic from criterion and
reqwest::blocking running inside an async context.

Add 49 unit tests across the bench modules covering pure scoring
functions, arg parsing, and string metrics — no model or network calls
needed at test time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Nick Mitchell <nickm@us.ibm.com>
@starpit starpit changed the title fix(bench): resolve runtime panic and clap CSV arg parsing fix(bench): resolve runtime panic and clap CSV arg parsing; add tests Feb 26, 2026
@starpit starpit force-pushed the fix/bench-runtime-and-csv-args branch from 1377e76 to 1b70f59 Compare February 26, 2026 00:10
@starpit starpit merged commit 6c4a4ef into IBM:main Feb 26, 2026
36 checks passed
@starpit starpit deleted the fix/bench-runtime-and-csv-args branch February 26, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant