Skip to content

test(classifiers): add unit tests and benchmarks for CandleClassifier (#2190)#2212

Merged
bug-ops merged 1 commit intomainfrom
candle-classifier-tests
Mar 27, 2026
Merged

test(classifiers): add unit tests and benchmarks for CandleClassifier (#2190)#2212
bug-ops merged 1 commit intomainfrom
candle-classifier-tests

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 27, 2026

Summary

  • Add 9 fast unit tests for CandleClassifier: constructor, backend_name, Debug format, Arc clone sharing, and 5 validate_safetensors edge cases (valid header, truncated buffer, wrong magic, zero-length header, oversized claim)
  • Add 6 #[ignore] integration tests requiring HF Hub model download: real injection/safe classification, input chunking, empty input, error caching, download timeout
  • Add 3 Criterion benchmarks in crates/zeph-llm/benches/classifier.rs measuring warm inference latency for injection, safe, and long-input chunking scenarios (public ClassifierBackend::classify API, tokio runtime, black_box on results)

Deferred

Test plan

  • cargo +nightly fmt --check — passes
  • cargo clippy --workspace --features full -- -D warnings — passes (0 warnings)
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 6605 passed (+9 vs baseline 6596)
  • #[ignore] tests: run manually with cargo nextest run -p zeph-llm --features classifiers -- --ignored after pre-downloading protectai/deberta-v3-small-prompt-injection-v2

Closes #2190

…#2190)

Add 9 fast unit tests for CandleClassifier covering constructor, backend_name,
Debug format, Arc clone sharing, and 5 validate_safetensors edge cases. Add 6
#[ignore] integration tests for real-model inference, chunking, empty input, and
error handling (require HF Hub download). Add 3 Criterion benchmarks measuring
warm inference latency for injection, safe, and long-input scenarios.

PII/NER token-level tests deferred to #2211 (piiranha requires NER backend).
FeedbackDetector Model variant deferred to #2210.
@github-actions github-actions bot added tests Test-related changes size/L Large PR (201-500 lines) llm zeph-llm crate (Ollama, Claude) rust Rust code changes dependencies Dependency updates and removed tests Test-related changes labels Mar 27, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 27, 2026 07:52
@bug-ops bug-ops merged commit 7014895 into main Mar 27, 2026
25 checks passed
@bug-ops bug-ops deleted the candle-classifier-tests branch March 27, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates llm zeph-llm crate (Ollama, Claude) rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(candle): add integration tests for Candle-backed classifier models

1 participant