From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 40AF71F8C8 for ; Fri, 8 Oct 2021 04:17:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbhJHETT (ORCPT ); Fri, 8 Oct 2021 00:19:19 -0400 Received: from cloud.peff.net ([104.130.231.41]:35574 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbhJHETS (ORCPT ); Fri, 8 Oct 2021 00:19:18 -0400 Received: (qmail 2744 invoked by uid 109); 8 Oct 2021 04:17:23 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 08 Oct 2021 04:17:23 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 30601 invoked by uid 111); 8 Oct 2021 04:17:23 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 08 Oct 2021 00:17:23 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 8 Oct 2021 00:17:22 -0400 From: Jeff King To: =?utf-8?B?UmVuw6k=?= Scharfe Cc: Junio C Hamano , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Git List Subject: Re: [PATCH 10/9 v2] test-mergesort: use repeatable random numbers Message-ID: References: <943b1e01-465e-5def-a766-0adf667690de@web.de> <522fba5e-1048-3377-45c1-7107b55dc6e1@web.de> <87o887q0s9.fsf@evledraar.gmail.com> <850aa059-61d9-0eba-5809-e0c27a19dfb4@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Oct 08, 2021 at 06:04:42AM +0200, René Scharfe wrote: > Use MINSTD to generate pseudo-random numbers consistently instead of > using rand(3), whose output can vary from system to system, and reset > its seed before filling in the test values. This gives repeatable > results across versions and systems, which simplifies sharing and > comparing of results between developers. Nice. As a bonus, I noticed that Coverity complains about the use of rand() as a security red-flag (even though of course we don't care about its quality here). This should get rid of it by hiding the same thing in a custom implementation. ;) We have a similar LCG in t/helper/test-genrandom.c, but I don't think there's any reason this needs to be factored into a shared one. And in particular, I'd be loathe to change the genrandom one, as it may create small bugs in the test suite (cases where we rely on hashes of the data having particular attributes). -Peff