okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
538acd098
main
Strata standard benchmark protocol
Status: draft, implemented in strata bench run; pilot validation pending. Protocol ID: strata-qwen38-thinking-v1-draft.1.
Result format: strata-standard-benchmark, schema version 1.
This document specifies a repeatable community benchmark and the data a future website can consume. The required suite took 2 to 4 minutes after model loading on the two machines it has been run on (RTX 3060 and 2x RTX A4000, IQ3_XXS, Strata 0.2.1: 3 min 22 s and 2 min 22 s; the optional concurrency stage added 1.5 to 2 minutes). Slower machines take longer; everyone runs the same work. Downloads, installation, compilation, and model loading are excluded; so is the hashing of the model files that the runner does first (about 1 to 5 minutes for a 44 to 71 GB model). Report their duration separately if measured.
strata bench run implements this protocol from Strata 0.2.1. It sends the frozen fixtures in
bench/prompts/standard-v1 (corpus SHA-256 e75eff8b9feea04f745520b392c4c17d97aefc1ba185e222aa6740efa8f68407)
and writes the result format below. BENCH.bat, ./bench.sh, and tools/strata_bench.py do not implement it.
They stay the quick speed check described in the community guide. Do not rename their
output or add a protocol ID to make it appear standard. The draft becomes final only after the measured pilot in the
activation checklist. The approved manifest described here does not exist yet.
- Run it
- Profile and settings
- Workload and scoring
- Measurements
- Result contract
- Submit and review
- Activation checklist
Run it
Install Strata, set up the Flash-Next model you want to measure, and close other programs that use the GPU. Then:
strata bench run--profile NAME--track default--track-notes "0.2.1 release, setup defaults" strata bench run--url http://127.0.0.1:8080# a server that is already running
With --profile the runner starts that profile's engine, waits for the model to load, runs the protocol, and stops
the engine it started. If the profile is already serving, the runner uses that server and leaves it running; a
server that has already answered requests is not freshly loaded, and the report says how many it had answered.
--no-start forbids starting an engine. --optional-concurrency adds the optional stage.
The runner checks every fixture against the bundle manifest before it sends anything, refuses to run if one byte
differs, and rejects flags that would change the workload (--concurrency, --repeat, --request-timeout).
strata bench report DIR prints a saved result again and re-validates it. Output goes to
bench/results/<UTC-date>-standard-<gpu>-<run-id>/ when the current folder has bench/results, otherwise to
./bench-results/. Read the folder once before you share it: home folders, user and host names, private addresses,
and keys are replaced, but the runner cannot know everything you consider private.
Options that describe what the engine cannot tell the runner: --track, --track-notes, --model-revision,
--source-revision, --tokenizer-revision, --quantization, --custom-pack, --background (repeatable), and
--build-options. The runner never guesses these; an unset value is null with a reason.
Profile and settings
The first profile is qwen3.8-flash-next-thinking: the original Qwen/Qwen3.8-Flash-Next weights and their
quantizations. Record the quantization repository and immutable revision, source model revision, every model
file's name and SHA-256, and any pack preparation or custom expert profile. Fine-tuned, Coder, Swift, or other
derivative models require a separate profile. Results for different models, quants, builds, or configurations
must remain distinguishable.
Use the published Qwen model-card defaults:
| Setting | Required value |
|---|---|
chat_template_kwargs.enable_thinking | true |
chat_template_kwargs.preserve_thinking | true |
reasoning_effort | "xhigh" |
temperature | 1.0 |
top_p / top_k | 0.95 / 20 |
min_p | 0.0 |
presence_penalty / repetition_penalty | 0.0 / 1.0 |
Pin the tokenizer revision, effective chat-template file and SHA-256, and model-card revision used to define the profile. Attach the effective template as a provenance artifact. The pilot must verify that the shipped template matches the pinned upstream behavior, including tool formatting. There is no extra benchmark system prompt. Tools are supplied only for the tool-call cases. Use streaming chat completions and request usage data.
The future runner must explicitly request these settings and verify the resolved server configuration. UI, saved chat, and configuration defaults must not override them. Disable custom reasoning budgets, automatic effort changes, and additional stop strings. Unsupported settings make a run nonconforming; do not silently substitute greedy sampling or disable thinking. Output caps and fixed seeds below are benchmark constraints, not claims to use Qwen's full recommended output allowance. A fixed seed does not guarantee identical outputs across hardware or engine versions.
Use one installed configuration per run. Record effective context, KV and expert cache settings, offloading,
prefill, MTP, calibration, experimental options, and server capacity. Use configuration.track = "default" for
an unmodified release's setup-generated settings; identify the release and setup choices. Use "custom" for
tuning, experimental options, or modified builds and explain the changes. Never merge these tracks into one
headline result. A claimed improvement requires a separate, same-machine baseline.
Workload and scoring
Run the following stages in order through a dedicated server on the inference machine, using loopback HTTP.
Start with a newly loaded engine, close other inference clients, and record unavoidable background work.
Use the same configuration throughout the required stages. Include warm-up time in required_duration_s,
but exclude warm-up requests from performance and quality summaries.
| Stage | Cases and order | Repetitions | Output cap | Requests |
|---|---|---|---|---|
| Warm-up | warmup, short-prompt fixture | 1 | 128 | 1, excluded |
| Performance | short, prompt-4k, prompt-16k; all three in each repetition | 3 | 512 | 9 |
| Sanity | I1–I4, R1–R4, T1–T4 | 1 each | 2,048 | 12 |
| Optional concurrency | Four short-prompt requests released together, then wait for the entire round | 3 rounds | 512 each | 12, separate |
The required suite schedules 21 measured requests plus one warm-up at concurrency 1. The optional
extension schedules another 12 at concurrency 4 and has its own duration and summaries. Record the server's
configured capacity: four clients may queue on a server with fewer than four slots. Do not describe that as
four-way parallel decoding or silently change the server configuration. Testing another capacity is another run.
Use seed 1 for warm-up; performance repetitions use seeds 1, 2, and 3. Sanity cases use seed 1.
Optional round r uses seeds 4 * (r - 1) + j for client j in 1..4. Preserve early EOS; do not force more
output to improve a rate. The caps include reasoning and final output together. Do not add a forced-answer
instruction or a continuation request when a case reaches its cap.
Apply a fixed 1,800-second wall-clock timeout per request, including queueing; cancel timed-out work and record it as failed. This is a safeguard, not a 30-minute suite deadline. Stop and mark remaining cases skipped if the engine dies or the user cancels. Do not retry failed requests inside a run or reduce the workload to fit hardware.
Frozen fixtures
The bundle is committed in bench/prompts/standard-v1: one JSON file per scheduled request (the 22 required and
the 12 optional ones) with its exact messages, tool schemas, seed, cap, expected output and frozen token count,
plus build.json (how it was made) and MANIFEST.sha256. The SHA-256 of that manifest is
protocol.corpus_sha256. .gitattributes marks bench/prompts/** as -text: a checkout must never convert
their line endings, and the runner refuses a bundle whose bytes differ from the manifest. The runner records the
protocol Git commit. Changes to prompts, order, scoring, caps, or defaults require a new protocol ID; schema
changes use a separate schema version.
python tools/build_standard_corpus.py --tokenizer PACK/tokenizer rebuilds the bundle byte for byte. It needs the
tokenizer files (vocab.json, merges.txt, token_type.json) of a Flash-Next pack and the chat template Strata
ships (serve/chat_template.jinja). The frozen counts are 211 records for prompt-4k (4,093 tokens) and 858
records for prompt-16k (16,386 tokens). Besides each request's token count, the bundle stores the longest token
prefix the request shares with any other request (max_shared_prefix_tokens); that is the cache reuse the
protocol allows.
Use synthetic data only. Do not read the checkout's current README or other changing project files into prompts. Build the candidate bundle as follows; these are construction instructions, not runtime adaptation:
- The short task is:
Explain how a hash table finds a value, including collisions and one small example. - Long performance payloads are records of the form
record000001: alpha beta gamma delta epsilon zeta eta theta.with sequential six-digit IDs and LF newlines. Append:Summarize the structure of these records and explain how to look up a record by its ID. - During bundle preparation, use the pinned tokenizer and template to select the number of complete records whose rendered input is closest to 4,096 and 16,384 tokens. Freeze those messages, including all repetition variants; require lengths within 2% of the target. Record actual token counts for every request.
- Prefix every user message with
[case <request-id>]and a newline. IDs are fixed and unique within a run, including warm-up and concurrency requests. Start each request as a fresh conversation. Different markers prevent intentional full-prompt reuse; they do not prove that the shared template prefix was uncached. - For retrieval fixtures, use the same record construction at 4K or 16K, with the key/value facts below inserted at the stated fractions of the record list. Freeze the complete resulting messages and record actual lengths. Distractor records must not contain the queried keys or answers.
The warmed expert cache stays enabled and evolves normally. Record reused and freshly processed prompt tokens on every request. Shared template-prefix reuse is allowed and must be reported. Unexpected reuse of the user payload invalidates that request's performance comparison; preserve the evidence. Do not call these runs zero-cache or cold-model measurements.
Twelve sanity checks
These are small functional checks, not an intelligence ranking, a full coding evaluation, or proof of lossless quantization. Score the final answer or parsed API tool call automatically. Do not score reasoning text or use an LLM judge. Each case is worth one point, with no partial credit or best-of reruns.
| ID | Fixed task or retrieval construction | Required result |
|---|---|---|
| I1 | Return only a JSON object with ok set to true and count set to the integer 3. No other keys. | {"ok":true,"count":3} |
| I2 | Sort these integers in ascending order and remove duplicates: 9, 2, -4, 2, 1. Return only a JSON array. | [-4,1,2,9] |
| I3 | Project: Orion. Build: 17. Return only a JSON object with keys project (string) and build (integer). | {"project":"Orion","build":17} |
| I4 | Reply with exactly the word READY in uppercase and nothing else. | READY |
| R1 | 4K records; at 10%, insert access_code = ORBIT-731. Ask What is access_code? Reply only with its value. | ORBIT-731 |
| R2 | 4K records; at 50%, insert storage_label = CEDAR-284. Ask What is storage_label? Reply only with its value. | CEDAR-284 |
| R3 | 16K records; at 90%, insert archive_code = DELTA-906. Ask What is archive_code? Reply only with its value. | DELTA-906 |
| R4 | 16K records; at 10% insert north = N-124, at 90% insert south = S-875. Ask Return only a JSON object containing north and south and their values. | {"north":"N-124","south":"S-875"} |
| T1 | Use lookup_record to look up record A-17. | lookup_record({"id":"A-17"}) |
| T2 | Use get_weather for Zagreb in celsius. | get_weather({"city":"Zagreb","unit":"celsius"}) |
| T3 | Use convert_units to convert 3 km to m. | convert_units({"value":3,"from_unit":"km","to_unit":"m"}) |
| T4 | Use get_build_status for project Orion, build 17. | get_build_status({"project":"Orion","build":17}) |
For retrieval, insert before record index floor(fraction * record_count) using zero-based indices. Append the
question after the records. Each tool case exposes only its named mock function, with an object parameter schema,
all listed properties required, and additionalProperties: false. Properties are strings except T3's value
(number) and T4's build (integer). Use tool_choice: "auto", description Synthetic benchmark lookup; no external action is performed., and exactly the names and arguments above. Validate one structured tool call;
prose that merely describes a call fails. Do not execute tools, contact services, or add tool-result turns.
Exact-text checks strip only surrounding ASCII whitespace. JSON checks parse one complete JSON value, reject
duplicate keys, extra prose and Markdown fences, and compare values and types; object key order is irrelevant.
Tool arguments use the same strict parsing; function name, required values, and absence of extra keys must match.
No text answer is required in a successful tool-call case. Record malformed output, wrong answers, truncation,
errors, and skipped cases individually. Only a completed, correct response passes. The denominator remains
12, with category denominators 4; skipped cases also make the suite partial.
How the runner reads the protocol
Where the rules leave room, strata bench run takes the most literal reading. These are its choices; a different
reading needs a new protocol ID.
- Settings. Every request carries all sampling values,
reasoning_effort: "xhigh", both thinking flags, the seed and the cap, plusreasoning_budget_tokens: 0(no budget) andstream_options.include_usage. The server's chat-completions handler passesenable_thinkingandreasoning_effortto the template; it ignorespreserve_thinking, which changes nothing for a single-turn conversation. A server that answers a request with HTTP 400 or 422 makes the runnonconforming; the runner never retries with other settings. The runner cannot see the server's repeat-stop and loop-recovery switches, so it does not claim to have disabled them. - Track.
--trackdefaults tocustom. The runner cannot tell whether a setup is untouched, sodefaultis only what the operator declares. - Unexpected reuse. A request's
cached_tokensmay be at most itsmax_shared_prefix_tokens(see the fixtures) plus 8 tokens for merges at the boundary. Above that the user payload was read from the cache: the request is left out of the speed summaries, and a performance request makes the runnonconforming. Running the protocol twice against the same server therefore flags the second run; restart the engine between runs. - Prompt length. The measured
input_tokensof the 4K and 16K cases must stay within 2% of 4,096 and 16,384. A different tokenizer or template breaks that and makes the runnonconforming. - Truncation.
finish_reason: "length"istruncated. It stays in the speed summaries and fails a sanity case. Any other finish reason exceptstopandtool_callsis a failure. - Reading it out. On the first real runs (RTX 3060, 2x RTX A4000, six runs) 35 of 36 4K and 16K performance
requests stopped at the 512-token cap while still reasoning, and so did 5 of 18
shortrequests. Their total time is the time to the cap, and they have no first-answer time. The plain summary and the README therefore carry aCappedcolumn (how many of a case's requests reached the cap). Theshortprompt is about 80 tokens, so its prompt rate (130 to 190 tok/s there) measures the fixed cost of a request and is left out of those two readouts;results.jsonkeeps it. Changing the cap or the prompts would be a new protocol ID. - Numbers. JSON equality compares types:
3is not3.0, andtrueis not1. A tool case needs exactly one structured call; text next to it is ignored. - After a failure. The runner asks
/healthonce. If the server does not answer, the remaining requests areskipped. A failed warm-up skips everything after it. Ctrl-C ends the run the same way and still writes the result. - Timeout. The 1,800 seconds are counted from dispatch with a timer that closes the connection, so a stalled stream and a long queue both count.
- Duration.
required_duration_sruns from the warm-up's dispatch to the end of the last sanity request. Hashing the model files and probing the machine come before it. - Model files. The runner hashes the GGUF files it can find (the server's
model_path, every shard of a split file, and files named in the profile's engine arguments). Without a file there is no hash and the run isnonconforming. - Remote servers. A server that is not on loopback gives a
nonconformingresult, because standard latency is a loopback measurement.
Measurements
Keep the inference host's hardware separate from any client description. Standard latency uses loopback; remote/network measurements belong in a separate nonstandard report. Record all inference GPUs, selected device indices, dedicated or shared memory, CPU, RAM, storage, OS, driver/runtime versions, power limits when available, and other workloads. Use bytes for memory, watts for power, seconds for durations, and tokens/second for rates.
On Apple silicon (Metal) the GPU and the CPU share one memory pool: record one GPU entry named after the chip,
memory_kind: "shared", memory_bytes equal to the installed memory, and power_limit_w: null with a reason.
There is no separate GPU driver (drivers stays null with a reason); put the macOS version in runtime as
{"name": "metal", "version": "<macOS version>"}. AMD APUs such as Strix Halo also use shared memory; the runner
reports shared only for Apple silicon and the operator must correct any other unified-memory machine in the
README.
| Metric | Definition and evidence |
|---|---|
| Prompt tokens/sec | Engine read_tokens / prompt_s, using only freshly processed tokens and their engine duration. Cached tokens never enter the numerator. |
| Decode tokens/sec | Engine decode_tokens / decode_s. Include accepted reasoning and answer tokens; exclude rejected speculative drafts. Preserve the exact engine count used for this timer. |
| TTFT | Client monotonic time from request dispatch to first nonempty reasoning, answer, or generated tool-call delta. Ignore headers, role-only chunks, empty deltas, and keep-alives. Record the delta kind. |
| First-answer latency | Time from the same dispatch to first nonempty final-answer text or generated tool-call delta. Reasoning alone does not count. Null if no answer or tool call arrives. |
| Total duration | Client dispatch through stream completion, error, or cancellation, including queueing and prompt processing. |
| Concurrent aggregate tokens/sec | For one round, total accepted output tokens from completed or capped requests divided by wall time from first dispatch to last termination in that round. Keep failed-request time in that wall time; report failures alongside the rate. |
Where the numbers come from
Strata's streaming chat answer ends with a chunk that carries usage and timings (llama.cpp's names). The runner
maps them as follows. Nothing else feeds a throughput rate.
| Protocol field | Source in the answer |
|---|---|
input_tokens | usage.prompt_tokens |
cached_tokens | usage.prompt_tokens_details.cached_tokens, else timings.cache_n |
read_tokens | timings.prompt_n; if absent, input_tokens - cached_tokens, and sources says it was derived |
prompt_s | timings.prompt_ms / 1000 |
output_tokens | usage.completion_tokens |
decode_s | timings.predicted_ms / 1000 |
decode_tokens | timings.predicted_n when it agrees with timings.predicted_per_second x predicted_s (the engine rounds its rate to 0.1 tokens/s, so the check allows 0.05 x decode_s + 1 tokens); otherwise the count the rate implies, with a token_accounting_note |
prompt_tps | read_tokens / prompt_s, null when read_tokens is 0 (the whole prompt came from the cache) or a duration is 0 |
decode_tps | decode_tokens / decode_s, null when either is 0 |
ttft_s, first_answer_s, total_s | the client's monotonic clock from dispatch; never an engine field |
Retain API output_tokens separately from engine decode_tokens. If the counts differ, explain the engine
accounting and preserve its raw timing lines; do not assume predicted_n is always the count used by
predicted_per_second. Reasoning/answer token splits are optional if the engine cannot provide them reliably.
Streaming chunks are never tokens. Do not use characters, words, or chunks to fill missing token counts, or
divide output tokens by total request time and label the result decode speed.
Use engine counts and durations for the two primary throughput rates. Client estimates, if included as extra
data, must have a distinct name and source and cannot enter those summaries. When a required count or timing is
unavailable, publish null with a reason. Do not divide by zero or publish NaN/infinity. For a cancelled prefill,
retain actual processed tokens if known; do not invent complete-prompt timing.
Compute medians, minima, maxima, and sample counts for each performance case separately. Use completed requests
and requests that normally reach the specified output cap; preserve their different finish reasons. Exclude
errors, cancellations, unexpected cache reuse, and missing/invalid measurements, and list the exclusions. A cap
is an expected performance boundary but a failed sanity answer. Never hide early EOS, failed requests, or
slow samples. A partial sample set keeps its actual n; do not imply that three repeats succeeded.
Do not pool prompt sizes, quantizations, configurations, or concurrency levels. Optional concurrency has per-request records plus per-round aggregates and separate summaries. Three rounds are too few to advertise a stable p95. Quality scores remain separate from throughput; an incorrect answer must not disappear from the report.
Result contract
The following is the normative documentation for the future JSON format, not an implementation or a schema
validator. All named keys are required unless explicitly optional. Unknown extra fields must be under
extensions; a consumer must reject unknown schema/protocol versions instead of silently combining results.
Use UTF-8 JSON, finite numbers, nonnegative integer token/request counts, UTC ISO 8601 timestamps, and lowercase
64-character SHA-256 strings. Paths are relative to the report directory, without absolute paths or ...
Unavailable values are null, not zero, empty strings, or "N/A". Every null has a JSON Pointer entry in missing
explaining why, including not-applicable values. Empty arrays mean genuinely no items; unknown arrays are null.
Top-level fields
| Field | Required content |
|---|---|
format, schema_version | "strata-standard-benchmark", 1; distinct from the current runner's legacy schema: 1. |
protocol | id, git_commit, profile, corpus_sha256, model_card_revision. Git commits are full immutable IDs. |
run | Unique string id, started_at, status, required_duration_s, optional_duration_s, boolean optional_concurrency, and sanitized command string command. Status is complete, partial, or nonconforming; optional duration is null with a reason when not selected. |
hardware | gpus array of {device_index, name, memory_bytes, memory_kind, power_limit_w}; string cpu, integer ram_bytes, storage array of {kind, model, bus}, and background_workloads array of strings. GPU index is an integer, names/storage attributes are strings. Memory kind is dedicated or shared; do not count shared VRAM again as extra system RAM. |
software | os as {name, version}, drivers and runtime arrays of {name, version}, strings strata_commit, engine_version, build_kind, runner_commit, and string-array build_options. Build kind is release or source; names/versions are strings. |
model | id, revision, source_revision, quantization, files array of {path, sha256}, tokenizer_revision, and custom_pack (description/preparation reference, or null when absent). Model file paths identify pack-relative filenames, not private machine paths. |
configuration | Strings track, track_notes; integers context_tokens, server_capacity; objects kv_cache, expert_cache, offloading, prefill, mtp, calibration, experimental_options; template as {path, sha256} pointing to the attached template; sampling and chat_template_kwargs objects. Configuration objects preserve effective engine option names and JSON values. sampling contains temperature, top_p, top_k, min_p, presence_penalty, repetition_penalty, and reasoning_effort. The two thinking flags belong in chat_template_kwargs; seeds/caps are per request. |
request_counts | Objects for warmup, performance, sanity, concurrency, each with planned, attempted, completed, truncated, failed, skipped. |
requests | One record per scheduled request, including warm-up, failed and skipped requests; shape below. |
summaries | Array of {phase, case_id, concurrency, metric, unit, median, min, max, n, included_request_ids, excluded}. Each exclusion has request_id and reason. Zero valid samples means n: 0, null statistics, and reasons. |
concurrency_rounds | Array of {round, request_ids, wall_s, output_tokens, aggregate_tps, failed}; empty when the optional stage was not selected. output_tokens includes only completed/capped requests; null if any included request lacks a count. |
quality | passed, total (12), categories with instruction, retrieval, tool_call, each {passed, total} (total 4). Per-case verdicts are in requests. |
artifacts | Array of {kind, path, sha256} for sanitized configuration, engine logs, and request/output evidence; optional additional provenance. Kind is config, engine_log, outputs, or provenance. Hash final sanitized bytes. |
missing | Map of JSON Pointers to specific reasons for null values. |
extensions | Optional object for data beyond this contract; never a substitute for required fields. |
Where the software fields come from. strata_commit and runner_commit are the full commit of the install: git rev-parse HEAD in a source checkout, or the COMMIT file a release archive carries (written by packaging/package_terminal.py).
An install with neither has no commit, and the run is nonconforming. engine_version is the engine's own version
from /props (build_info), or /v1/status when /props has none. build_kind is source when the
folder has a .git, otherwise release. The runner cannot read build options from a server; pass --build-options
for a source build. The drivers and the CUDA version come from nvidia-smi (or rocm-smi, or the Windows display
driver key), read on the machine that runs the engine. ROCm 7 and newer ship amd-smi and no rocm-smi: the card's
name is that tool's static --asic market name, its memory is the amdgpu sysfs file of the PCI address amd-smi list
reports, and the rocm runtime entry is the version file inside the ROCm install (amd-smi -h prints the same
version). Where the kernel builds amdgpu in there is no driver version to read, and gpu-driver stays null with a
reason. When the server can only name a vendor, because the amdgpu product_name is empty on some cards, the card the
local probe named is kept instead.
Except for typed objects, arrays, numbers and booleans identified above, identity and descriptive fields are
strings (or null with a reason where unavailable). Empty configuration objects mean no relevant options;
unknown settings are null. configuration.track_notes states setup choices for a default run or modifications
for a custom run. A warm-up failure aborts the measured stages with explicit skipped records.
complete means all required requests were attempted and their outcomes were recorded, including failures;
it does not mean all checks passed. partial means required work was skipped or interrupted. nonconforming
takes precedence for changed profile/workload settings, unsupported defaults, claimed counts without traceable sources, unexpected
user-payload cache reuse, or missing required identity such as the commit, model files, template, or corpus.
Unknown ancillary hardware facts are allowed with reasons. A run lacking engine timings can retain other
measurements with those rates null; it cannot supply complete speed comparisons.
For each phase, attempted = completed + truncated + failed and planned = attempted + skipped. Planned counts
are 1, 9, 12, and either 12 or 0 for the optional extension. Omitted optional work is not skipped required
work. The full requests array therefore has 22 or 34 records. All twelve sanity IDs appear even after aborting.
There are no invisible retries. A later run gets a new ID and preserves the earlier run when discussing failures.
Each summary uses phase = "performance" or "concurrency", the exact case ID (or "short-burst" for the
optional stage), and metric prompt_tps, decode_tps, ttft_s, first_answer_s, or total_s. Units are
tokens/s for rates and s for latency. Publish all five summaries per selected performance/concurrency case,
including null summaries when there are no valid samples. Warm-up and sanity do not enter speed
summaries. Keep concurrent round aggregates in concurrency_rounds; do not average per-client rates to obtain
aggregate throughput. The website can derive a median/range across those three rounds.
Request records
The following is a shape example only for a request. It contains no measured result and is not a valid
submission. The enclosing missing map must explain every null when adapting it to real evidence.
{
"id" : "performance-short-r1" ,
"phase" : "performance" ,
"case_id" : "short" ,
"repetition" : 1 ,
"seed" : 1 ,
"max_output_tokens" : 512 ,
"concurrency" : 1 ,
"round" : null ,
"status" : null ,
"finish_reason" : null ,
"error" : null ,
"tokens" : {
"input_tokens" : null ,
"cached_tokens" : null ,
"read_tokens" : null ,
"output_tokens" : null ,
"decode_tokens" : null
},
"timings" : {
"prompt_s" : null ,
"decode_s" : null ,
"ttft_s" : null ,
"first_answer_s" : null ,
"total_s" : null
},
"metrics" : {
"prompt_tps" : null ,
"decode_tps" : null
},
"sources" : {
"input_tokens" : null ,
"cached_tokens" : null ,
"read_tokens" : null ,
"output_tokens" : null ,
"decode_tokens" : null ,
"engine_timings" : null ,
"client_timings" : null
},
"first_delta_kind" : null ,
"token_accounting_note" : null ,
"evaluation" : null
}
phase is warmup, performance, sanity, or concurrency. Repetition is one-based; round is 1..3 for
concurrency, otherwise null. Request IDs are warmup, performance-<case>-r<1..3>, sanity-<case>, or
concurrency-r<1..3>-c<1..4>. Concurrency records use case short-burst and repetition equal to the round.
Request status is completed, truncated, failed, or skipped. Preserve the server's original
finish_reason; reaching the cap maps to truncated, HTTP/stream errors, malformed streams and timeout to
failed, and work never dispatched to skipped. error is null for completed/truncated requests and otherwise
an object with kind and message, including a skip reason. No response must be treated as successful merely
because one delta arrived; require a normal stream end and finish reason.
sources identifies the raw API field or engine-log field for each count, the engine timer fields, and the
client monotonic-clock trace. Link the relevant evidence by request ID in the artifacts. first_delta_kind is
reasoning, answer, or tool_call, or null if none arrived. token_accounting_note explains count differences,
or is null when counts agree. Do not retokenize displayed final text to estimate hidden reasoning tokens.
For sanity requests, evaluation is { "category": "instruction|retrieval|tool_call", "passed": false, "reason": "..." }, using one actual category, a boolean verdict, and a specific reason. It is null for other
phases. A false verdict can accompany a normally completed request. Failed, truncated and skipped sanity requests
also carry a false verdict. Report passed/12 and the outcome counts together so a partial run is obvious.
The outputs artifact is JSON Lines keyed by request_id. Preserve the exact sanitized messages and tools,
final answer, structured tool calls, finish reason, raw usage/timings, error, and client event offsets sufficient
to check TTFT, first-answer latency and total duration. Keep request dispatch at offset zero and record the
first qualifying delta's type. Reasoning text is optional; its authoritative token count must still contribute
to throughput. For skipped work record the request ID and skip reason. Logs and output evidence must agree
with the JSON; derived summaries can always be rebuilt from request records.
Submit and review
Follow CONTRIBUTING.md. If a log or output shows a vulnerability or a secret, report it privately as SECURITY.md describes instead of putting it in a pull request. During the draft phase, submit pilot data clearly labelled with the draft protocol ID. Existing reports remain welcome under the community guide.
- Run one hardware/model/quant/configuration combination and retain every scheduled outcome. Add a separate run for another configuration or baseline; do not select only the best repetitions.
- Add
bench/results/<UTC-date>-standard-<hardware>-<run-id>/containingREADME.md,results.json, sanitized configuration, engine logs, andoutputs.jsonl. Small extra provenance files are allowed. Never add model weights or generated packs. Inspect redaction before publishing and compute artifact hashes afterwards. - The report states the protocol/status, hardware, model/quant, commit/configuration, actual duration, counts,
per-case performance, passed/12 sanity score, failures, and limitations. Link raw evidence. Use
not measuredin prose and null with a reason in JSON. Do not paste hypothetical performance numbers into examples. - Open a results-only PR against
Niko1221/Strata:main. Suggested title:benchmark: <GPU> / <model> / <quant> / <protocol-id>. The body links the report, names required versus optional stages, and states any failed, skipped, missing, or nonconforming measurements. Keep engine changes separate. - Maintainers check the exact revision, profile and corpus, artifact hashes, counts, formulas, scores, logs, redaction, and limitations. Changes to evidence after review require another review. Low scores and slow hardware are valid results; invented evidence or changed settings represented as defaults are not.
Future approved manifest
After activation, use submission → maintainer review → approved manifest entry. The website will read
bench/approved.json on the default branch, not scrape PR prose, labels, or an approved field supplied by a
contributor. A maintainer adds an entry only after reviewing the exact artifacts. A merged report alone does not
mean it is in the approved list. Do not create a populated manifest for this draft.
The proposed manifest has format: "strata-approved-benchmarks", schema_version: 1, and an entries array.
Each entry has the following fields; the example has placeholders, no approved result:
{
"run_id" : "<reviewed-run-id>" ,
"protocol_id" : "<activated-protocol-id>" ,
"results_path" : "bench/results/<report-directory>/results.json" ,
"results_sha256" : "<sha256-of-reviewed-results-json>" ,
"evidence_commit" : "<full-git-commit-containing-reviewed-artifacts>" ,
"review_pr" : "<benchmark-pull-request-url>" ,
"reviewed_by" : "<maintainer-github-handle>" ,
"reviewed_at" : "<utc-iso8601-time>" ,
"verification" : "evidence-reviewed" ,
"reproduction_run_ids" : []
}
Resolve the repository-relative result path at evidence_commit; verify its hash and the hashes of its
referenced artifacts before displaying data. The evidence commit is the commit that introduced the reviewed
report, not the later manifest commit. Only maintainer-reviewed manifest changes count as approval. Changes
to results require a newly reviewed entry/hash; preserve old records or mark their replacement explicitly.
Remove a withdrawn entry from the current manifest with the reason in its review PR; Git history retains it.
Approval means evidence reviewed, not independent replication or a guarantee of quality. Use
verification: "independently-reproduced" only when another person has run the protocol and supplied the
linked approved reproduction run IDs; document hardware/configuration differences. Quality failures and partial
conforming runs can be reviewed and listed, with conspicuous outcome/status labels. Partial runs never appear
as complete results or gain a full-suite rank. Nonconforming and draft runs stay outside the activated standard
manifest, with their reports still accessible. A website must preserve these distinctions and missing values.
Existing community reports retain their original formats and are legacy/nonstandard for this protocol. Do not infer absent fields, relabel their sampling, or retroactively approve them. A new conforming run is needed for the standard list. Comparisons must expose protocol, model/quant, build/configuration track, prompt case, actual lengths/cache counts, and concurrency; there is no universal combined score.
Activation checklist
tools/strata_bench.py (behind BENCH.bat and ./bench.sh) hardcodes temperature 0, turns thinking off by default,
has no twelve-case sanity suite, reads changing repository files into its agent workload, and can fall back from token
counts to stream-chunk counts. --think alone does not fix those differences. strata bench run does not share
them: it is the protocol's runner.
Done in 0.2.1, with tests against a scripted mock server (tests/terminal/test_bench_standard.py) and the real
API server's mock engine:
- The fixtures, the profile settings, the runner, a strict result validator (
strata bench reportruns it), and the evidence files. Complete runs, early EOS, cap truncation, wrong answers, malformed JSON and tool calls, duplicate JSON keys, missing usage or timings, empty deltas and keep-alives, timeouts, cancellation, a stream cut before its end, server death, count identities, summary reconstruction, unexpected payload reuse, a refused setting, a remote server, optional concurrency, null reasons, and unknown format versions.
Before removing draft status:
- Verify against a real engine that the shipped chat template matches the pinned upstream behavior (tool
formatting included), and pin the model-card and tokenizer revisions (
protocol.model_card_revisionisnullwith a reason until then). The shippedserve/chat_template.jinjadiffers from the template inside the NVFP4 pack the fixtures were counted with; the frozen token counts use the shipped one. - Test the cases the mock server cannot show: insufficient context, an error after a first delta on a real engine, and optional concurrency with queueing on a server that has fewer than four slots.
- Recompute the sanity scores independently from the saved final outputs, and check draft/nonconforming exclusion and changed artifacts after review in the website that reads the results.
- Run a measured pilot on at least two supported hardware configurations, including a slower system. Publish actual duration, caps reached, failures, and sanity outcomes. Adjust the candidate workload if needed, then freeze a new protocol ID before collecting comparable standard results. Do not promise a universal runtime.
1# Strata standard benchmark protocol 2 3**Status: draft, implemented in `strata bench run`; pilot validation pending.** Protocol ID: `strata-qwen38-thinking-v1-draft.1`. 4Result format: `strata-standard-benchmark`, schema version `1`. 5 6This document specifies a repeatable community benchmark and the data a future website can consume. The 7required suite took **2 to 4 minutes after model loading** on the two machines it has been run on (RTX 3060 and 82x RTX A4000, IQ3_XXS, Strata 0.2.1: 3 min 22 s and 2 min 22 s; the optional concurrency stage added 1.5 to 2 minutes). 9Slower machines take longer; everyone runs the same work. Downloads, installation, compilation, and model loading are 10excluded; so is the hashing of the model files that the runner does first (about 1 to 5 minutes for a 44 to 71 GB model). 11Report their duration separately if measured. 12 13`strata bench run` implements this protocol from Strata 0.2.1. It sends the frozen fixtures in 14`bench/prompts/standard-v1` (corpus SHA-256 `e75eff8b9feea04f745520b392c4c17d97aefc1ba185e222aa6740efa8f68407`) 15and writes the result format below. `BENCH.bat`, `./bench.sh`, and `tools/strata_bench.py` do not implement it. 16They stay the quick speed check described in the [community guide](COMMUNITY_BENCHMARKS.md). Do not rename their 17output or add a protocol ID to make it appear standard. The draft becomes final only after the measured pilot in the 18[activation checklist](#activation-checklist). The approved manifest described here does not exist yet. 19 20- [Run it](#run-it) 21- [Profile and settings](#profile-and-settings) 22- [Workload and scoring](#workload-and-scoring) 23- [Measurements](#measurements) 24- [Result contract](#result-contract) 25- [Submit and review](#submit-and-review) 26- [Activation checklist](#activation-checklist) 27 28## Run it 29 30Install Strata, set up the Flash-Next model you want to measure, and close other programs that use the GPU. Then: 31 32``` sh 33strata bench run --profile NAME --track default --track-notes "0.2.1 release, setup defaults" 34strata bench run --url http://127.0.0.1:8080 # a server that is already running 35``` 36 37With `--profile` the runner starts that profile's engine, waits for the model to load, runs the protocol, and stops 38the engine it started. If the profile is already serving, the runner uses that server and leaves it running; a 39server that has already answered requests is not freshly loaded, and the report says how many it had answered. 40`--no-start` forbids starting an engine. `--optional-concurrency` adds the optional stage. 41 42The runner checks every fixture against the bundle manifest before it sends anything, refuses to run if one byte 43differs, and rejects flags that would change the workload (`--concurrency`, `--repeat`, `--request-timeout`). 44`strata bench report DIR` prints a saved result again and re-validates it. Output goes to 45`bench/results/<UTC-date>-standard-<gpu>-<run-id>/` when the current folder has `bench/results`, otherwise to 46`./bench-results/`. Read the folder once before you share it: home folders, user and host names, private addresses, 47and keys are replaced, but the runner cannot know everything you consider private. 48 49Options that describe what the engine cannot tell the runner: `--track`, `--track-notes`, `--model-revision`, 50`--source-revision`, `--tokenizer-revision`, `--quantization`, `--custom-pack`, `--background` (repeatable), and 51`--build-options`. The runner never guesses these; an unset value is `null` with a reason. 52 53## Profile and settings 54 55The first profile is `qwen3.8-flash-next-thinking`: the original **Qwen/Qwen3.8-Flash-Next** weights and their 56quantizations. Record the quantization repository and immutable revision, source model revision, every model 57file's name and SHA-256, and any pack preparation or custom expert profile. Fine-tuned, Coder, Swift, or other 58derivative models require a separate profile. Results for different models, quants, builds, or configurations 59must remain distinguishable. 60 61Use the published [Qwen model-card defaults](https://huggingface.co/Qwen/Qwen3.8-Flash-Next): 62 63| Setting | Required value | 64| --- | --- | 65| `chat_template_kwargs.enable_thinking` | `true` | 66| `chat_template_kwargs.preserve_thinking` | `true` | 67| `reasoning_effort` | `"xhigh"` | 68| `temperature` | `1.0` | 69| `top_p` / `top_k` | `0.95` / `20` | 70| `min_p` | `0.0` | 71| `presence_penalty` / `repetition_penalty` | `0.0` / `1.0` | 72 73Pin the tokenizer revision, effective chat-template file and SHA-256, and model-card revision used to define 74the profile. Attach the effective template as a provenance artifact. The pilot must verify that the shipped 75template matches the pinned upstream behavior, including 76tool formatting. There is no extra benchmark system prompt. Tools are supplied only for the tool-call cases. 77Use streaming chat completions and request usage data. 78 79The future runner must explicitly request these settings and verify the resolved server configuration. UI, 80saved chat, and configuration defaults must not override them. Disable custom reasoning budgets, automatic 81effort changes, and additional stop strings. Unsupported settings make a run nonconforming; do not silently 82substitute greedy sampling or disable thinking. Output caps and fixed seeds below are benchmark constraints, 83not claims to use Qwen's full recommended output allowance. A fixed seed does not guarantee identical outputs 84across hardware or engine versions. 85 86Use one installed configuration per run. Record effective context, KV and expert cache settings, offloading, 87prefill, MTP, calibration, experimental options, and server capacity. Use `configuration.track = "default"` for 88an unmodified release's setup-generated settings; identify the release and setup choices. Use `"custom"` for 89tuning, experimental options, or modified builds and explain the changes. Never merge these tracks into one 90headline result. A claimed improvement requires a separate, same-machine baseline. 91 92## Workload and scoring 93 94Run the following stages in order through a dedicated server on the inference machine, using loopback HTTP. 95Start with a newly loaded engine, close other inference clients, and record unavoidable background work. 96Use the same configuration throughout the required stages. Include warm-up time in `required_duration_s`, 97but exclude warm-up requests from performance and quality summaries. 98 99| Stage | Cases and order | Repetitions | Output cap | Requests | 100| --- | --- | ---: | ---: | ---: | 101| Warm-up | `warmup`, short-prompt fixture | 1 | 128 | 1, excluded | 102| Performance | `short`, `prompt-4k`, `prompt-16k`; all three in each repetition | 3 | 512 | 9 | 103| Sanity | `I1`–`I4`, `R1`–`R4`, `T1`–`T4` | 1 each | 2,048 | 12 | 104| Optional concurrency | Four short-prompt requests released together, then wait for the entire round | 3 rounds | 512 each | 12, separate | 105 106The required suite schedules **21 measured requests plus one warm-up** at concurrency `1`. The optional 107extension schedules another `12` at concurrency `4` and has its own duration and summaries. Record the server's 108configured capacity: four clients may queue on a server with fewer than four slots. Do not describe that as 109four-way parallel decoding or silently change the server configuration. Testing another capacity is another run. 110 111Use seed `1` for warm-up; performance repetitions use seeds `1`, `2`, and `3`. Sanity cases use seed `1`. 112Optional round `r` uses seeds `4 * (r - 1) + j` for client `j` in `1..4`. Preserve early EOS; do not force more 113output to improve a rate. The caps include reasoning and final output together. Do not add a forced-answer 114instruction or a continuation request when a case reaches its cap. 115 116Apply a fixed 1,800-second wall-clock timeout per request, including queueing; cancel timed-out work and record 117it as failed. This is a safeguard, not a 30-minute suite deadline. Stop and mark remaining cases skipped if the 118engine dies or the user cancels. Do not retry failed requests inside a run or reduce the workload to fit hardware. 119 120### Frozen fixtures 121 122The bundle is committed in `bench/prompts/standard-v1`: one JSON file per scheduled request (the 22 required and 123the 12 optional ones) with its exact messages, tool schemas, seed, cap, expected output and frozen token count, 124plus `build.json` (how it was made) and `MANIFEST.sha256`. The SHA-256 of that manifest is 125`protocol.corpus_sha256`. `.gitattributes` marks `bench/prompts/**` as `-text`: a checkout must never convert 126their line endings, and the runner refuses a bundle whose bytes differ from the manifest. The runner records the 127protocol Git commit. Changes to prompts, order, scoring, caps, or defaults require a new protocol ID; schema 128changes use a separate schema version. 129 130`python tools/build_standard_corpus.py --tokenizer PACK/tokenizer` rebuilds the bundle byte for byte. It needs the 131tokenizer files (`vocab.json`, `merges.txt`, `token_type.json`) of a Flash-Next pack and the chat template Strata 132ships (`serve/chat_template.jinja`). The frozen counts are 211 records for `prompt-4k` (4,093 tokens) and 858 133records for `prompt-16k` (16,386 tokens). Besides each request's token count, the bundle stores the longest token 134prefix the request shares with any other request (`max_shared_prefix_tokens`); that is the cache reuse the 135protocol allows. 136 137Use synthetic data only. Do not read the checkout's current README or other changing project files into prompts. 138Build the candidate bundle as follows; these are construction instructions, not runtime adaptation: 139 140- The short task is: `Explain how a hash table finds a value, including collisions and one small example.` 141- Long performance payloads are records of the form 142`record000001: alpha beta gamma delta epsilon zeta eta theta.` with sequential six-digit IDs and LF newlines. 143Append: `Summarize the structure of these records and explain how to look up a record by its ID.` 144- During bundle preparation, use the pinned tokenizer and template to select the number of complete records 145whose rendered input is closest to 4,096 and 16,384 tokens. Freeze those messages, including all repetition 146variants; require lengths within 2% of the target. Record actual token counts for every request. 147- Prefix every user message with `[case <request-id>]` and a newline. IDs are fixed and unique within a run, 148including warm-up and concurrency requests. Start each request as a fresh conversation. Different markers 149prevent intentional full-prompt reuse; they do not prove that the shared template prefix was uncached. 150- For retrieval fixtures, use the same record construction at 4K or 16K, with the key/value facts below inserted 151at the stated fractions of the record list. Freeze the complete resulting messages and record actual lengths. 152Distractor records must not contain the queried keys or answers. 153 154The warmed expert cache stays enabled and evolves normally. Record reused and freshly processed prompt tokens 155on every request. Shared template-prefix reuse is allowed and must be reported. Unexpected reuse of the user 156payload invalidates that request's performance comparison; preserve the evidence. Do not call these runs 157zero-cache or cold-model measurements. 158 159### Twelve sanity checks 160 161These are small functional checks, not an intelligence ranking, a full coding evaluation, or proof of lossless 162quantization. Score the final answer or parsed API tool call automatically. Do not score reasoning text or use 163an LLM judge. Each case is worth one point, with no partial credit or best-of reruns. 164 165| ID | Fixed task or retrieval construction | Required result | 166| --- | --- | --- | 167| I1 | `Return only a JSON object with ok set to true and count set to the integer 3. No other keys.` | `{"ok":true,"count":3}` | 168| I2 | `Sort these integers in ascending order and remove duplicates: 9, 2, -4, 2, 1. Return only a JSON array.` | `[-4,1,2,9]` | 169| I3 | `Project: Orion. Build: 17. Return only a JSON object with keys project (string) and build (integer).` | `{"project":"Orion","build":17}` | 170| I4 | `Reply with exactly the word READY in uppercase and nothing else.` | `READY` | 171| R1 | 4K records; at 10%, insert `access_code = ORBIT-731`. Ask `What is access_code? Reply only with its value.` | `ORBIT-731` | 172| R2 | 4K records; at 50%, insert `storage_label = CEDAR-284`. Ask `What is storage_label? Reply only with its value.` | `CEDAR-284` | 173| R3 | 16K records; at 90%, insert `archive_code = DELTA-906`. Ask `What is archive_code? Reply only with its value.` | `DELTA-906` | 174| R4 | 16K records; at 10% insert `north = N-124`, at 90% insert `south = S-875`. Ask `Return only a JSON object containing north and south and their values.` | `{"north":"N-124","south":"S-875"}` | 175| T1 | `Use lookup_record to look up record A-17.` | `lookup_record({"id":"A-17"})` | 176| T2 | `Use get_weather for Zagreb in celsius.` | `get_weather({"city":"Zagreb","unit":"celsius"})` | 177| T3 | `Use convert_units to convert 3 km to m.` | `convert_units({"value":3,"from_unit":"km","to_unit":"m"})` | 178| T4 | `Use get_build_status for project Orion, build 17.` | `get_build_status({"project":"Orion","build":17})` | 179 180For retrieval, insert before record index `floor(fraction * record_count)` using zero-based indices. Append the 181question after the records. Each tool case exposes only its named mock function, with an object parameter schema, 182all listed properties required, and `additionalProperties: false`. Properties are strings except T3's `value` 183(`number`) and T4's `build` (`integer`). Use `tool_choice: "auto"`, description `Synthetic benchmark lookup; no 184external action is performed.`, and exactly the names and arguments above. Validate one structured tool call; 185prose that merely describes a call fails. Do not execute tools, contact services, or add tool-result turns. 186 187Exact-text checks strip only surrounding ASCII whitespace. JSON checks parse one complete JSON value, reject 188duplicate keys, extra prose and Markdown fences, and compare values and types; object key order is irrelevant. 189Tool arguments use the same strict parsing; function name, required values, and absence of extra keys must match. 190No text answer is required in a successful tool-call case. Record malformed output, wrong answers, truncation, 191errors, and skipped cases individually. Only a completed, correct response passes. The denominator remains 192`12`, with category denominators `4`; skipped cases also make the suite partial. 193 194### How the runner reads the protocol 195 196Where the rules leave room, `strata bench run` takes the most literal reading. These are its choices; a different 197reading needs a new protocol ID. 198 199- **Settings.** Every request carries all sampling values, `reasoning_effort: "xhigh"`, both thinking flags, the 200seed and the cap, plus `reasoning_budget_tokens: 0` (no budget) and `stream_options.include_usage`. The server's 201chat-completions handler passes `enable_thinking` and `reasoning_effort` to the template; it ignores 202`preserve_thinking`, which changes nothing for a single-turn conversation. A server that answers a request with 203HTTP 400 or 422 makes the run `nonconforming`; the runner never retries with other settings. The runner cannot see 204the server's repeat-stop and loop-recovery switches, so it does not claim to have disabled them. 205- **Track.** `--track` defaults to `custom`. The runner cannot tell whether a setup is untouched, so `default` is 206only what the operator declares. 207- **Unexpected reuse.** A request's `cached_tokens` may be at most its `max_shared_prefix_tokens` (see the fixtures) 208plus 8 tokens for merges at the boundary. Above that the user payload was read from the cache: the request is 209left out of the speed summaries, and a performance request makes the run `nonconforming`. Running the protocol twice 210against the same server therefore flags the second run; restart the engine between runs. 211- **Prompt length.** The measured `input_tokens` of the 4K and 16K cases must stay within 2% of 4,096 and 16,384. 212A different tokenizer or template breaks that and makes the run `nonconforming`. 213- **Truncation.** `finish_reason: "length"` is `truncated`. It stays in the speed summaries and fails a sanity case. 214Any other finish reason except `stop` and `tool_calls` is a failure. 215- **Reading it out.** On the first real runs (RTX 3060, 2x RTX A4000, six runs) 35 of 36 4K and 16K performance 216requests stopped at the 512-token cap while still reasoning, and so did 5 of 18 `short` requests. Their total time is the time to the cap, and 217they have no first-answer time. The plain summary and the README therefore carry a `Capped` column (how many of a case's 218requests reached the cap). The `short` prompt is about 80 tokens, so its prompt rate (130 to 190 tok/s there) measures the 219fixed cost of a request and is left out of those two readouts; `results.json` keeps it. Changing the cap or the prompts 220would be a new protocol ID. 221- **Numbers.** JSON equality compares types: `3` is not `3.0`, and `true` is not `1`. A tool case needs exactly one 222structured call; text next to it is ignored. 223- **After a failure.** The runner asks `/health` once. If the server does not answer, the remaining requests are 224`skipped`. A failed warm-up skips everything after it. Ctrl-C ends the run the same way and still writes the result. 225- **Timeout.** The 1,800 seconds are counted from dispatch with a timer that closes the connection, so a stalled 226stream and a long queue both count. 227- **Duration.** `required_duration_s` runs from the warm-up's dispatch to the end of the last sanity request. Hashing 228the model files and probing the machine come before it. 229- **Model files.** The runner hashes the GGUF files it can find (the server's `model_path`, every shard of a split file, and 230files named in the profile's engine arguments). Without a file there is no hash and the run is `nonconforming`. 231- **Remote servers.** A server that is not on loopback gives a `nonconforming` result, because standard latency is a loopback measurement. 232 233## Measurements 234 235Keep the inference host's hardware separate from any client description. Standard latency uses loopback; 236remote/network measurements belong in a separate nonstandard report. Record all inference GPUs, selected device 237indices, dedicated or shared memory, CPU, RAM, storage, OS, driver/runtime versions, power limits when available, 238and other workloads. Use bytes for memory, watts for power, seconds for durations, and tokens/second for rates. 239 240On Apple silicon (Metal) the GPU and the CPU share one memory pool: record one GPU entry named after the chip, 241`memory_kind: "shared"`, `memory_bytes` equal to the installed memory, and `power_limit_w: null` with a reason. 242There is no separate GPU driver (`drivers` stays `null` with a reason); put the macOS version in `runtime` as 243`{"name": "metal", "version": "<macOS version>"}`. AMD APUs such as Strix Halo also use shared memory; the runner 244reports `shared` only for Apple silicon and the operator must correct any other unified-memory machine in the 245README. 246 247| Metric | Definition and evidence | 248| --- | --- | 249| Prompt tokens/sec | Engine `read_tokens / prompt_s`, using only freshly processed tokens and their engine duration. Cached tokens never enter the numerator. | 250| Decode tokens/sec | Engine `decode_tokens / decode_s`. Include accepted reasoning and answer tokens; exclude rejected speculative drafts. Preserve the exact engine count used for this timer. | 251| TTFT | Client monotonic time from request dispatch to first nonempty reasoning, answer, or generated tool-call delta. Ignore headers, role-only chunks, empty deltas, and keep-alives. Record the delta kind. | 252| First-answer latency | Time from the same dispatch to first nonempty final-answer text or generated tool-call delta. Reasoning alone does not count. Null if no answer or tool call arrives. | 253| Total duration | Client dispatch through stream completion, error, or cancellation, including queueing and prompt processing. | 254| Concurrent aggregate tokens/sec | For one round, total accepted output tokens from completed or capped requests divided by wall time from first dispatch to last termination in that round. Keep failed-request time in that wall time; report failures alongside the rate. | 255 256### Where the numbers come from 257 258Strata's streaming chat answer ends with a chunk that carries `usage` and `timings` (llama.cpp's names). The runner 259maps them as follows. Nothing else feeds a throughput rate. 260 261| Protocol field | Source in the answer | 262| --- | --- | 263| `input_tokens` | `usage.prompt_tokens` | 264| `cached_tokens` | `usage.prompt_tokens_details.cached_tokens`, else `timings.cache_n` | 265| `read_tokens` | `timings.prompt_n`; if absent, `input_tokens - cached_tokens`, and `sources` says it was derived | 266| `prompt_s` | `timings.prompt_ms / 1000` | 267| `output_tokens` | `usage.completion_tokens` | 268| `decode_s` | `timings.predicted_ms / 1000` | 269| `decode_tokens` | `timings.predicted_n` when it agrees with `timings.predicted_per_second x predicted_s` (the engine rounds its rate to 0.1 tokens/s, so the check allows `0.05 x decode_s + 1` tokens); otherwise the count the rate implies, with a `token_accounting_note` | 270| `prompt_tps` | `read_tokens / prompt_s`, null when `read_tokens` is 0 (the whole prompt came from the cache) or a duration is 0 | 271| `decode_tps` | `decode_tokens / decode_s`, null when either is 0 | 272| `ttft_s`, `first_answer_s`, `total_s` | the client's monotonic clock from dispatch; never an engine field | 273 274Retain API `output_tokens` separately from engine `decode_tokens`. If the counts differ, explain the engine 275accounting and preserve its raw timing lines; do not assume `predicted_n` is always the count used by 276`predicted_per_second`. Reasoning/answer token splits are optional if the engine cannot provide them reliably. 277Streaming chunks are never tokens. Do not use characters, words, or chunks to fill missing token counts, or 278divide output tokens by total request time and label the result decode speed. 279 280Use engine counts and durations for the two primary throughput rates. Client estimates, if included as extra 281data, must have a distinct name and source and cannot enter those summaries. When a required count or timing is 282unavailable, publish `null` with a reason. Do not divide by zero or publish NaN/infinity. For a cancelled prefill, 283retain actual processed tokens if known; do not invent complete-prompt timing. 284 285Compute medians, minima, maxima, and sample counts for each performance case separately. Use completed requests 286and requests that normally reach the specified output cap; preserve their different finish reasons. Exclude 287errors, cancellations, unexpected cache reuse, and missing/invalid measurements, and list the exclusions. A cap 288is an expected performance boundary but a failed sanity answer. Never hide early EOS, failed requests, or 289slow samples. A partial sample set keeps its actual `n`; do not imply that three repeats succeeded. 290 291Do not pool prompt sizes, quantizations, configurations, or concurrency levels. Optional concurrency has per-request 292records plus per-round aggregates and separate summaries. Three rounds are too few to advertise a stable p95. 293Quality scores remain separate from throughput; an incorrect answer must not disappear from the report. 294 295## Result contract 296 297The following is the **normative documentation for the future JSON format**, not an implementation or a schema 298validator. All named keys are required unless explicitly optional. Unknown extra fields must be under 299`extensions`; a consumer must reject unknown schema/protocol versions instead of silently combining results. 300 301Use UTF-8 JSON, finite numbers, nonnegative integer token/request counts, UTC ISO 8601 timestamps, and lowercase 30264-character SHA-256 strings. Paths are relative to the report directory, without absolute paths or `..`. 303Unavailable values are `null`, not zero, empty strings, or `"N/A"`. Every null has a JSON Pointer entry in `missing` 304explaining why, including not-applicable values. Empty arrays mean genuinely no items; unknown arrays are null. 305 306### Top-level fields 307 308| Field | Required content | 309| --- | --- | 310| `format`, `schema_version` | `"strata-standard-benchmark"`, `1`; distinct from the current runner's legacy `schema: 1`. | 311| `protocol` | `id`, `git_commit`, `profile`, `corpus_sha256`, `model_card_revision`. Git commits are full immutable IDs. | 312| `run` | Unique string `id`, `started_at`, `status`, `required_duration_s`, `optional_duration_s`, boolean `optional_concurrency`, and sanitized command string `command`. Status is `complete`, `partial`, or `nonconforming`; optional duration is null with a reason when not selected. | 313| `hardware` | `gpus` array of `{device_index, name, memory_bytes, memory_kind, power_limit_w}`; string `cpu`, integer `ram_bytes`, `storage` array of `{kind, model, bus}`, and `background_workloads` array of strings. GPU index is an integer, names/storage attributes are strings. Memory kind is `dedicated` or `shared`; do not count shared VRAM again as extra system RAM. | 314| `software` | `os` as `{name, version}`, `drivers` and `runtime` arrays of `{name, version}`, strings `strata_commit`, `engine_version`, `build_kind`, `runner_commit`, and string-array `build_options`. Build kind is `release` or `source`; names/versions are strings. | 315| `model` | `id`, `revision`, `source_revision`, `quantization`, `files` array of `{path, sha256}`, `tokenizer_revision`, and `custom_pack` (description/preparation reference, or null when absent). Model file paths identify pack-relative filenames, not private machine paths. | 316| `configuration` | Strings `track`, `track_notes`; integers `context_tokens`, `server_capacity`; objects `kv_cache`, `expert_cache`, `offloading`, `prefill`, `mtp`, `calibration`, `experimental_options`; `template` as `{path, sha256}` pointing to the attached template; `sampling` and `chat_template_kwargs` objects. Configuration objects preserve effective engine option names and JSON values. `sampling` contains temperature, top_p, top_k, min_p, presence_penalty, repetition_penalty, and reasoning_effort. The two thinking flags belong in `chat_template_kwargs`; seeds/caps are per request. | 317| `request_counts` | Objects for `warmup`, `performance`, `sanity`, `concurrency`, each with `planned`, `attempted`, `completed`, `truncated`, `failed`, `skipped`. | 318| `requests` | One record per scheduled request, including warm-up, failed and skipped requests; shape below. | 319| `summaries` | Array of `{phase, case_id, concurrency, metric, unit, median, min, max, n, included_request_ids, excluded}`. Each exclusion has `request_id` and `reason`. Zero valid samples means `n: 0`, null statistics, and reasons. | 320| `concurrency_rounds` | Array of `{round, request_ids, wall_s, output_tokens, aggregate_tps, failed}`; empty when the optional stage was not selected. `output_tokens` includes only completed/capped requests; null if any included request lacks a count. | 321| `quality` | `passed`, `total` (12), `categories` with `instruction`, `retrieval`, `tool_call`, each `{passed, total}` (total 4). Per-case verdicts are in `requests`. | 322| `artifacts` | Array of `{kind, path, sha256}` for sanitized configuration, engine logs, and request/output evidence; optional additional provenance. Kind is `config`, `engine_log`, `outputs`, or `provenance`. Hash final sanitized bytes. | 323| `missing` | Map of JSON Pointers to specific reasons for null values. | 324| `extensions` | Optional object for data beyond this contract; never a substitute for required fields. | 325 326Where the software fields come from. `strata_commit` and `runner_commit` are the full commit of the install: `git rev-parse 327HEAD` in a source checkout, or the `COMMIT` file a release archive carries (written by `packaging/package_terminal.py`). 328An install with neither has no commit, and the run is `nonconforming`. `engine_version` is the engine's own version 329from `/props` (`build_info`), or `/v1/status` when `/props` has none. `build_kind` is `source` when the 330folder has a `.git`, otherwise `release`. The runner cannot read build options from a server; pass `--build-options` 331for a source build. The drivers and the CUDA version come from `nvidia-smi` (or `rocm-smi`, or the Windows display 332driver key), read on the machine that runs the engine. ROCm 7 and newer ship `amd-smi` and no `rocm-smi`: the card's 333name is that tool's `static --asic` market name, its memory is the amdgpu sysfs file of the PCI address `amd-smi list` 334reports, and the `rocm` runtime entry is the version file inside the ROCm install (`amd-smi -h` prints the same 335version). Where the kernel builds amdgpu in there is no driver version to read, and `gpu-driver` stays null with a 336reason. When the server can only name a vendor, because the amdgpu `product_name` is empty on some cards, the card the 337local probe named is kept instead. 338 339Except for typed objects, arrays, numbers and booleans identified above, identity and descriptive fields are 340strings (or null with a reason where unavailable). Empty configuration objects mean no relevant options; 341unknown settings are null. `configuration.track_notes` states setup choices for a default run or modifications 342for a custom run. A warm-up failure aborts the measured stages with explicit skipped records. 343 344`complete` means all required requests were attempted and their outcomes were recorded, including failures; 345it does not mean all checks passed. `partial` means required work was skipped or interrupted. `nonconforming` 346takes precedence for changed profile/workload settings, unsupported defaults, claimed counts without traceable sources, unexpected 347user-payload cache reuse, or missing required identity such as the commit, model files, template, or corpus. 348Unknown ancillary hardware facts are allowed with reasons. A run lacking engine timings can retain other 349measurements with those rates null; it cannot supply complete speed comparisons. 350 351For each phase, `attempted = completed + truncated + failed` and `planned = attempted + skipped`. Planned counts 352are `1`, `9`, `12`, and either `12` or `0` for the optional extension. Omitted optional work is not skipped required 353work. The full `requests` array therefore has 22 or 34 records. All twelve sanity IDs appear even after aborting. 354There are no invisible retries. A later run gets a new ID and preserves the earlier run when discussing failures. 355 356Each summary uses `phase = "performance"` or `"concurrency"`, the exact case ID (or `"short-burst"` for the 357optional stage), and metric `prompt_tps`, `decode_tps`, `ttft_s`, `first_answer_s`, or `total_s`. Units are 358`tokens/s` for rates and `s` for latency. Publish all five summaries per selected performance/concurrency case, 359including null summaries when there are no valid samples. Warm-up and sanity do not enter speed 360summaries. Keep concurrent round aggregates in `concurrency_rounds`; do not average per-client rates to obtain 361aggregate throughput. The website can derive a median/range across those three rounds. 362 363### Request records 364 365The following is a **shape example only** for a request. It contains no measured result and is not a valid 366submission. The enclosing `missing` map must explain every null when adapting it to real evidence. 367 368``` json 369{ 370"id" : "performance-short-r1" , 371"phase" : "performance" , 372"case_id" : "short" , 373"repetition" : 1 , 374"seed" : 1 , 375"max_output_tokens" : 512 , 376"concurrency" : 1 , 377"round" : null , 378"status" : null , 379"finish_reason" : null , 380"error" : null , 381"tokens" : { 382"input_tokens" : null , 383"cached_tokens" : null , 384"read_tokens" : null , 385"output_tokens" : null , 386"decode_tokens" : null 387}, 388"timings" : { 389"prompt_s" : null , 390"decode_s" : null , 391"ttft_s" : null , 392"first_answer_s" : null , 393"total_s" : null 394}, 395"metrics" : { 396"prompt_tps" : null , 397"decode_tps" : null 398}, 399"sources" : { 400"input_tokens" : null , 401"cached_tokens" : null , 402"read_tokens" : null , 403"output_tokens" : null , 404"decode_tokens" : null , 405"engine_timings" : null , 406"client_timings" : null 407}, 408"first_delta_kind" : null , 409"token_accounting_note" : null , 410"evaluation" : null 411} 412``` 413 414`phase` is `warmup`, `performance`, `sanity`, or `concurrency`. Repetition is one-based; `round` is `1..3` for 415concurrency, otherwise null. Request IDs are `warmup`, `performance-<case>-r<1..3>`, `sanity-<case>`, or 416`concurrency-r<1..3>-c<1..4>`. Concurrency records use case `short-burst` and repetition equal to the round. 417 418Request `status` is `completed`, `truncated`, `failed`, or `skipped`. Preserve the server's original 419`finish_reason`; reaching the cap maps to `truncated`, HTTP/stream errors, malformed streams and timeout to 420`failed`, and work never dispatched to `skipped`. `error` is null for completed/truncated requests and otherwise 421an object with `kind` and `message`, including a skip reason. No response must be treated as successful merely 422because one delta arrived; require a normal stream end and finish reason. 423 424`sources` identifies the raw API field or engine-log field for each count, the engine timer fields, and the 425client monotonic-clock trace. Link the relevant evidence by request ID in the artifacts. `first_delta_kind` is 426`reasoning`, `answer`, or `tool_call`, or null if none arrived. `token_accounting_note` explains count differences, 427or is null when counts agree. Do not retokenize displayed final text to estimate hidden reasoning tokens. 428 429For sanity requests, `evaluation` is `{ "category": "instruction|retrieval|tool_call", "passed": false, 430"reason": "..." }`, using one actual category, a boolean verdict, and a specific reason. It is null for other 431phases. A false verdict can accompany a normally completed request. Failed, truncated and skipped sanity requests 432also carry a false verdict. Report passed/12 and the outcome counts together so a partial run is obvious. 433 434The `outputs` artifact is JSON Lines keyed by `request_id`. Preserve the exact sanitized messages and tools, 435final answer, structured tool calls, finish reason, raw usage/timings, error, and client event offsets sufficient 436to check TTFT, first-answer latency and total duration. Keep request dispatch at offset zero and record the 437first qualifying delta's type. Reasoning text is optional; its authoritative token count must still contribute 438to throughput. For skipped work record the request ID and skip reason. Logs and output evidence must agree 439with the JSON; derived summaries can always be rebuilt from request records. 440 441## Submit and review 442 443Follow [CONTRIBUTING.md](../CONTRIBUTING.md). If a log or output shows a vulnerability or a secret, report it privately as 444[SECURITY.md](../SECURITY.md) describes instead of putting it in a pull request. During the draft phase, submit pilot data clearly labelled with 445the draft protocol ID. Existing reports remain welcome under the [community guide](COMMUNITY_BENCHMARKS.md). 446 4471. Run one hardware/model/quant/configuration combination and retain every scheduled outcome. Add a separate 448run for another configuration or baseline; do not select only the best repetitions. 4492. Add `bench/results/<UTC-date>-standard-<hardware>-<run-id>/` containing `README.md`, `results.json`, sanitized 450configuration, engine logs, and `outputs.jsonl`. Small extra provenance files are allowed. Never add model 451weights or generated packs. Inspect redaction before publishing and compute artifact hashes afterwards. 4523. The report states the protocol/status, hardware, model/quant, commit/configuration, actual duration, counts, 453per-case performance, passed/12 sanity score, failures, and limitations. Link raw evidence. Use `not measured` 454in prose and null with a reason in JSON. Do not paste hypothetical performance numbers into examples. 4554. Open a results-only PR against `Niko1221/Strata:main`. Suggested title: 456`benchmark: <GPU> / <model> / <quant> / <protocol-id>`. The body links the report, names required versus optional 457stages, and states any failed, skipped, missing, or nonconforming measurements. Keep engine changes separate. 4585. Maintainers check the exact revision, profile and corpus, artifact hashes, counts, formulas, scores, logs, 459redaction, and limitations. Changes to evidence after review require another review. Low scores and slow 460hardware are valid results; invented evidence or changed settings represented as defaults are not. 461 462### Future approved manifest 463 464After activation, use **submission → maintainer review → approved manifest entry**. The website will read 465`bench/approved.json` on the default branch, not scrape PR prose, labels, or an `approved` field supplied by a 466contributor. A maintainer adds an entry only after reviewing the exact artifacts. A merged report alone does not 467mean it is in the approved list. Do not create a populated manifest for this draft. 468 469The proposed manifest has `format: "strata-approved-benchmarks"`, `schema_version: 1`, and an `entries` array. 470Each entry has the following fields; the example has placeholders, no approved result: 471 472``` json 473{ 474"run_id" : "<reviewed-run-id>" , 475"protocol_id" : "<activated-protocol-id>" , 476"results_path" : "bench/results/<report-directory>/results.json" , 477"results_sha256" : "<sha256-of-reviewed-results-json>" , 478"evidence_commit" : "<full-git-commit-containing-reviewed-artifacts>" , 479"review_pr" : "<benchmark-pull-request-url>" , 480"reviewed_by" : "<maintainer-github-handle>" , 481"reviewed_at" : "<utc-iso8601-time>" , 482"verification" : "evidence-reviewed" , 483"reproduction_run_ids" : [] 484} 485``` 486 487Resolve the repository-relative result path at `evidence_commit`; verify its hash and the hashes of its 488referenced artifacts before displaying data. The evidence commit is the commit that introduced the reviewed 489report, not the later manifest commit. Only maintainer-reviewed manifest changes count as approval. Changes 490to results require a newly reviewed entry/hash; preserve old records or mark their replacement explicitly. 491Remove a withdrawn entry from the current manifest with the reason in its review PR; Git history retains it. 492 493Approval means **evidence reviewed**, not independent replication or a guarantee of quality. Use 494`verification: "independently-reproduced"` only when another person has run the protocol and supplied the 495linked approved reproduction run IDs; document hardware/configuration differences. Quality failures and partial 496conforming runs can be reviewed and listed, with conspicuous outcome/status labels. Partial runs never appear 497as complete results or gain a full-suite rank. Nonconforming and draft runs stay outside the activated standard 498manifest, with their reports still accessible. A website must preserve these distinctions and missing values. 499 500Existing community reports retain their original formats and are **legacy/nonstandard** for this protocol. 501Do not infer absent fields, relabel their sampling, or retroactively approve them. A new conforming run is needed 502for the standard list. Comparisons must expose protocol, model/quant, build/configuration track, prompt case, 503actual lengths/cache counts, and concurrency; there is no universal combined score. 504 505## Activation checklist 506 507`tools/strata_bench.py` (behind `BENCH.bat` and `./bench.sh`) hardcodes temperature `0`, turns thinking off by default, 508has no twelve-case sanity suite, reads changing repository files into its agent workload, and can fall back from token 509counts to stream-chunk counts. `--think` alone does not fix those differences. `strata bench run` does not share 510them: it is the protocol's runner. 511 512Done in 0.2.1, with tests against a scripted mock server (`tests/terminal/test_bench_standard.py`) and the real 513API server's mock engine: 514 515- The fixtures, the profile settings, the runner, a strict result validator (`strata bench report` runs it), and the 516evidence files. Complete runs, early EOS, cap truncation, wrong answers, malformed JSON and tool calls, duplicate JSON 517keys, missing usage or timings, empty deltas and keep-alives, timeouts, cancellation, a stream cut before its end, 518server death, count identities, summary reconstruction, unexpected payload reuse, a refused setting, a remote server, 519optional concurrency, null reasons, and unknown format versions. 520 521Before removing draft status: 522 523- Verify against a real engine that the shipped chat template matches the pinned upstream behavior (tool 524formatting included), and pin the model-card and tokenizer revisions (`protocol.model_card_revision` is `null` 525with a reason until then). The shipped `serve/chat_template.jinja` differs from the template inside the 526NVFP4 pack the fixtures were counted with; the frozen token counts use the shipped one. 527- Test the cases the mock server cannot show: insufficient context, an error after a first delta on a real engine, and 528optional concurrency with queueing on a server that has fewer than four slots. 529- Recompute the sanity scores independently from the saved final outputs, and check draft/nonconforming exclusion 530and changed artifacts after review in the website that reads the results. 531- Run a measured pilot on at least two supported hardware configurations, including a slower system. Publish 532actual duration, caps reached, failures, and sanity outcomes. Adjust the candidate workload if needed, then 533freeze a new protocol ID before collecting comparable standard results. Do not promise a universal runtime.