Skip to content

wave2-polish: tests, CI, and formatting#1

Merged
Peterc3-dev merged 1 commit into
masterfrom
wave2-polish
May 30, 2026
Merged

wave2-polish: tests, CI, and formatting#1
Peterc3-dev merged 1 commit into
masterfrom
wave2-polish

Conversation

@Peterc3-dev
Copy link
Copy Markdown
Owner

Polish-to-completion pass on inference-bench.

Summary

  • Formatting: ran cargo fmt across all source files. No logic changes, purely whitespace/line-wrapping normalization.
  • Tests (new): added 18 unit tests for the pure, network-independent core logic:
    • Endpoint::generate_url per endpoint kind (Ollama / FastFlowLM / llama.cpp)
    • Endpoint::build_body request-shape correctness for both API families
    • parse_ollama_stream_line — token, done flag, invalid-JSON -> None
    • parse_llamacpp_stream_line — SSE token, [DONE] marker, stop flag, non-data: lines -> None
    • parse_ollama_timings / parse_llamacpp_timings — field extraction, ms->ns conversion, invalid/missing input falls back to defaults
    • metrics::mean_std — empty, single-sample, identical-values, and a known-value case checked against the textbook sample std (n-1 denominator)
  • CI (new): .github/workflows/ci.yml — runs cargo fmt --check, cargo clippy --all-targets -D warnings, cargo build, and cargo test on push to master and on every PR. Uses dtolnay/rust-toolchain@stable + cargo cache.
  • Docs: added a Development section to the README documenting the test/lint/fmt commands and CI.

What was finished

Nothing was a broken/incomplete stub — the existing code already built cleanly with no clippy warnings and no todo!()/unimplemented!()/FIXME markers. The gaps were the complete absence of tests and CI, plus unformatted code. Those are now filled.

Verified on this machine (cargo 1.95.0, rustc 1.95.0)

  • cargo build and cargo build --release — PASS
  • cargo test — PASS (18/18)
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean

Not verified

  • The GitHub Actions workflow itself has not been executed; it is validated only by inspection. It will run on this PR.
  • Networked behavior (live benchmarking against Ollama/FLM/llama.cpp) was not exercised — no servers were started. Only the pure parsing/stat logic is unit-tested.

TODOs left

  • None introduced. No ambiguous stubs were guessed at.

🤖 Generated with Claude Code

- Apply cargo fmt across all source files (no logic changes)
- Add 18 unit tests covering pure logic: endpoint URL/body construction,
  Ollama and llama.cpp stream-line parsing, timing parsing (incl. ms->ns
  conversion and invalid-input defaults), and mean/std statistics
- Add GitHub Actions CI workflow (fmt check + clippy -D warnings + build + test)
- Document development/test workflow in README

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Peterc3-dev
Copy link
Copy Markdown
Owner Author

Independent verification: VERDICT = solid

Re-cloned wave2-polish, reviewed the full diff vs master, and reproduced every claim on a clean machine (cargo/rustc 1.95.0).

Build & checks (independently reproduced):

  • cargo build — PASS
  • cargo build --release — PASS
  • cargo test — PASS, 18/18 (matches claim; 14 in endpoints, 4 in metrics)
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --all --check — clean

Diff review:

  • output.rs, bench.rs, detect.rs, main.rs, metrics.rs, endpoints.rs non-test hunks are pure rustfmt churn (line-wrapping, import reorder, struct-literal expansion). No logic changes, no behavior changes. The cyan-green palette (0,255,200) is identical on both sides — already in master, not touched here.
  • New tests are additive, correct, and assert the right invariants (e.g. llama.cpp body carries no model field; ms→ns conversion 10ms → 10_000_000ns; sample-std n-1 denominator verified against textbook value 2.13809).
  • No regressions, no incorrect stub completions, no todo!()/unimplemented!() introduced. No security concerns.

No overclaims. The PR body's 'Not verified' section (CI not executed, networked benchmarking not exercised) is accurate and appropriately scoped.

Nit (non-blocking): PR prose writes the clippy invocation as cargo clippy --all-targets -D warnings; the actual workflow file correctly uses --all-targets -- -D warnings. Prose only — the YAML is right and CI is syntactically sound.

Ready to merge.

@Peterc3-dev Peterc3-dev merged commit a0f9952 into master May 30, 2026
1 check passed
@Peterc3-dev Peterc3-dev deleted the wave2-polish branch May 30, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant