Written by an AI coding agent (OpenAI Codex), operated by @Jarvis636431.
The batch adapter has shipped, but its real-pack evaluation was still missing. Add a reproducible, pinned rust-vulns comparison of one 50-item call versus 50 sequential one-item calls to the same adapter, over both CLI and a persistent MCP session.
Relationship to the issue and prior PRs
- Refs #1801: covers its rust-vulns retrieval evaluation: per-item correctness, retrieval abstention, task latency and payload BPE tokens. Does not close the broader answer/abstain proposal.
- Builds on merged #2333, which introduced the CLI/MCP adapter. This is an independent branch based on current upstream main
7e155473, with no duplicated prerequisite commits or unmerged stacked dependency. It changes no engine or adapter source.
- #2334 was the implementation's synthetic-fixture field report, not a real-pack benchmark. This PR supplies reproducible real-pack receipts; this session's required field report is the separate single-file PR #2385.
- Related #1788: the benchmark explicitly selects the keyword
id or aliases field. It does not implement automatic alias discovery or field-aware ranking.
- Related #1786 / #1789: checks retrieval abstentions and index/ID citations; it does not implement generated answers, confidence calibration, escalation or a general version-pinned answer contract.
- Per-release card automation (#1802) remains separate work.
Workload and method
Pin pack-rust-vulns-2026-10-24 by its release-asset SHA-256, validate all manifest shard hashes/counts, and index all 2,051 records in a private temporary node with explicit mappings. The fixed 50 items comprise 15 canonical IDs, 15 CVE/GHSA aliases, 10 absent near-miss IDs, 8 hand-authored title-informed text lookups, one duplicate input/key and one invalid item.
Use size 3, no token budget, concurrency one, one discarded warmup per arm, five measured repeats with alternating arm order, and warm caches. CLI includes a process startup per call; MCP uses one initialized session. The baseline calls the same batch adapter with one-item envelopes, holding query and output semantics fixed. Tool-call counts are not HTTP request counts.
Tokens are actual tiktoken==0.12.0 / cl100k_base counts on exact CLI stdin/stdout or MCP tools/call JSON lines, including MCP envelopes. These exclude schemas, system prompts, history, reasoning and billed model usage; they are not the adapter's UAX #29 word budget or total agent-task cost.
Protocol and reproduction · fixed cases · raw per-call/per-item receipts
Verified
Measured on macOS arm64, Apple M4 / 16 GiB, XERJ_NUM_CPUS=4; release binary xerj v1.0.0-rc.99, built with Rust 1.97.1 from engine commit 7e1554734c5b26f7c4f85ee7b5ba838148fe1089. Final receipts come from clean harness commit f016e078d61bd3a2b94ea140ef3515ef1a266705. The binary is copied from the hashed bytes into private scratch and that same executable serves every call.
| Arm | Median task ms (min–max) | Input BPE / trial | Output BPE / trial |
|---|
| CLI batch | 26.487 (26.209–27.632) | 1,071 | 87,676 |
| CLI single | 487.739 (480.636–491.249) | 1,757 | 87,872 |
| Persistent MCP batch | 15.410 (15.340–16.186) | 1,101 | 100,591 |
| Persistent MCP single | 29.515 (28.871–29.931) | 3,306 | 102,257 |
All four arms and all five repeats passed 49/49 valid retrieval items plus the independent invalid-item check: 31 exact lookups including the duplicate, 8 labelled text hit@3, 10 intended misses. Abstentions were 10/49 valid items (20.41%), with zero false abstentions among the 39 labelled answerable items. Ranked evidence, citations and outcomes agreed across modes, transports, warmups and repeats. Graceful stop/restart retained 2,051 records; both node and MCP exited normally.
CLI's observed median ratio is 18.41x including startup; persistent MCP's is 1.92x. Output payload BPE fell only 0.22% / 1.63%: stored advisory bodies dominate. This does not support a large output-token-savings claim.
Commands/checks actually run:
cd engine && cargo +1.97.1 build --locked --offline --release -j 32 -p xerj-server passed.
- The README evaluation command with
--repeats 5 passed on the final harness. Earlier exploratory/smoke runs are excluded from the committed receipts.
python3 tools/benchmarks/batch-retrieval/test_run.py: 11 passed. Covers wrong/extra IDs, citation identity, errors versus misses, positions, parity, byte accounting/duplicate preservation, archive pinning and executable snapshots.
- A targeted mutation accepting wrong IDs produced exactly the two intended test failures; unmodified production code passes all 11 tests.
- Real CLI negative controls: wrong archive exited 1 before output/node creation; an existing output directory exited 2 with its sentinel unchanged. A fresh output path then completed normally.
python3 .github/scripts/workflow-timeout-guard.py, actionlint for the new workflow, Python compilation, effective-diff whitespace checks, corpus/receipt digest and count checks passed. New Markdown is covered by the existing explicit re-include rule.
Review, limitations and not run
Audited against docs/CONTRIBUTION_REVIEW.md: effective ancestry/diff is isolated to the harness, fixed public workload/receipts, documentation and a path-scoped stdlib-test workflow. Existing workflows are preserved. Preflight snapshots the pack and executable, verifies labels before indexing, refuses existing output, checks bulk errors/counts, isolates children and writes the final report by rename. No existing node or index is contacted or deleted.
The eight text labels are title-informed known-item lookups, not exhaustive relevance judgments, generated-answer accuracy or general QA. The measurements are one shared developer laptop, warm caches, one fixed batch size and concurrency; no statistical or cross-platform performance generalization is assumed.
No Rust source, product mapping migration, durable format, optional accelerator, model execution or clustering behavior changes; those audit sections are not applicable beyond the isolated test-node lifecycle. Rust test/Clippy/fmt, ES-YAML, site generation gates, real model evaluation and cold-cache/parallel/network-latency scenarios were not run for this tooling-only PR. Linux real-node and Windows execution are untested locally; the new Ubuntu CI job runs offline stdlib harness tests. Hosted CI/merge-ref status is not claimed by local checks.
Maintainer independent verification (2026-10-28)
An agent integrated current main and ran the pinned benchmark on Linux with a scoped rc.100-based release build. The committed results/2026-10-28-linux-x86_64.json and README record the exact binary/source identity and all receipts. All four arms pass 49/49 valid retrieval items in every one of five repeats; the expected invalid item stays separate, ranked evidence matches, and 2,051 records survive restart. All 11 harness tests pass; wrong-archive and existing-output CLI controls refuse before publication. Original macOS receipt summaries recompute exactly. This shared-host verification does not establish a version/platform speedup; hosted checks on the updated head are pending.