From: Jon Seymour <jon.seymour@gmail.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git-rev-list: "--bisect" flag
Date: Mon, 20 Jun 2005 05:55:19 +1000 [thread overview]
Message-ID: <2cfc4032050619125537dee354@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0506190951330.2268@ppc970.osdl.org>
On 6/20/05, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> On Mon, 20 Jun 2005, Jon Seymour wrote:
> >
> > Would I be correct in stating that an intuitive reason why your
> > algorithm is better than selecting the linear middle is the following:
> >
> > If you concentrate on testing merges, rather than non-merges, the
> > chances are you are going to eliminate N-times as many possible good
> > commits as if you pick a random commit, where N is the average fan-out
> > of the commit graph.
>
> No. You really shouldn't concentrate on merges either.
>
> The thing is, you do _not_ want to test as many commits as possible, or as
> few commits as possible.
>
> This is _not_ a "try to eliminate as many commits as possible" problem.
> It's really one of trying to eliminate _half_ the commits. Not more, not
> less.
>
Yep, ok, so the node you are looking for is one that can reach as
close to half of the rest of the graph as possible - that's what you
mean by half-way reachability. If the graph was N nodes deep (no
fan-out) that would be the literal middle. If it was N nodes wide
(e.g. fanout N), there is no good node and you basically have to test
everything since one test doesn't imply anything about the other N-1
nodes.
A typical commit graph is worse than O(log2 N) by a factor that is
determined by some measure of the parallel branching in the graph.
>
> The reason my algorithm is so horrid (O(3)) is that you can't even cache
> the dang thing sanely: you can't optimize if by remembering how many
> interesting commits are reachable from one commit, and then doing "this
> commit reaches commits X and Y, so I can reach X.count + Y.count commits
> from it". That's just not true, because often (basically always) there is
> lots of common commits in X.count and Y.count..
I presume you mean O(N^3)?
Will you accept a patch that can reduce the worst case cost to some
lower order? I have a hunch (conceivably wrong, of course) that it can
be done in O(N).
> > This compares with my naive literal middle algorithm (measurements
> > only for the first 619 commits):
> >
> > average(21), median(16), stdev(10.6), max(49), min(8).
>
> Yes. I really don't believe you can do better than 12, unless you start
> depending on knowledge of the distribution of bugs.
>
Agreed.
jon.
next prev parent reply other threads:[~2005-06-19 19:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-18 6:31 git-rev-list: "--bisect" flag Linus Torvalds
2005-06-19 0:18 ` Jon Seymour
2005-06-19 3:38 ` Jan Harkes
2005-06-19 4:07 ` Jon Seymour
2005-06-19 3:43 ` Linus Torvalds
2005-06-19 5:03 ` Linus Torvalds
2005-06-19 5:05 ` David Lang
2005-06-19 5:30 ` Linus Torvalds
2005-06-19 10:15 ` Jon Seymour
2005-06-19 14:41 ` Jon Seymour
2005-06-19 17:20 ` Linus Torvalds
2005-06-19 17:36 ` Ingo Molnar
2005-06-19 19:01 ` Linus Torvalds
2005-06-19 19:55 ` Jon Seymour [this message]
2005-06-20 3:09 ` Linus Torvalds
2005-06-20 3:27 ` Jon Seymour
2005-06-20 3:30 ` Jon Seymour
2005-06-20 10:29 ` Jon Seymour
2005-06-20 14:37 ` Jon Seymour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2cfc4032050619125537dee354@mail.gmail.com \
--to=jon.seymour@gmail.com \
--cc=git@vger.kernel.org \
--cc=jon@blackcubes.dyndns.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.