git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] bisect: loosen halfway() check for a large number of commits

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Oct 25, 2020, 18:01 UTC
Message-ID
<20201025180136.GF24813@szeder.dev>
In-Reply-To
<CAP8UFD30NZREjE+_WHKyAhkHAi1TjHQo7iXd9xkvHj9stjT=9A@mail.gmail.com>
On Sat, Oct 24, 2020 at 09:41:27AM +0200, Christian Couder wrote:
Show 33 quoted lines
> On Thu, Oct 22, 2020 at 8:20 PM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > SZEDER Gábor <szeder.dev@gmail.com> writes:
> >
> > > However, when we have thousands of commits it's not all that important
> > > to find the _exact_ halfway point, a few commits more or less doesn't
> > > make any real difference for the bisection.
> >
> > Cute idea.
> 
> I like the idea too.
> 
> > > So I ran some tests to see how often that happens: picked random good
> > > and bad starting revisions at least 50k commits apart and a random
> > > first bad commit in between in git.git, and used 'git bisect run git
> > > merge-base --is-ancestor HEAD $first_bad_commit' to check the number
> > > of necessary bisection steps.  After repeating all this 1000 times
> > > both with and without this patch I found that:
> > >
> > >   - 146 cases needed one more bisection step than before, 149 cases
> > >     needed one less step, while in the remaining 705 cases the number
> > >     of steps didn't change.  So the number of bisection steps does
> > >     indeed change in a non-negligible number of cases, but it seems
> > >     that the average number of steps doesn't change in the long run.
> >
> > It somehow is a bit surprising that there are cases that need fewer
> > steps, but I guess that is how rounding-error cuts both ways?
> 
> When there are 50k commits span between the initial good and bad, I
> don't expect to see any statistically significant result by trying it
> 1k times only. My guess is that you might start seeing something
> significant only when the number of tries is a multiple of the span
> between the initial good and bad.

Well, perhaps... but statistically relevant or not, running those 1000 tests I reported about took over 6.5 hours, so that's all you'll get from me :)

Btw, just for curiosity, running just _one_ similar test in linux.git with the good-bad range containing ~830k commits took ~65 minutes, and the runtime of 'git bisect start' went from ~38mins to ~12.

Previous: Christian CouderNext: SZEDER Gábor
Message 5 of 7 in “bisect: loosen halfway() check for a large number of commits”
  1. bisect: loosen halfway() check for a large number of commitsSZEDER Gábor, Oct 22, 2020
  2. SZEDER GáborOct 22, 2020
  3. Junio C HamanoOct 22, 2020
  4. Christian CouderOct 24, 2020
  5. SZEDER GáborOct 25, 2020
  6. bisect: loosen halfway() check for a large number of commitsSZEDER Gábor, Nov 12, 2020
  7. Junio C HamanoNov 12, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.