[GH-ISSUE #4325] [TUI] strata bench compare rejects a default standard-v1 run, and the documented tools/strata_bench.py --compare crashes on it #1911

Open
opened 2026-11-04 01:55:15 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @XiaoBinGan on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4325

What happens

A folder written by the default strata bench run suite (standard-v1) cannot be compared, by either of the two documented comparison paths:

  1. strata bench compare BASELINE CANDIDATE prints strata: unsupported benchmark report and exits 5.
  2. tools/strata_bench.py --compare BASELINE --compare-only CANDIDATE, which is what docs/COMMUNITY_BENCHMARKS.md names for comparing two saved runs, dies with a traceback:
Traceback (most recent call last):
  File "/opt/strata/terminal/tools/strata_bench.py", line 1129, in <module>
    sys.exit(main())
  File "/opt/strata/terminal/tools/strata_bench.py", line 1042, in main
    print(compare_table(load_results(Path(a.compare)), load_results(Path(a.compare_only))))
  File "/opt/strata/terminal/tools/strata_bench.py", line 968, in compare_table
    a, b = summary_metrics(old["results"]), summary_metrics(new["results"])
KeyError: 'results'

strata bench report FOLDER on the very same folders works, so the folders are fine.

Why

Two report schemas share the file name results.json inside the run folder:

  • strata bench run --suite standard-v1 (the default) writes strata_cli/bench_standard.py's schema: top-level format, run, requests, summaries, quality, …
  • strata_cli/bench.py (the serving suites, --suite serving-smoke, parallel-*) writes the older schema with a top-level results list, which is what bench.load() and both comparison paths read.

_bench() in strata_cli/cli.py knows this for report — it tries the standard loader first:

    if a.bench_command == "report":
        from strata_cli import bench_standard
        standard_report = bench_standard.load_if_standard(Path(a.path))
        if standard_report is not None:
            ...
        report = bench.load(Path(a.path))

but compare goes straight to the old reader with no such branch:

    if a.bench_command == "compare":
        result = bench.compare(bench.load(Path(a.baseline)), bench.load(Path(a.candidate)))

So the same asymmetry that was closed for report is still open for compare, and tools/strata_bench.py --compare reads the same file name with its own expectation.

Smallest steps or command that reproduce it

With two folders from the default suite (two runs on the same machine are enough), on 0.2.7-cuda13:

strata bench run --url http://127.0.0.1:8080 --skip-model-hash --out /tmp/run-a
strata bench run --url http://127.0.0.1:8080 --skip-model-hash --out /tmp/run-b

strata bench report /tmp/run-a          # works: prints the standard report
strata bench compare /tmp/run-a /tmp/run-b
# strata: unsupported benchmark report

/opt/strata/terminal/python/bin/python3 tools/strata_bench.py --compare /tmp/run-a --compare-only /tmp/run-b
# KeyError: 'results'

I hit this with two real standard-v1 runs (2026-10-21 shared card, 2026-10-24 exclusive, RTX 5090, Q2_0) while writing a community report, which is exactly the case docs/COMMUNITY_BENCHMARKS.md describes.

Expected

Comparing two standard-v1 runs shows the per-case medians side by side (the same numbers strata bench report prints), or, if that is not wanted yet, a sentence that says a standard-v1 report cannot be compared by this command and which command can — not a KeyError traceback and not unsupported benchmark report for a folder the tool next door reads happily.

Reproduction status

Reproduced locally (both paths, 0.2.7-cuda13 image, on the folders of two real standard runs).

Strata version

Terminal 0.2.7 (engine 0.1.52) in the 0.2.7-cuda13 image; the run folders are from 0.2.2-cuda13 (engine 0.1.47).

Graphics card, memory and system

RTX 5090 32 GB, PCIe Gen 3 ×16, 2 × Xeon Gold 5218, 125.6 GiB RAM, Ubuntu 20.04 host, Docker 19.03.15. Nothing about the comparison depends on the card.

Model, size and settings

ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF Q2_0, 32K context, KV int8, one slot — the comparison failure does not depend on the model.

Logs

The two outputs are quoted above. I can implement the compare for standard reports (per-case medians over summaries, the fields bench_standard.format_plain already prints) and add the tests, if that scope is wanted — or just make both paths say what to do instead, if you would rather keep compare limited to the serving suites.

Originally created by @XiaoBinGan on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4325 ### What happens A folder written by the **default** `strata bench run` suite (`standard-v1`) cannot be compared, by either of the two documented comparison paths: 1. `strata bench compare BASELINE CANDIDATE` prints `strata: unsupported benchmark report` and exits 5. 2. `tools/strata_bench.py --compare BASELINE --compare-only CANDIDATE`, which is what `docs/COMMUNITY_BENCHMARKS.md` names for comparing two saved runs, dies with a traceback: ```text Traceback (most recent call last): File "/opt/strata/terminal/tools/strata_bench.py", line 1129, in <module> sys.exit(main()) File "/opt/strata/terminal/tools/strata_bench.py", line 1042, in main print(compare_table(load_results(Path(a.compare)), load_results(Path(a.compare_only)))) File "/opt/strata/terminal/tools/strata_bench.py", line 968, in compare_table a, b = summary_metrics(old["results"]), summary_metrics(new["results"]) KeyError: 'results' ``` `strata bench report FOLDER` on the very same folders works, so the folders are fine. ### Why Two report schemas share the file name `results.json` inside the run folder: - `strata bench run --suite standard-v1` (the default) writes `strata_cli/bench_standard.py`'s schema: top-level `format`, `run`, `requests`, `summaries`, `quality`, … - `strata_cli/bench.py` (the serving suites, `--suite serving-smoke`, `parallel-*`) writes the older schema with a top-level `results` list, which is what `bench.load()` and both comparison paths read. `_bench()` in `strata_cli/cli.py` knows this for `report` — it tries the standard loader first: ```python if a.bench_command == "report": from strata_cli import bench_standard standard_report = bench_standard.load_if_standard(Path(a.path)) if standard_report is not None: ... report = bench.load(Path(a.path)) ``` but `compare` goes straight to the old reader with no such branch: ```python if a.bench_command == "compare": result = bench.compare(bench.load(Path(a.baseline)), bench.load(Path(a.candidate))) ``` So the same asymmetry that was closed for `report` is still open for `compare`, and `tools/strata_bench.py --compare` reads the same file name with its own expectation. ### Smallest steps or command that reproduce it With two folders from the default suite (two runs on the same machine are enough), on `0.2.7-cuda13`: ```sh strata bench run --url http://127.0.0.1:8080 --skip-model-hash --out /tmp/run-a strata bench run --url http://127.0.0.1:8080 --skip-model-hash --out /tmp/run-b strata bench report /tmp/run-a # works: prints the standard report strata bench compare /tmp/run-a /tmp/run-b # strata: unsupported benchmark report /opt/strata/terminal/python/bin/python3 tools/strata_bench.py --compare /tmp/run-a --compare-only /tmp/run-b # KeyError: 'results' ``` I hit this with two real `standard-v1` runs (2026-10-21 shared card, 2026-10-24 exclusive, RTX 5090, Q2_0) while writing a community report, which is exactly the case `docs/COMMUNITY_BENCHMARKS.md` describes. ### Expected Comparing two `standard-v1` runs shows the per-case medians side by side (the same numbers `strata bench report` prints), or, if that is not wanted yet, a sentence that says a standard-v1 report cannot be compared by this command and which command can — not a `KeyError` traceback and not `unsupported benchmark report` for a folder the tool next door reads happily. ### Reproduction status Reproduced locally (both paths, 0.2.7-cuda13 image, on the folders of two real standard runs). ### Strata version Terminal 0.2.7 (engine 0.1.52) in the `0.2.7-cuda13` image; the run folders are from `0.2.2-cuda13` (engine 0.1.47). ### Graphics card, memory and system RTX 5090 32 GB, PCIe Gen 3 ×16, 2 × Xeon Gold 5218, 125.6 GiB RAM, Ubuntu 20.04 host, Docker 19.03.15. Nothing about the comparison depends on the card. ### Model, size and settings `ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF` Q2_0, 32K context, KV int8, one slot — the comparison failure does not depend on the model. ### Logs The two outputs are quoted above. I can implement the compare for standard reports (per-case medians over `summaries`, the fields `bench_standard.format_plain` already prints) and add the tests, if that scope is wanted — or just make both paths say what to do instead, if you would rather keep compare limited to the serving suites.
Author
Owner

@XiaoBinGan commented on GitHub (Oct 27, 2026):

A fix for the traceback is in #4326: load_results() recognises the standard schema and stops with one sentence instead of KeyError: 'results', exit 2 like the argument errors beside it.

ext strata_bench: /runs/shared/results.json is a standard benchmark report (strata bench run, suite standard-v1). This comparison reads the serving-suite reports the tool writes itself; strata bench report /runs/shared shows this one. Comparing two standard runs is #4325.

That is deliberately not the comparison itself. If you want one, the shape I would write is a per-case table from summaries — the same medians strata bench report prints, side by side with their deltas — plus the "these are different builds" and "these ran on different machines" guards the serving comparison already has. Say the word and I will add it here; the two real folders I reproduced with are standard-v1 runs from the same machine and model, one with the card shared and one with it exclusive, so they make a good first pair to try it on.

I left strata bench compare BASELINE CANDIDATE alone: it answers unsupported benchmark report for a standard report for the same reason (_bench() in strata_cli/cli.py branches on
eport but not on compare), and that is a CLI error contract I would rather change with your agreement than on my own. It is one extra branch next to the
eport one if you want both.

Verified on the 0.2.7 image with the patched tool mounted over the image's and two real run folders: the traceback became the sentence above (exit 2), a serving-suite report still loads unchanged, and --compare without --compare-only still gives the argparse error.

<!-- gh-comment-id:6446602536 --> @XiaoBinGan commented on GitHub (Oct 27, 2026): A fix for the traceback is in #4326: load_results() recognises the standard schema and stops with one sentence instead of KeyError: 'results', exit 2 like the argument errors beside it. ` ext strata_bench: /runs/shared/results.json is a standard benchmark report (strata bench run, suite standard-v1). This comparison reads the serving-suite reports the tool writes itself; strata bench report /runs/shared shows this one. Comparing two standard runs is #4325. ` That is deliberately **not** the comparison itself. If you want one, the shape I would write is a per-case table from summaries — the same medians strata bench report prints, side by side with their deltas — plus the "these are different builds" and "these ran on different machines" guards the serving comparison already has. Say the word and I will add it here; the two real folders I reproduced with are standard-v1 runs from the same machine and model, one with the card shared and one with it exclusive, so they make a good first pair to try it on. I left strata bench compare BASELINE CANDIDATE alone: it answers unsupported benchmark report for a standard report for the same reason (_bench() in strata_cli/cli.py branches on eport but not on compare), and that is a CLI error contract I would rather change with your agreement than on my own. It is one extra branch next to the eport one if you want both. Verified on the 0.2.7 image with the patched tool mounted over the image's and two real run folders: the traceback became the sentence above (exit 2), a serving-suite report still loads unchanged, and --compare without --compare-only still gives the argparse error.
Author
Owner

@XiaoBinGan commented on GitHub (Oct 27, 2026):

The CLI half is in #4329: _bench() now asks ench_standard.load_if_standard() before the serving-suite reader — the same branch the
eport command beside it already had — so

` ext
$ strata bench compare /runs/shared /runs/exclusive
strata: this version cannot compare two standard benchmark results yet (#4325); strata bench report FOLDER shows each one
$ echo True
5

$ strata bench compare
strata: comparing a standard benchmark result with another kind of report is not supported: give two standard results or two serving-suite reports
`

Verified with python -m pytest tests/terminal/test_bench_standard.py -q: 51 failed, 19 passed with the change against 53 failed, 17 passed with cli.py reverted — the two extra passes are the new cases, and the 51 pre-existing failures (real HTTP servers, timing-sensitive suites, this Windows checkout) are identical in both runs.

Together with #4326 both documented comparison surfaces now refuse a standard report in one sentence instead of a traceback or a dead end. The comparison itself is still the open question — say the shape you want and I will write it with tests, next to the existing output formats.

<!-- gh-comment-id:6446710196 --> @XiaoBinGan commented on GitHub (Oct 27, 2026): The CLI half is in #4329: _bench() now asks ench_standard.load_if_standard() before the serving-suite reader — the same branch the eport command beside it already had — so ` ext $ strata bench compare /runs/shared /runs/exclusive strata: this version cannot compare two standard benchmark results yet (#4325); strata bench report FOLDER shows each one $ echo True 5 $ strata bench compare <standard folder> <serving-suite folder> strata: comparing a standard benchmark result with another kind of report is not supported: give two standard results or two serving-suite reports ` Verified with python -m pytest tests/terminal/test_bench_standard.py -q: 51 failed, 19 passed with the change against 53 failed, 17 passed with cli.py reverted — the two extra passes are the new cases, and the 51 pre-existing failures (real HTTP servers, timing-sensitive suites, this Windows checkout) are identical in both runs. Together with #4326 both documented comparison surfaces now refuse a standard report in one sentence instead of a traceback or a dead end. The comparison itself is still the open question — say the shape you want and I will write it with tests, next to the existing output formats.
Author
Owner

@XiaoBinGan commented on GitHub (Oct 31, 2026):

Scope proposal for the feature half of this issue (per CONTRIBUTING, features agree scope first). If the shape is right I will write it with tests; if you would rather keep compare for the serving suites only, say so and I will close this thought here.

What it would do. strata bench compare BASELINE CANDIDATE accepts two standard-v1 reports and prints one table per phase, one row per case:

Case        Metric      Baseline            Candidate           Change
short       decode      235.4 (222.0-266.3) 241.8 (238.1-249.0) +2.7%
prompt-4k   prompt      3520.6 (3493.5-…)   3641.2 (3610.0-…)   +3.4%
prompt-16k  ttft        2.99 (2.99-3.04)    2.86 (2.80-2.91)    -4.3%

with --output json returning the same numbers, and --output markdown a table that can be pasted into a report.

What it would refuse, loudly. The serving comparison already has a workload_match idea; the standard one needs its own guards, and to me the honest set is:

  • a different suite or protocol id (strata-qwen38-thinking-v1 against another) → no comparison, one sentence;
  • a different model id or quantization → compared only with a warning line above the table, since that is a legitimate "before/after a model change" comparison for a person's own notes;
  • different hardware (gpu name or count, ram) → warning line, not a refusal: two machines of the same build are a real comparison, just not a benchmark claim;
  • a cached/absent figure (a summaries row missing for a case) → n/a, never 0.

What it would not change. Nothing in the report format, nothing in strata bench run, no default; a new reader plus compare accepting a second kind of folder. The two "readable error" pull requests (#4326, #4329) stay useful either way — they are the ones a reader on today's release sees.

Validation I can offer. The two real standard-v1 folders I reproduced this issue with: same machine, same model (RTX 5090, Q2_0), 2026-10-21 with the card shared (5,784 expert slots) and 2026-10-24 exclusive (19,530 slots) — so the comparison has a known-good answer to check against (decode +55% at 4K, +62% at 16K, TTFT −51%/−40%). Plus unit tests over synthetic reports for the guards. No GPU needed for either.

Size. One function in strata_cli/bench_standard.py (a compare(baseline, candidate) over summaries), the CLI branch next to the one #4329 adds, and tests. I would keep it in one pull request.

<!-- gh-comment-id:6542968671 --> @XiaoBinGan commented on GitHub (Oct 31, 2026): Scope proposal for the feature half of this issue (per CONTRIBUTING, features agree scope first). If the shape is right I will write it with tests; if you would rather keep `compare` for the serving suites only, say so and I will close this thought here. **What it would do.** `strata bench compare BASELINE CANDIDATE` accepts two `standard-v1` reports and prints one table per phase, one row per case: ``` Case Metric Baseline Candidate Change short decode 235.4 (222.0-266.3) 241.8 (238.1-249.0) +2.7% prompt-4k prompt 3520.6 (3493.5-…) 3641.2 (3610.0-…) +3.4% prompt-16k ttft 2.99 (2.99-3.04) 2.86 (2.80-2.91) -4.3% ``` with `--output json` returning the same numbers, and `--output markdown` a table that can be pasted into a report. **What it would refuse, loudly.** The serving comparison already has a `workload_match` idea; the standard one needs its own guards, and to me the honest set is: - a different suite or protocol id (`strata-qwen38-thinking-v1` against another) → no comparison, one sentence; - a different model id or quantization → compared only with a warning line above the table, since that is a legitimate "before/after a model change" comparison for a person's own notes; - different hardware (gpu name or count, ram) → warning line, not a refusal: two machines of the same build are a real comparison, just not a benchmark claim; - a cached/absent figure (a `summaries` row missing for a case) → `n/a`, never 0. **What it would not change.** Nothing in the report format, nothing in `strata bench run`, no default; a new reader plus `compare` accepting a second kind of folder. The two "readable error" pull requests (#4326, #4329) stay useful either way — they are the ones a reader on today's release sees. **Validation I can offer.** The two real `standard-v1` folders I reproduced this issue with: same machine, same model (RTX 5090, Q2_0), 2026-10-21 with the card shared (5,784 expert slots) and 2026-10-24 exclusive (19,530 slots) — so the comparison has a known-good answer to check against (decode +55% at 4K, +62% at 16K, TTFT −51%/−40%). Plus unit tests over synthetic reports for the guards. No GPU needed for either. **Size.** One function in `strata_cli/bench_standard.py` (a `compare(baseline, candidate)` over `summaries`), the CLI branch next to the one #4329 adds, and tests. I would keep it in one pull request.
Author
Owner

@XiaoBinGan commented on GitHub (Nov 1, 2026):

The comparison half of this is implemented and ready for review in #4806, now marked ready (no longer a draft). strata bench compare BASELINE CANDIDATE reads two standard-v1 reports and prints the baseline and candidate medians per case and figure with the change in percent; --output markdown renders the same table as Markdown (and --out FILE writes it), --output json returns the same rows. Two serving-suite reports go through the old comparison unchanged; only a mixed pair (one standard, one serving-suite) is refused. A different suite, model, card or engine is a warning line, not a refusal, and a figure one side lacks is n/a, never 0.

Measured on the two real standard-v1 folders this issue was reported with (same RTX 5090, Q2_0 machine: 2026-10-21 with the card shared, 2026-10-24 exclusive): decode +55.1% at 4K, +62.0% at 16K, TTFT -51.3% / -40.1% — the same changes #4313 quoted by hand, now printed by the command. No GPU run was made; the numbers are read from the saved results.json files.

Validation on this Windows checkout (Python 3.11), exact commands and output:

  • python -m pytest tests/terminal/test_bench_standard.py -q -k StandardComparison → 4 passed, 69 deselected. A before/after pair computes the medians and the +50.0% change; a different suite/model/card/engine is named in the warnings; a missing figure is None/n/a, not 0; the Markdown output is a real table.
  • python -m pytest tests/terminal/test_bench_standard.py -q -k compare_reads_two_standard_results → 1 passed, 72 deselected (human table, Markdown table, Markdown file via --out, JSON with 12 rows).
  • whole file: second run 73 passed; the first run had one pre-existing timing-sensitive failure (test_a_request_that_never_finishes_times_out, 1 failed / 72 passed). That test also failed with these three files reset to upstream main (1 failed / 67 passed), and a second main run had 2 failed / 66 passed (...never_finishes_times_out and ...a_round_total_is_null_when_a_counted_request_has_no_token_count) — none of the new cases failed in any run.
  • python tools/minimal_cli_smoke.py --report ... (the CI "Portable monitor client" check) → "passed": true.

The other documented comparison path, tools/strata_bench.py --compare, is untouched here; #4326 gives it the readable message. The scope proposal above still stands — if you would rather keep compare limited to the serving suites, say so and I will drop the PR.

<!-- gh-comment-id:6555613032 --> @XiaoBinGan commented on GitHub (Nov 1, 2026): The comparison half of this is implemented and ready for review in #4806, now marked ready (no longer a draft). `strata bench compare BASELINE CANDIDATE` reads two standard-v1 reports and prints the baseline and candidate medians per case and figure with the change in percent; `--output markdown` renders the same table as Markdown (and `--out FILE` writes it), `--output json` returns the same rows. Two serving-suite reports go through the old comparison unchanged; only a mixed pair (one standard, one serving-suite) is refused. A different suite, model, card or engine is a warning line, not a refusal, and a figure one side lacks is `n/a`, never 0. Measured on the two real standard-v1 folders this issue was reported with (same RTX 5090, Q2_0 machine: 2026-10-21 with the card shared, 2026-10-24 exclusive): decode +55.1% at 4K, +62.0% at 16K, TTFT -51.3% / -40.1% — the same changes #4313 quoted by hand, now printed by the command. No GPU run was made; the numbers are read from the saved `results.json` files. Validation on this Windows checkout (Python 3.11), exact commands and output: - `python -m pytest tests/terminal/test_bench_standard.py -q -k StandardComparison` → 4 passed, 69 deselected. A before/after pair computes the medians and the +50.0% change; a different suite/model/card/engine is named in the warnings; a missing figure is `None`/`n/a`, not 0; the Markdown output is a real table. - `python -m pytest tests/terminal/test_bench_standard.py -q -k compare_reads_two_standard_results` → 1 passed, 72 deselected (human table, Markdown table, Markdown file via `--out`, JSON with 12 rows). - whole file: second run **73 passed**; the first run had one pre-existing timing-sensitive failure (`test_a_request_that_never_finishes_times_out`, 1 failed / 72 passed). That test also failed with these three files reset to upstream `main` (1 failed / 67 passed), and a second `main` run had 2 failed / 66 passed (`...never_finishes_times_out` and `...a_round_total_is_null_when_a_counted_request_has_no_token_count`) — none of the new cases failed in any run. - `python tools/minimal_cli_smoke.py --report ...` (the CI "Portable monitor client" check) → `"passed": true`. The other documented comparison path, `tools/strata_bench.py --compare`, is untouched here; #4326 gives it the readable message. The scope proposal above still stands — if you would rather keep `compare` limited to the serving suites, say so and I will drop the PR.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1911
No description provided.