Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uweyi-005yjF-I0 for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Sep 2025 10:56:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uweyg-0072nU-Rg for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Sep 2025 10:56:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uweyg-0072nL-9q for pgsql-hackers@lists.postgresql.org; Thu, 11 Sep 2025 10:56:34 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uweyb-000AyE-1u for pgsql-hackers@lists.postgresql.org; Thu, 11 Sep 2025 10:56:34 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id D278A1D000A9; Thu, 11 Sep 2025 06:56:27 -0400 (EDT) Received: from phl-imap-18 ([10.202.2.89]) by phl-compute-02.internal (MEProxy); Thu, 11 Sep 2025 06:56:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1757588187; x=1757674587; bh=/YwYu5z76z6Off/aWUd5wlJr/lpd/XWPBmcePbcNtsA=; b= hdnWetb95stxjP/F+Aod7brocvWUX2mhgsG8kUBuNGDwzCJeMPpEFTPQlkUfR21x t0SfLba91Wg4KTlXpkftMGqAjuEGgNDdzmY6f6N5DIj9jhYi39QkjSWJmkRJX3jF 5DeTHn3kjKXx23YmOqOQZ4sH+M04VGbu7eLotvhBHmgbUsgQPU1S9MDYNxGm8ZDV IiMOlDtaCnke9C+8gTZ0NV0wWcd+d6DuKMaemdxZYt/okX06vDfkqO4sAHmW99Qt 1UMw9RjSytZQEcYJrE2sPbkRLNz3cPDAhPxtst4BJt6IAuve/nKTMRaDBQUfh4pR QQsvMUc2SIL5jvQfTJmTzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1757588187; x= 1757674587; bh=/YwYu5z76z6Off/aWUd5wlJr/lpd/XWPBmcePbcNtsA=; b=W wQJ1ESSGkyHT9uCPg/eliuqnNRgFRO5HgqJUV5NO1NCj6RVZLZLNMFEgohfVOy+k muGT4XDW/Vi3HKNBuq75jmr5DzEgLNu824W/bb+19evMkWuzQt7/Nq1mFVJwSo2q LaGM4Ux9AUpT+LHGfGuMjRslZ4ZBsb+pYY1IkAcI5dMB36284UAPrQvFWKQV/ECr Se+Bi0o4FjWBniakoWjkKgKZlpsqihpK03vzTM37Bl8irHOVDTC/LaGFEVJ2SWZN 6SX93ITLCUNjt4Ztw1r7iNONvtQb+iPHHFIOjA1qILoMjNHemviuBZ+Zd7UxB3EB bG6lpSCGuNKKRfjjmSErA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheelkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfirhgvghcu uehurhgufdcuoehgrhgvghessghurhgurdhmvgeqnecuggftrfgrthhtvghrnhepudefvd etgeeiuddvleejfedutddvteetgffgieffudeifeejffefleegudegvdehnecuffhomhgr ihhnpegrmhgriihonhdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehgrhgvghessghurhgurdhmvgdpnhgspghrtghpthhtohepfedp mhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepnhgrthhhrghnuggsohhsshgrrhhtse hgmhgrihhlrdgtohhmpdhrtghpthhtohepshgrfigruggrrdhmshhhkhesghhmrghilhdr tghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsth hgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 576BC15C008C; Thu, 11 Sep 2025 06:56:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: A5CwicshU8vJ Date: Thu, 11 Sep 2025 06:56:07 -0400 From: "Greg Burd" To: "Masahiko Sawada" Cc: "Nathan Bossart" , "PostgreSQL Hackers" Message-Id: <0978d5ba-e015-4889-a8b7-7a2891664492@app.fastmail.com> In-Reply-To: References: <7BD1ABDB-B03A-464A-9BA9-A73B55AD8A1F@getmailspring.com> <02DB5E92-1E94-4617-AC11-836486F63BD5@burd.me> <9E1E0BA4-952C-412A-884A-6E700F26B0CA@burd.me> Subject: Re: [PATCH] Add tests for Bitmapset Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 11, 2025, at 2:48 AM, Masahiko Sawada wrote: > On Mon, Sep 8, 2025 at 11:21=E2=80=AFAM Burd, Greg wrot= e: >> >> >> > On Sep 5, 2025, at 2:43=E2=80=AFPM, Nathan Bossart wrote: >> > >> > On Fri, Sep 05, 2025 at 10:48:21AM -0400, Burd, Greg wrote: >> >> I looked at both radix tree and binary heap and how they use rando= m sets when >> >> testing. Binary heap uses it to create different random sets of n= umbers to >> >> use across multiple tests while radix tree has a single function t= hat focuses >> >> on randomized data. I decided not to add randomization into the t= ests of >> >> Bitmapset simply because I like avoiding non-deterministic behavio= r. But in >> >> tests I guess that can be helpful finding future unknown corner ca= ses. I'm >> >> on the fence as to the value, your call. :) >> > >> > I'm not too concerned about it. We've lived without a dedicated te= st suite >> > for Bitmapset for a very long time, so any amount of test coverage = is an >> > improvement. Like you said, adding some randomization might be hel= pful for >> > finding weird bugs we wouldn't have thought to test. And, given th= e many, >> > many machines that run the tests, IMHO it'd only help build even mo= re >> > confidence in the code. If my suggestion inspires you to update th= e patch, >> > great, but I'm fine with proceeding with what you already wrote, to= o. >> >> Nathan, thanks for considering the patch. Honestly, I'm fine with it= as is. >> We can revisit later if needed. This does what I'd intended, test an= d document >> in code the API and implementation making future changes to that more >> transparent. > > I appreciate your work on this. While I agree that adding more tests > to bitmapset.c is a good idea, I'm concerned about the minimal > improvement in test coverage despite the addition of new test cases > (only three lines of code are newly covered). Apart from adding some > randomness to the tests we've discussed, given that we're implementing > a dedicated test module for bitmapset.c, I would expect to see a more > increase in test coverage. Good point and thanks for taking the time to reply. The only thing it i= dentified was a small issue fixed in b463288 so I'd not expect coverage to increas= e much. I'll take a stab at adding some randomness to the tests and check the de= lta in coverage. Thanks for the nudge. :) > > Regards, > > --=20 > Masahiko Sawada > Amazon Web Services: https://aws.amazon.com Just for reference I started this not to increase coverage, which is a g= ood goal just not the one I had. I was reviewing the API and considering so= me changes based on other work I've done. Now that I see how deeply baked = in this code is I think that's unlikely. Maybe something else distinct for bitmaps over 64-bit space at some point will be useful. I wrote this co= de just to capture the API in test form. best, -greg