mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2885] [CLOSED] [Benchmark] tools: a --compare path that is not a bench report is a message, not a traceback #4313
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4313
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2885
Author: @ctr-137
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:bench-compare-bad-path📝 Commits (1)
6def00ftools: a --compare path that is not a bench report is a message, not a traceback📊 Changes
2 files changed (+111 additions, -4 deletions)
View changed files
📝
tools/strata_bench.py(+39 -4)📝
tools/test_strata_bench.py(+72 -0)📄 Description
--compareand--compare-onlyare documented indocs/COMMUNITY_BENCHMARKS.mdand named in theBENCH.bat/bench.shheaders, and the two flags are easy to swap. Both went throughload_results(), which read the pathand let whatever came out of the read escape. Three ways it went wrong, every one of them ending the run as a
traceback:
A path that is not there - a typo:
A folder that is not a results folder, or a file that is not JSON -
IsADirectoryError/JSONDecodeError,the same way.
A
results.jsonthat is not a bench report. This one needs no typo at all:bench/results/holdsresults.jsonfiles from the other tools intools/as well -ab_engine.pyand theconversation_cache_*ones write a top-level list or a dict ofsummary/runs. Of the 27results.jsoninbench/results/today, none is astrata_bench.pyreport, so--comparebetween two of the folders the repoitself ships reaches
compare_table()and dies there.Where I changed it
load_results()raisesValueErrorcarrying the path and what is wrong with it, and the two callers print thatinstead of letting it out:
--compare-onlyreads both folders before it starts anything, so it reports and exits 2, the way the benchreports its other bad input.
--compareis read after the report is written, so it notes that only the comparison was lost rather thanundoing a finished run.
The report check is structural - a dict with a dict
machineand a dictresultsholdingchat/prompts/agent/clients, which is what the tables read - rather than a schema number, so it does not turn a futureschema into a new failure.
test_compareloads a report the writer really produced, so the check cannot quietlybecome too strict without a test going red.
This is the second half of the note at the end of #2792. The first half of that note - a started server left
behind - no longer applies on
main:main()setsstartedimmediately afterstart_server()and itsfinallystops the server on any exception. I checked that rather than assumed it, so I did not touch it.
What I left alone
project_version()still catches onlyOSError, so aCMakeLists.txtthat cannot be read for any other reasonstill reaches the top of
main()as a traceback. Its neighbourfind_configs()catches(OSError, ValueError),so that guard looks like an oversight - but #2879 already fixes the one case that actually bit anyone, and widening
it is a separate change.
How I checked
Six tests in
tools/test_strata_bench.py, no GPU or server needed: each way a path is wrong (including aresults.jsonshaped like the other tools'), that a real results folder still loads, both call sites, and that thecomparison of a finished run is only noted rather than fatal.
Five of the six fail on
maintoday - four with the rawFileNotFoundError, one withValueError not raisedforthe other tools' reports. With this, the 23 tests in the file pass (
python -m unittest tools.test_strata_bench).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.