Skip to contentSkip to conversation

Bisector fixes

PATCH In review Ian Jackson 2 participants 13 messages May 20, 2015

lore
Share & tools
lore
#0 lore raw

cover Bisector fixes

This series seems to me to fix some problems with the bisector that Ian C observed and which he and I have discussed in person.

I have done various ad-hoc tests in the Cambridge instance, but the bisector itself is not tested by the osstest self-push-gate, and it is of course difficult to foresee all the implications. So after this goes in we should keep an eye on the progress of the bisector in the various branches.

#1 lore raw

PATCH 1/6 cs-bisection-step: Refer to jobs we create just by job name

When we make a fresh build job, rather than referring to an existing job in another flight, pass to the rest of the machinery only the job name, not <flight>.<job>.

This means that the generated flight refers to its own jobs without specifying the flight name. This allows the flail detector to operate
properly: without this, we might have repeated attempts to test and build the same thing, but they would look identical because their self-referential runvars would be different due to their different flight numbers.

---
 cs-bisection-step |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cs-bisection-step +1 -1
index 99dbcf2..e8b95ca 100755
@@ -1152,7 +1152,7 @@ END
                                  )
 END
 
-        $usejob= "$popflight.$popjob";
+        $usejob= $popjob;
         $jobs_created{$popjob}= $usejob;
     }
 
Signature · 1 line
1.7.10.4
Acked-by on v1 1/6
#2 lore raw

Re: [OSSTEST PATCH 1/6] cs-bisection-step: Refer to jobs we create just by job name

Quoted 4 lines · Ian Jackson

When we make a fresh build job, rather than referring to an existing job in another flight, pass to the rest of the machinery only the job name, not <flight>.<job>.

Quoted 8 lines

This means that the generated flight refers to its own jobs without specifying the flight name. This allows the flail detector to operate
properly: without this, we might have repeated attempts to test and build the same thing, but they would look identical because their self-referential runvars would be different due to their different flight numbers.

#3 lore raw

PATCH 2/6 cs-bisection-step: Clarify and correct flailing message

In reply to Ian Jackson

There are many other possible reasons for this, besides a bug in the build version machinery.

---
 cs-bisection-step |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
