Skip to content

Commit 0fd4b10

Browse files
authored
Merge pull request #1174 from Mark-Simulacrum/drop-calc-old-sig
Remove calcNewSig parameters
2 parents 2a7370a + 97450be commit 0fd4b10

File tree

3 files changed

+15
-56
lines changed

3 files changed

+15
-56
lines changed

site/src/api.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,10 @@ pub mod comparison {
133133
use std::collections::HashMap;
134134

135135
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
136-
#[allow(non_snake_case)]
137136
pub struct Request {
138137
pub start: Bound,
139138
pub end: Bound,
140139
pub stat: String,
141-
pub calcNewSig: Option<bool>,
142140
}
143141

144142
#[derive(Debug, Clone, Serialize)]
@@ -397,11 +395,9 @@ pub mod triage {
397395
use serde::{Deserialize, Serialize};
398396

399397
#[derive(Debug, Clone, Serialize, Deserialize)]
400-
#[allow(non_snake_case)]
401398
pub struct Request {
402399
pub start: Bound,
403400
pub end: Option<Bound>,
404-
pub calcNewSig: Option<bool>,
405401
}
406402

407403
#[derive(Debug, Clone, Serialize, Deserialize)]

site/src/comparison.rs

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ pub async fn handle_triage(
5151
"instructions:u".to_owned(),
5252
ctxt,
5353
&master_commits,
54-
body.calcNewSig.unwrap_or(true),
5554
)
5655
.await
5756
.map_err(|e| format!("error comparing commits: {}", e))?
@@ -100,17 +99,11 @@ pub async fn handle_compare(
10099
.await
101100
.map_err(|e| format!("error retrieving master commit list: {}", e))?;
102101
let end = body.end;
103-
let comparison = compare_given_commits(
104-
body.start,
105-
end.clone(),
106-
body.stat,
107-
ctxt,
108-
&master_commits,
109-
body.calcNewSig.unwrap_or(true),
110-
)
111-
.await
112-
.map_err(|e| format!("error comparing commits: {}", e))?
113-
.ok_or_else(|| format!("could not find end commit for bound {:?}", end))?;
102+
let comparison =
103+
compare_given_commits(body.start, end.clone(), body.stat, ctxt, &master_commits)
104+
.await
105+
.map_err(|e| format!("error comparing commits: {}", e))?
106+
.ok_or_else(|| format!("could not find end commit for bound {:?}", end))?;
114107

115108
let conn = ctxt.conn().await;
116109
let prev = comparison.prev(&master_commits);
@@ -441,7 +434,7 @@ pub async fn compare(
441434
ctxt: &SiteCtxt,
442435
) -> Result<Option<Comparison>, BoxedError> {
443436
let master_commits = collector::master_commits().await?;
444-
compare_given_commits(start, end, stat, ctxt, &master_commits, true).await
437+
compare_given_commits(start, end, stat, ctxt, &master_commits).await
445438
}
446439

447440
/// Compare two bounds on a given stat
@@ -451,7 +444,6 @@ async fn compare_given_commits(
451444
stat: String,
452445
ctxt: &SiteCtxt,
453446
master_commits: &[collector::MasterCommit],
454-
calc_new_sig: bool,
455447
) -> Result<Option<Comparison>, BoxedError> {
456448
let idx = ctxt.index.load();
457449
let a = ctxt
@@ -490,7 +482,6 @@ async fn compare_given_commits(
490482
scenario: test_case.2,
491483
variance: variances.data.get(&test_case).cloned(),
492484
results: (a, b),
493-
calc_new_sig,
494485
})
495486
})
496487
.collect();
@@ -865,17 +856,10 @@ impl BenchmarkVariance {
865856
}
866857

867858
/// Whether we can trust this benchmark or not
868-
fn is_dodgy(&self, calc_new_sig: bool) -> bool {
869-
if !calc_new_sig {
870-
matches!(
871-
self.description,
872-
BenchmarkVarianceDescription::Noisy | BenchmarkVarianceDescription::HighlyVariable
873-
)
874-
} else {
875-
// If changes are judged significant only exceeding 0.2%, then the
876-
// benchmark as a whole is dodgy.
877-
self.significance_threshold() * 100.0 > 0.2
878-
}
859+
fn is_dodgy(&self) -> bool {
860+
// If changes are judged significant only exceeding 0.2%, then the
861+
// benchmark as a whole is dodgy.
862+
self.significance_threshold() * 100.0 > 0.2
879863
}
880864
}
881865

@@ -930,18 +914,13 @@ pub struct TestResultComparison {
930914
scenario: Scenario,
931915
variance: Option<BenchmarkVariance>,
932916
results: (f64, f64),
933-
calc_new_sig: bool,
934917
}
935918

936919
impl TestResultComparison {
937920
/// The amount of relative change considered significant when
938921
/// we cannot determine from historical data
939922
const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD: f64 = 0.002;
940923

941-
/// The amount of relative change considered significant when
942-
/// the test case is dodgy
943-
const SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD_DODGY: f64 = 0.008;
944-
945924
fn is_regression(&self) -> bool {
946925
let (a, b) = self.results;
947926
b > a
@@ -958,18 +937,10 @@ impl TestResultComparison {
958937

959938
/// Magnitude of change considered significant
960939
fn significance_threshold(&self) -> f64 {
961-
if !self.calc_new_sig {
962-
if self.is_dodgy() {
963-
Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD_DODGY
964-
} else {
965-
Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD
966-
}
967-
} else {
968-
self.variance
969-
.as_ref()
970-
.map(|v| v.significance_threshold())
971-
.unwrap_or(Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD)
972-
}
940+
self.variance
941+
.as_ref()
942+
.map(|v| v.significance_threshold())
943+
.unwrap_or(Self::SIGNIFICANT_RELATIVE_CHANGE_THRESHOLD)
973944
}
974945

975946
/// This is a numeric magnitude of a particular change.
@@ -994,9 +965,6 @@ impl TestResultComparison {
994965
} else {
995966
Magnitude::VeryLarge
996967
};
997-
if !self.calc_new_sig {
998-
return over_threshold;
999-
}
1000968
let change_magnitude = if change < 0.002 {
1001969
Magnitude::VerySmall
1002970
} else if change < 0.01 {
@@ -1033,7 +1001,7 @@ impl TestResultComparison {
10331001
fn is_dodgy(&self) -> bool {
10341002
self.variance
10351003
.as_ref()
1036-
.map(|v| v.is_dodgy(self.calc_new_sig))
1004+
.map(|v| v.is_dodgy())
10371005
.unwrap_or(false)
10381006
}
10391007

site/static/compare.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -813,13 +813,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
813813
let values = Object.assign({}, {
814814
start: "",
815815
end: "",
816-
calcNewSig: true,
817816
stat: "instructions:u",
818817
}, state);
819-
// Make sure we pass a boolean.
820-
if (typeof values.calcNewSig === "string") {
821-
values.calcNewSig = values.calcNewSig === "true";
822-
}
823818
makeRequest("/get", values).then(function (data) {
824819
app.data = data;
825820
}).finally(function () {

0 commit comments

Comments
 (0)