Skip to content

Commit 11bae6c

Browse files
Use new significance algorithm by default
1 parent a3b9c2d commit 11bae6c

File tree

2 files changed

+16
-49
lines changed

2 files changed

+16
-49
lines changed

site/src/comparison.rs

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ pub async fn handle_triage(
4848
"instructions:u".to_owned(),
4949
ctxt,
5050
&master_commits,
51-
body.calcNewSig.unwrap_or(false),
5251
)
5352
.await
5453
.map_err(|e| format!("error comparing commits: {}", e))?
@@ -97,17 +96,11 @@ pub async fn handle_compare(
9796
.await
9897
.map_err(|e| format!("error retrieving master commit list: {}", e))?;
9998
let end = body.end;
100-
let comparison = compare_given_commits(
101-
body.start,
102-
end.clone(),
103-
body.stat,
104-
ctxt,
105-
&master_commits,
106-
body.calcNewSig.unwrap_or(false),
107-
)
108-
.await
109-
.map_err(|e| format!("error comparing commits: {}", e))?
110-
.ok_or_else(|| format!("could not find end commit for bound {:?}", end))?;
99+
let comparison =
100+
compare_given_commits(body.start, end.clone(), body.stat, ctxt, &master_commits)
101+
.await
102+
.map_err(|e| format!("error comparing commits: {}", e))?
103+
.ok_or_else(|| format!("could not find end commit for bound {:?}", end))?;
111104

112105
let conn = ctxt.conn().await;
113106
let prev = comparison.prev(&master_commits);
@@ -353,7 +346,7 @@ pub async fn compare(
353346
ctxt: &SiteCtxt,
354347
) -> Result<Option<Comparison>, BoxedError> {
355348
let master_commits = collector::master_commits().await?;
356-
compare_given_commits(start, end, stat, ctxt, &master_commits, false).await
349+
compare_given_commits(start, end, stat, ctxt, &master_commits).await
357350
}
358351

359352
/// Compare two bounds on a given stat
@@ -363,7 +356,6 @@ async fn compare_given_commits(
363356
stat: String,
364357
ctxt: &SiteCtxt,
365358
master_commits: &[collector::MasterCommit],
366-
calc_new_sig: bool,
367359
) -> Result<Option<Comparison>, BoxedError> {
368360
let a = ctxt
369361
.artifact_id_for_bound(start.clone(), true)
@@ -401,7 +393,6 @@ async fn compare_given_commits(
401393
scenario: test_case.2,
402394
variance: variances.data.get(&test_case).cloned(),
403395
results: (a, b),
404-
calc_new_sig,
405396
})
406397
})
407398
.collect();
@@ -751,17 +742,10 @@ impl BenchmarkVariance {
751742
}
752743

753744
/// Whether we can trust this benchmark or not
754-
fn is_dodgy(&self, calc_new_sig: bool) -> bool {
755-
if !calc_new_sig {
756-
matches!(
757-
self.description,
758-
BenchmarkVarianceDescription::Noisy | BenchmarkVarianceDescription::HighlyVariable
759-
)
760-
} else {
761-
// If changes are judged significant only exceeding 0.2%, then the
762-
// benchmark as a whole is dodgy.
763-
self.significance_threshold() * 100.0 > 0.2
764-
}
745+
fn is_dodgy(&self) -> bool {
746+
// If changes are judged significant only exceeding 0.2%, then the
747+
// benchmark as a whole is dodgy.
748+
self.significance_threshold() * 100.0 > 0.2
765749
}
766750
}
767751

@@ -816,18 +800,13 @@ pub struct TestResultComparison {
816800
scenario: Scenario,
817801
variance: Option<BenchmarkVariance>,
818802
results: (f64, f64),
819-
calc_new_sig: bool,
820803
}
821804

822805
impl TestResultComparison {
823806
/// The amount of relative change considered significant when
824807
/// we cannot determine from historical data
825808
const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD: f64 = 0.002;
826809

827-
/// The amount of relative change considered significant when
828-
/// the test case is dodgy
829-
const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD_DODGY: f64 = 0.008;
830-
831810
fn is_regression(&self) -> bool {
832811
let (a, b) = self.results;
833812
b > a
@@ -843,18 +822,10 @@ impl TestResultComparison {
843822

844823
// Magnitude of change considered significant
845824
fn significance_threshold(&self) -> f64 {
846-
if !self.calc_new_sig {
847-
if self.is_dodgy() {
848-
Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD_DODGY
849-
} else {
850-
Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD
851-
}
852-
} else {
853-
self.variance
854-
.as_ref()
855-
.map(|v| v.significance_threshold())
856-
.unwrap_or(Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD)
857-
}
825+
self.variance
826+
.as_ref()
827+
.map(|v| v.significance_threshold())
828+
.unwrap_or(Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD)
858829
}
859830

860831
/// This is a numeric magnitude of a particular change.
@@ -879,9 +850,6 @@ impl TestResultComparison {
879850
} else {
880851
Magnitude::VeryLarge
881852
};
882-
if !self.calc_new_sig {
883-
return over_threshold;
884-
}
885853
let change_magnitude = if change < 0.002 {
886854
Magnitude::VerySmall
887855
} else if change < 0.01 {
@@ -918,7 +886,7 @@ impl TestResultComparison {
918886
fn is_dodgy(&self) -> bool {
919887
self.variance
920888
.as_ref()
921-
.map(|v| v.is_dodgy(self.calc_new_sig))
889+
.map(|v| v.is_dodgy())
922890
.unwrap_or(false)
923891
}
924892

site/static/compare.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,6 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
827827
end: "",
828828
stat: "instructions:u",
829829
}, state);
830-
values["calcNewSig"] = values.calcNewSig === 'true';
831830
makeRequest("/get", values).then(function (data) {
832831
app.data = data;
833832
});
@@ -849,4 +848,4 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
849848
</script>
850849
</body>
851850

852-
</html>
851+
</html>

0 commit comments

Comments
 (0)