fix(bench): resolve runtime panic and clap CSV arg parsing; add tests#912
Merged
Merged
Conversation
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>
1377e76 to
1b70f59
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parse_csv_usizevalue_parser with clap's built-invalue_delimiterto fix type mismatch (parse_csv_usizereturnedVec<usize>but clap expectedusizeforVecfields)spawn_blockingto avoid nested tokio runtime panic caused by criterion andreqwest::blockingrunning inside an async contextparse_csv_usizehelperTest plan
cargo clippy -p spnl-cli --features bench,rag,spnl-api,vllm,k8s,gce,local,metal --tests --no-deps -- -D warningspasses cleancargo test -p spnl-cli -Fbench -- bench::— all 49 tests passcargo run -Fbench -- bench rulerno longer panics at startupcargo run -Fbench -- bench niahno longer panics at startupcargo run -Fbench -- bench haystackno longer panics at startup🤖 Generated with Claude Code