runner: compare Criterion SQL-harness benchmarks with critcmp - #13
Merged
Conversation
bench.sh has two benchmark families: dfbench-based suites that write results/*.json (compared via `bench.sh compare_detail`), and Criterion SQL-harness suites (`cargo bench --bench sql`: wide_schema, predicate_eval) that write only target/criterion. The standard runner always used compare_detail, so the SQL-harness suites produced an empty comparison — the result comment showed "Skipping results/HEAD/*.json as results/<branch>/*.json does not exist" and no timings. Route the SQL-harness suites through the same machinery the criterion runner already uses: - run each side with `SQL_CARGO_COMMAND=cargo bench --bench sql -- --save-baseline <RESULTS_NAME>` so Criterion saves a named baseline per side (HEAD / <branch>); - after both sides, copy the baselines into one target/criterion tree (reusing bench_criterion::copy_criterion_baselines) and diff them with `critcmp HEAD <branch>`. dfbench suites are unchanged (still compare_detail). A run that mixes both families gets both sections. `is_criterion_harness` lists the SQL-harness suites and generalizes to future ones. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
adriangb
commented
Jun 9, 2026
Comment on lines
+21
to
+23
| fn is_criterion_harness(bench: &str) -> bool { | ||
| matches!(bench, "wide_schema" | "predicate_eval") | ||
| } |
Owner
Author
There was a problem hiding this comment.
It'd be nice if these weren't hardcoded...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
bench.shhas two benchmark families, and the standard runner only knew how to compare one:results/<name>/*.jsonbench.sh compare_detail✅wide_schema,predicate_eval, run viacargo bench --bench sql)target/criterion/**The standard runner always called
compare_detail, which readsresults/*.json. The SQL-harness suites never write those, so the comparison was empty — the result comment showed:i.e. only resource usage was posted, no per-query timings — confirmed on a real
wide_schemarun.Fix
Route the SQL-harness suites through the same mechanism
bench_criterion.rsalready uses for native Criterion benches:SQL_CARGO_COMMAND=cargo bench --bench sql -- --save-baseline <RESULTS_NAME>so Criterion saves a named baseline per side (HEADfor base, the branch name for the PR). The SQL harness's arg parser usesignore_errors, so--save-baselinepasses through to Criterion.target/criteriontree (reusingbench_criterion::copy_criterion_baselines) and diff them withcritcmp HEAD <branch>.dfbench suites are unchanged (still
compare_detail). A run mixing both families emits both sections.is_criterion_harness()enumerates the SQL-harness suites and generalizes to future ones.No datafusion-side changes and no new dependencies —
critcmpis already in the runner image and used by the criterion path.Testing
cargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo test(135 tests, incl. a newcriterion_harness_classification) all pass. End-to-end verification will come from awide_schemarun once deployed (the suite already runs to completion; this is purely about producing the comparison output).🤖 Generated with Claude Code