author | Christian Couder <chriscool@tuxfamily.org> | |
Sat, 13 Jun 2009 05:21:06 +0000 (07:21 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 13 Jun 2009 17:47:34 +0000 (10:47 -0700) | ||
commit | ebc9529f0358bdb10192fa27bc75f5d4e452ce90 | |
tree | a96512d00de09a2f767544f390cca87ca7844253 | tree | snapshot |
parent | a66037c9755a2beb49bbd915e6f0dd9b1a732925 | commit | diff |
bisect: use a PRNG with a bias when skipping away from untestable commits
Using a PRNG (pseudo random number generator) with a bias should be better
than alternating between 3 fixed ratios.
In repositories with many untestable commits it should prevent alternating
between areas where many commits are untestable. The bias should favor
commits that can give more information, so that the bisection process
should not loose much efficiency.
HPA suggested to use a PRNG and found that the best bias is to raise a
ratio between 0 and 1 given by the PRNG to the power 1.5.
An integer square root function is implemented to avoid including
<math.h> and linking with -lm.
A PRNG function is implemented to get the same number sequence on
different machines as suggested by "man 3 rand".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Using a PRNG (pseudo random number generator) with a bias should be better
than alternating between 3 fixed ratios.
In repositories with many untestable commits it should prevent alternating
between areas where many commits are untestable. The bias should favor
commits that can give more information, so that the bisection process
should not loose much efficiency.
HPA suggested to use a PRNG and found that the best bias is to raise a
ratio between 0 and 1 given by the PRNG to the power 1.5.
An integer square root function is implemented to avoid including
<math.h> and linking with -lm.
A PRNG function is implemented to get the same number sequence on
different machines as suggested by "man 3 rand".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c | diff | blob | history | |
t/t6030-bisect-porcelain.sh | diff | blob | history |