Files
leleka/benchmarks
Pavlo Ratushnyi 4736b193da
Linux / keyless-cuda-gate (pull_request) Skipped
Linux / verify (pull_request) Successful in 4m32s
Linux / keyless-cuda (pull_request) Skipped
Linux / static-cuda-package (pull_request) Skipped
Linux / hosted-cuda-package (pull_request) Skipped
Linux / linux-cli-container (pull_request) Successful in 1m38s
Linux / linux-static-cli (pull_request) Successful in 11m8s
Linux / release-cli (pull_request) Skipped
feat(bench): validate paired comparisons and report uncertainty privately
2026-10-08 00:46:44 +02:00
..

Benchmarks

The fixtures/responses/ directory currently holds a synthetic protocol replay example. It is not a real Codex capture or a performance measurement. Run it through the Rust replay-responses binary described in control-plane/README.md.

Store future benchmark definitions and sanitized fixtures in Git; place generated reports and sensitive captures outside the source tree or under ignored local paths. No baseline has been measured yet.

Synthetic paired Chat smoke

fixtures/chat/paired-smoke.json contains public synthetic arithmetic, retrieval, and function-call prompts. Run scripts/bench-chat-paired.py from the repository root. It sends one untimed warmup per case and endpoint, then alternates baseline/candidate order over repeated, sequential requests with the same model, prompt, greedy sampling settings, and token cap. It checks each response's terminal finish_reason and case-specific text or tool arguments. The report includes per-case pass counts, raw response timings, and paired wall-time ratios. The full response report is written only to a new private path outside Git with mode 0600; API keys are read from private server config files and omitted from the report.

For the current upstream server, pass its full bound URL as --baseline-url, its /health URL as --baseline-ready-url, the configured model name as --model, and its private JSON config as --baseline-auth-config. The readiness poll waits for a nonzero max_context because upstream can report loaded: true during loading. Once a compressed inference endpoint exists, pass its URL as --candidate-url and optionally --candidate-ready-url. A baseline-only run is a functional check and cannot establish a speedup. Even a paired run of this small synthetic suite is only a smoke test: the charter's long-context, real-agent, cache-state, and model-quality gates still require separate runs. Record engine/config digests, GPU, driver, CUDA, power settings, and artifact digests in a private --metadata JSON for any reported performance result. Never commit the report or private config.

Offline comparison of sequential Chat reports

When two model arms cannot fit together, compare two single-arm schema-1 reports from the same suite/model/configuration. A standalone harness run may label its rows baseline in both files; the filenames select the comparison arms. Each file must contain one arm, exactly one warmup per case and the full declared repeat range. Missing or duplicate pairs, category drift, malformed rows, nonfinite numbers and inconsistent successful HTTP/terminal/quality claims fail before any comparison is published. Genuine observed quality or HTTP failures remain explicit data, with failed categories reported separately.

python3 -B scripts/compare-chat-reports.py \
  /private/evaluation/baseline.json /private/evaluation/candidate.json \
  --output /private/evaluation/comparison.json
python3 -B scripts/render-paired-report.py /private/evaluation/comparison.json \
  --output /private/evaluation/comparison.md

JSON and Markdown outputs must be new files outside Git and use mode 0600; neither overwrites an existing file. The comparator prints fixed aggregate counts only, without case labels, response text, tool arguments or metadata. Markdown omits raw responses, tool arguments and metadata values. Private metadata remains in the private JSON for reproducibility.

Existing schema-1 median fields remain available. Overall, category and case groups additionally contain mean, median, linearly interpolated p10/p90 and sample counts for both arms' wall times and positive paired prefill/decode rates. Ratios are calculated within each pair, then summarized; they are not ratios of arm medians. Zero token rates (for example fully cached prefill) and missing timings never become divisions by zero: timing_coverage and unavailable_pairs disclose their exclusion, while a wholly unavailable throughput summary stays null. Counts must be nonnegative integers; timing values must be finite/nonnegative and measured wall times strictly positive.

