All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Jeff King'" <peff@peff.net>
Cc: "'Junio C Hamano'" <gitster@pobox.com>, <git@vger.kernel.org>,
	<git-packagers@googlegroups.com>
Subject: RE: [ANNOUNCE] Git v2.23.0-rc0 - Initial test failures on NonStop
Date: Tue, 30 Jul 2019 16:25:56 -0400	[thread overview]
Message-ID: <04b201d54715$0180a0f0$0481e2d0$@nexbridge.com> (raw)
In-Reply-To: <20190730194515.GA1088@sigill.intra.peff.net>

On July 30, 2019 3:45 PM, Jeff King wrote:
> To: Randall S. Becker <rsbecker@nexbridge.com>
> Cc: 'Junio C Hamano' <gitster@pobox.com>; git@vger.kernel.org; git-
> packagers@googlegroups.com
> Subject: Re: [ANNOUNCE] Git v2.23.0-rc0 - Initial test failures on NonStop
> 
> On Tue, Jul 30, 2019 at 01:08:37PM -0400, Randall S. Becker wrote:
> 
> > t0016: oidmap
> >
> > Subtest 6 had an ordering issue. We do not know whether the problem is
> the code or the test result not keeping up with the code changes.
> > --- expect      2019-07-30 16:56:36 +0000
> > +++ actual      2019-07-30 16:56:36 +0000
> > @@ -1,6 +1,6 @@
> >  NULL
> >  NULL
> >  NULL
> > +7c7cd714e262561f73f3079dfca4e8724682ac21 3
> >  139b20d8e6c5b496de61f033f642d0e3dbff528d 2
> >  d79ce1670bdcb76e6d1da2ae095e890ccb326ae9 1
> > -7c7cd714e262561f73f3079dfca4e8724682ac21 3
> 
> This one is very curious. It's iterating a hash, which _seems_ like it would
> produce non-deterministic output. But neither this test nor the hashmap test
> it is based on sorts the output, and they pass consistently for me. I assume
> that's because while hash ordering is not guaranteed, it happens to be the
> same as long the pattern of inserts is the same (with our implementation,
> which does not do any hash randomization).
> 
> But I am scratching my head as to what could be different on your platform
> that would cause a different ordering (especially when the hashmap test this
> is based on doesn't get one!).
> 
> I guess in some sense it may not be worth tracking down, and we should just
> sort the output of a hash iteration unconditionally when comparing it to
> expected output.

Definitely a head scratcher. Is it possible that the bucket() function, which uses

	key->hash & (map->tablesize - 1);

might better use

	key->hash % (map->tablesize - 1);

I have not seen a bucket computation done this way before so that surprised me, not that it should make a difference on hash-determinism. The only thing that might is an uninitialized stack variable, which on this platform's C compiler will not initialize. Global statics are always 0 unless otherwise specified, but I'm not sure about stack-local (but there's nothing wrong I can see in hashmap.c on those points.

Sorting the output seems like a safe option, providing that the hash is itself demonstrably solid otherwise.

Cheers,
Randall


  reply	other threads:[~2019-07-30 20:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 17:08 [ANNOUNCE] Git v2.23.0-rc0 - Initial test failures on NonStop Randall S. Becker
2019-07-30 17:31 ` Junio C Hamano
2019-07-30 18:09   ` Matheus Tavares Bernardino
2019-07-30 18:10   ` Randall S. Becker
2019-07-30 18:35     ` Junio C Hamano
2019-07-30 19:45 ` Jeff King
2019-07-30 20:25   ` Randall S. Becker [this message]
2019-07-30 19:49 ` Todd Zullinger
2019-07-30 20:02   ` Jeff King
2019-07-30 20:39     ` Junio C Hamano
2019-07-30 20:56     ` SZEDER Gábor
2019-07-31  0:59       ` Jeff King
2019-07-31  1:23         ` Jeff King
2019-07-31  1:27           ` Jeff King
2019-07-31  1:59           ` Todd Zullinger
2019-07-31  3:27             ` Jeff King
2019-07-31  3:53               ` Jeff King
2019-07-31 17:17                 ` Junio C Hamano
2019-07-31 21:22                   ` non-cryptographic hash algorithms in git Jeff King
2019-07-31  4:06               ` [ANNOUNCE] Git v2.23.0-rc0 - Initial test failures on NonStop René Scharfe
2019-07-31  4:30                 ` Jeff King
2019-07-31  6:04               ` Todd Zullinger
2019-07-31 16:57         ` Junio C Hamano
2019-07-30 20:27   ` Randall S. Becker

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='04b201d54715$0180a0f0$0481e2d0$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git-packagers@googlegroups.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.