cs-bisection-step +2 -3
index e8b95ca..4891e93 100755
@@ -1275,10 +1275,9 @@ END
 	print DEBUG "nequalflights=$nequalflights\n$explanation\n";
 	if ($nequalflights > $maxequalflights) {
 	    summary_report(<<END, <<END, 32);
-Flailing - >$nequalflights identical flights to no useful effect
+Flailing - >=$nequalflights identical flights to no useful effect
 END
-Bisector is flailing: >$nequalflights identical flights generated.
-Perhaps machinery for building correct version is broken ?
+Bisector is flailing: >=$nequalflights identical flights generated.
 Problem occurs when attempting to test this revision:
  $choose->{Rtuple}
 
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 3/6 cs-bisection-step: Flail detection: look only at our blessing

In reply to Ian Jackson

When looking for identical previously flights, consider only ones which have the same blessing as our prospective flight will have.

There are good reasons why apparently identical flights might appear with other in-scope blessings: notably, a single-test-job main branch might produce many failures from its push gate, which would all have the main branch blessing (rather than the bisector's blessing).

---
 cs-bisection-step |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
cs-bisection-step +5 -2
index 4891e93..3035912 100755
@@ -1230,7 +1230,10 @@ END
     # one side is NULL (runvar was missing) it still counts.
     my $equalflightsqt = <<END;
         SELECT flight, blessing, started FROM flights
-	    WHERE branch=? AND $blessingscond $maxflight_cond
+	    WHERE branch=?  $maxflight_cond
+              AND blessing = (
+		SELECT intended FROM flights WHERE flight = ?
+                )
 	      AND NOT EXISTS (
 		SELECT 1
 		  FROM $runvarsqt1 r1 FULL OUTER JOIN
@@ -1260,7 +1263,7 @@ END
         $minflight //= 0;
 	print DEBUG "minflight=$minflight\n";
 
-	$equalflightsq->execute($branch, $popflight, $minflight);
+	$equalflightsq->execute($branch, $popflight, $popflight, $minflight);
 	my $nequalflights = 0;
 	my $explanation = '';
 	while (my $identical = $equalflightsq->fetchrow_hashref()) {
Signature · 1 line
1.7.10.4
Acked-by on v1 3/6
#6 lore raw

Re: [OSSTEST PATCH 3/6] cs-bisection-step: Flail detection: look only at our blessing

Quoted 9 lines · Ian Jackson

When looking for identical previously flights, consider only ones which have the same blessing as our prospective flight will have.

There are good reasons why apparently identical flights might appear with other in-scope blessings: notably, a single-test-job main branch might produce many failures from its push gate, which would all have the main branch blessing (rather than the bisector's blessing).

#7 lore raw

PATCH 4/6 Revert "cs-bisection-step: Abandon repro attempts after a bit"

In reply to Ian Jackson

This safety catch is unnecessary and unhelpful.

It is unnecessary because 489773b4 "Detect flailing" will detect attempts by the bisector to repeatedly run the same flight and hope for different results.

It is unhelpful because it can happen for good reasons that a particular revision has been tested many times. In particular:

- The osstest push gate input tree may have not been advanced for a long time and been failing its push gate.

- The bisector may have (for some reason[1]) restarted with a new baseline, and the temporarally-stripy pass/fail requirement would then require the basis fail to be repro'd, again.

[1] Currently this happens much more often than is desirable. This will be fixed in a moment.

This reverts commit 2676277181599a889657354028b992379aa6142b.

---
 cs-bisection-step |    4 ----
 1 file changed, 4 deletions(-)
cs-bisection-step +0 -4
index 3035912..743a3e5 100755
@@ -769,10 +769,6 @@ sub need_repro ($$$) {
     return 1 if conflicted_warning($n, $what);
 
     my $fl= $n->{Flights} || [];
-
-    return report_conflict($n, $what, 'Too many attempts')
-	if @$fl > 5;
-
     foreach my $f (sort { $a->{Flight} <=> $b->{Flight} } @$fl) {
         next unless $f->{Flight} > $repro_lastflight;
 	if ($f->{Result} ne $st) {
Signature · 1 line
1.7.10.4
Acked-by on v1 4/6
#8 lore raw

Re: [OSSTEST PATCH 4/6] Revert "cs-bisection-step: Abandon repro attempts after a bit"

Quoted 12 lines · Ian Jackson

This safety catch is unnecessary and unhelpful.

It is unnecessary because 489773b4 "Detect flailing" will detect attempts by the bisector to repeatedly run the same flight and hope for different results.

It is unhelpful because it can happen for good reasons that a particular revision has been tested many times. In particular:

- The osstest push gate input tree may have not been advanced for a long time and been failing its push gate.

Quoted 8 lines

- The bisector may have (for some reason[1]) restarted with a new baseline, and the temporarally-stripy pass/fail requirement would then require the basis fail to be repro'd, again.

[1] Currently this happens much more often than is desirable. This will be fixed in a moment.

This reverts commit 2676277181599a889657354028b992379aa6142b.

#9 lore raw

PATCH 5/6 cs-bisection-step: Do not treat repro attempts as flail

In reply to Ian Jackson

The need_repro machinery deliberarely makes attempts to reproduce various results.

This can cause the flail detector to trigger when not intended. In particular, the bisector may have (for some reason[1]) restarted with a new baseline, and the temporarally-stripy pass/fail requirement would then require the basis fail to be repro'd, again.

[1] Currently this happens much more often than is desirable. This will be fixed in a moment.

Fix this by only considering, for the purposes of flail, flights which are no older than the first repro (the basis pass).

---
 cs-bisection-step |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
cs-bisection-step +4 -1
index 743a3e5..da13927 100755
@@ -742,6 +742,7 @@ sub conflicted_warning ($$) {
 }
 
 our $repro_lastflight;
+our $repro_firstflight = 0;
 our $repro_count;
 
 sub need_repro_sequence ($$) {
@@ -780,6 +781,7 @@ sub need_repro ($$$) {
             ($repro_count ? "Repro" : "Result").
             " found: flight $f->{Flight} ($st), for $what\n";
         $repro_lastflight= $f->{Flight};
+        $repro_firstflight ||= $f->{Flight};
         return 0;
     }
     print STDERR "Need to reproduce $what ($st); had $repro_count already.\n";
@@ -1246,12 +1248,13 @@ END
     my $equalflightsq = $dbh_tests->prepare($equalflightsqt);
 
     db_retry($popflight,'constructing', $dbh_tests,[qw(flights)], sub {
-        print STDERR "Checking for flail...\n";
+        print STDERR "Checking for flail (since $repro_firstflight)...\n";
 
 	my ($minflight) = $dbh_tests->selectrow_array(<<END, {}, $branch);
             SELECT flight FROM (
 		SELECT flight FROM flights
 		    WHERE branch=? AND $blessingscond $maxflight_cond
+                       AND flight >= $repro_firstflight
 		    ORDER BY flight DESC
 		    LIMIT 100
             ) last100 ORDER BY FLIGHT ASC LIMIT 1
Signature · 1 line
1.7.10.4
Acked-by on v1 5/6
#10 lore raw

Re: [OSSTEST PATCH 5/6] cs-bisection-step: Do not treat repro attempts as flail

Quoted 8 lines · Ian Jackson

The need_repro machinery deliberarely makes attempts to reproduce various results.

This can cause the flail detector to trigger when not intended. In particular, the bisector may have (for some reason[1]) restarted with a new baseline, and the temporarally-stripy pass/fail requirement would then require the basis fail to be repro'd, again.

Quoted 7 lines

[1] Currently this happens much more often than is desirable. This will be fixed in a moment.

Fix this by only considering, for the purposes of flail, flights which are no older than the first repro (the basis pass).

#11 lore raw

PATCH 6/6 Revert "cs-bisection-step: allow -bisect blessed flights for basis pass"

In reply to Ian Jackson

If the bisector is allowed to consider its own output flights as candidates for the basis pass, then it will (generally) restart with a new basis each time it finds a pass.

This is very slow and wasteful.

There is not much explanation in 01edca47 of the change I am now reverting, but I think I probably created by some semi-manual process a flight to serve as the basis. I now think that my mistake was to bless that flight adhoc-bisect' or some such, rather than adhoc'.

This reverts commit 01edca47be3742a1660b1956c1f06ca934b97352.

---
 cs-bisection-step |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cs-bisection-step +2 -2
index da13927..67a92b7 100755
@@ -320,7 +320,7 @@ END
         SELECT * FROM flights JOIN steps USING (flight)
 	   WHERE job = ?
 	     AND testid = ?
-	     AND $blessingscond
+	     AND blessing = ?
 	     AND status = 'pass'
              AND branch = ?
              AND $flight_is_not_broken
@@ -371,7 +371,7 @@ END
 
         print STDERR "/";
         my ($basisrow,$trybasis);
-        $basisq->execute($job,$testid,$branch);
+        $basisq->execute($job,$testid,$blessings[0],$branch);
         while ($trybasis= $basisq->fetchrow_hashref()) {
             print STDERR " $trybasis->{flight}";
             my $basishosts= relevant_hosts($trybasis->{flight});
Signature · 1 line
1.7.10.4
Acked-by on v1 6/6
#12 lore raw

Re: [OSSTEST PATCH 6/6] Revert "cs-bisection-step: allow -bisect blessed flights for basis pass"

Quoted 6 lines · Ian Jackson

If the bisector is allowed to consider its own output flights as candidates for the basis pass, then it will (generally) restart with a new basis each time it finds a pass.

This is very slow and wasteful.

Quoted 8 lines

There is not much explanation in 01edca47 of the change I am now reverting, but I think I probably created by some semi-manual process a flight to serve as the basis. I now think that my mistake was to bless that flight adhoc-bisect' or some such, rather than adhoc'.

This reverts commit 01edca47be3742a1660b1956c1f06ca934b97352.