Ratio uncertainty uses a deterministic distribution-free, two-sided 95% confidence interval for the population median paired ratio, selected from order statistics with exact binomial coverage. This bounds work without a bootstrap dependency or random seed. Fewer than six pairs cannot yield a finite 95% interval and receive null bounds; fewer than 30 pairs receive an explicit small-sample flag. The interval assumes independent pairs sharing a population median; sequential cache/load drift and correlated repeats can invalidate that assumption. Category/overall mixtures also depend on case composition. The interval does not measure those systematic errors or uncertainty in the mean.

The report names missing charter provenance fields without echoing their values: engine_commit, control_plane_commit, model_sha256, quantization, gpu, driver, cuda_toolkit, power_limit_watts, context_tokens, kv_configuration, slots, batch_size, speculation, cache_state, workload_sha256, quality_gate_result, draft_acceptance_rate, expert_cache_hit_rate, kv_streaming_hit_rate; measured TTFT and prompt/output token-count coverage are checked separately. Unavailable/not-applicable metrics should be explained in private provenance; a declaration is not a measurement. Conflicting declared hardware, model source, context/KV/slot/batch/speculation, cache or workload identity refuses pairing. Engine/control-plane/codec version changes can be the intended comparison, but must be recorded for each arm.

Inputs are bounded to 32 MiB each, 64 cases, 4,096 measured pairs, 100 repeats per case, JSON depth 32 and one million JSON nodes. Timing/count magnitudes are bounded to 10^12. Split larger suites deliberately instead of silently dropping rows. JSON statistics and the Markdown rendering remain descriptive: sequential runs, synthetic CPU fixtures, complete metadata or passing smoke checks never automatically qualify GPU inference, model quality or an end-to-end agent performance improvement. Those charter gates remain separate.

Live Responses episode replay

scripts/replay-live-responses.py is an offline evaluator for an explicitly isolated native endpoint. It sends real inference requests. Do not point it at a user's active runtime. Remote evaluation uses an existing SSH loopback tunnel; this tool does not create tunnels or change runtime configuration.

Copy fixtures/responses/live-tool-episode.json to private storage, set the configured model ID in both requests, and record model digests, runtime/engine commits, hardware/driver, configuration and cache conditions in provenance. Only use deliberately sanitized episodes. The sanitized flag records the operator's assertion; it cannot sanitize arbitrary captured agent traffic.

python3 scripts/replay-live-responses.py \
  --endpoint http://127.0.0.1:18082 \
  --fixture /private/evaluation/episode.json \
  --key-file /private/evaluation/api.key \
  --output /private/evaluation/new-evidence-directory

The output directory must not exist. It is created with mode 0700, with 0600 fixture, request, raw response and report files. Credentials never enter those files or command arguments. HTTP calls have an 8 MiB response limit and a total wall deadline (default 120 seconds, configurable with --timeout); an isolated child is killed and reaped on timeout, including drip-fed headers. Redirects are not followed. Failed checks retain a failing report and available evidence; partial transport bodies lost on timeout are not captured.

Each episode runs twice, first JSON then SSE, with independent explicitly replayed history and store=false. Each step supplies a request and exact semantic expect list. Later steps can supply tool_results strings in the previous turn's call order. Returned call IDs are bound automatically. No shell, MCP or other tool is ever executed. Call IDs and argument JSON formatting may differ between arms; normalized argument values and visible content must match exactly. Tokens, timings and hashes are recorded separately; this is not a paired performance benchmark.

The verifier requires contiguous named events, exactly one successful terminal, consistent response/item identities, matching delta/done/final values, all items closed and consistent usage. It accepts native text, reasoning-content, function and custom-tool events; unsupported events fail closed. Readiness, idle queue/admission state and generation-counter deltas are checked around each arm. Counter mismatches invalidate the isolated replay; this is not an exclusive server lease or a durable process-epoch check. Reserve the endpoint for the evaluation and independently record its process/build identity. These observations do not replace cancellation/crash fault injection or a long-running soak. A declared real-model provenance alone is not qualification.

Hosted CI runs the runner against actual native HTTP with a synthetic CPU worker, plus corrupt-stream/auth/overwrite/deadline tests. The full sanitized Codex/MCP real-model replay and model-quality gates remain separate and open.