Conversation
|
|
| Branch | teofr/upgrade-bencher |
| Testbed | ci |
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
🚨 3 Alerts
🐰 View full continuous benchmarking report in Bencher
|
| Branch | teofr/upgrade-bencher |
| Testbed | ci |
🐰 View full continuous benchmarking report in Bencher
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
1d28cb6 to
607886d
Compare
|
| Branch | teofr/upgrade-bencher |
| Testbed | ci |
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
🚨 2 Alerts
🐰 View full continuous benchmarking report in Bencher607886d to
a931fdf
Compare
There was a problem hiding this comment.
Pull request overview
Upgrades the Bencher CLI used by the infra CLI and re-enables PR commenting for cargo benchmarks, while adding a new option to limit threshold sampling for PR benchmark comparisons.
Changes:
- Bump
bencher_clidependency to the v0.6.1 commit. - Update
run_benchto always post GitHub Actions PR comments for--pr-benchmark, and addthreshold_max_sample_size. - Grant required GitHub Actions permissions and pass
GITHUB_TOKENin cargo benchmark workflows.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/infra/cli/src/toolchains/bencher/mod.rs |
Adjusts bencher invocation for PR benchmarks (always uses --github-actions) and adds --threshold-max-sample-size plumbing. |
crates/infra/cli/src/commands/perf/npm/mod.rs |
Updates run_bench call site for the new function signature. |
crates/infra/cli/src/commands/perf/cargo/mod.rs |
Updates cargo perf benchmark invocation to set threshold_max_sample_size. |
Cargo.toml |
Pins bencher_cli to a newer upstream revision (v0.6.1). |
.github/workflows/benchmark_cargo_slang.yml |
Adds PR write permission and passes GITHUB_TOKEN for PR commenting. |
.github/workflows/benchmark_cargo_cmp.yml |
Adds PR write permission and passes GITHUB_TOKEN for PR commenting. |
de39bef to
835f1ee
Compare
835f1ee to
f629797
Compare
nebasuke
left a comment
There was a problem hiding this comment.
One question, one possible suggestion, neither blocking. Thanks Teo!
| .expect("Threshold upper boundary must be set for --pr-benchmark"), | ||
| ) | ||
| // Since we have to show it for all or for none of the thresholds, we just always | ||
| // show it and default to "_" |
There was a problem hiding this comment.
Is this a Bencher feature? How does Bencher handle _?
There was a problem hiding this comment.
It ignores the given option for that feature. Bencher requires that, when specifying multiple thresholds, they all use the same options (I guess for easy disambiguation)
It is possible to create multiple Thresholds with the same bencher run invocation. When specifying multiple Thresholds, all of the same options must be used for each Threshold. To ignore an option for a specific Threshold, use an underscore (_).
From: https://bencher.dev/docs/explanation/thresholds/#multiple-thresholds
| "--threshold-upper-boundary", | ||
| upper_boundary | ||
| .as_ref() | ||
| .expect("Threshold upper boundary must be set for --pr-benchmark"), |
There was a problem hiding this comment.
I found this a bit surprising, but I understand you're doing this for the builder pattern.
One option after having some discussions with Claude (take this with a grain of salt given my current Rust knowledge) is to have required params in the constructor, with only max_sample_size optional, and using a closure to do the measure name setting you want.
pub(crate) struct BencherThreshold {
pub measure: String,
pub upper_boundary: String,
pub max_sample_size: Option<String>,
}
impl BencherThreshold {
pub fn new(measure: &str, upper_boundary: &str) -> Self {
Self { measure: measure.into(), upper_boundary: upper_boundary.into(), max_sample_size: None }
}
pub fn with_max_sample_size(mut self, v: &str) -> Self { self.max_sample_size = Some(v.into()); self }
}
Call site uses a closure to keep the "base config" pattern:
let threshold = |measure| BencherThreshold::new(measure, "0.01").with_max_sample_size("2");
&[threshold("estimated-cycles"), threshold("instructions"), ...]
And the npm site stays a one-liner: BencherThreshold::new("duration", "0.10").
There was a problem hiding this comment.
That's a fair point, I think we may need a more flexible approach when we start fine tuning the thresholds, but for now this is more than enough. Thanks!
f629797 to
9bb37c8
Compare
9bb37c8 to
772b0a6
Compare
772b0a6 to
eb39719
Compare
|
| Branch | teofr/upgrade-bencher |
| Testbed | ci |
🐰 View full continuous benchmarking report in Bencher
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
BencherThresholdstruct to better represent thresholdsFixes #1586
Test
ci:perflabel and check comment