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.96) (envelope-from ) id 1wETLJ-0043SS-0x for pgsql-hackers@arkaria.postgresql.org; Sun, 19 Apr 2026 14:41:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wETLI-00FUzj-0t for pgsql-hackers@arkaria.postgresql.org; Sun, 19 Apr 2026 14:41:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wETLH-00FUzb-2O for pgsql-hackers@lists.postgresql.org; Sun, 19 Apr 2026 14:41:47 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wETLF-00000001mgU-1bzd for pgsql-hackers@lists.postgresql.org; Sun, 19 Apr 2026 14:41:46 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 77859140005A; Sun, 19 Apr 2026 10:41:44 -0400 (EDT) Received: from phl-imap-14 ([10.202.2.87]) by phl-compute-02.internal (MEProxy); Sun, 19 Apr 2026 10:41:44 -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=fm2; t=1776609704; x=1776696104; bh=RDoeymsxLq43DpMnCOXMzMqmJfa9+wclzBep+EnK/Wk=; b= IHYhVo855EUqDTLkbLEUV1Lru1OYLVPtXsBze5/Jfc/IiA0/sSMK6SW8Z8swAI1o p7aIiAMGOmVirXltaYCGqAleONcVzzo8JDEVdW5FQLmpUwE3Up6VzS8hHaVTJSAD OhotSlI9WGM21SmNjuXJet6slyYskFte9PM6rUb8O+NK+qFdEhNp2IL9+Sw4ImY8 llroAyTnEHDaKp8uCId3sQolLbOBOS5b/Tq0kEdz1Pf9IrtVxhF/P5crNBfiUExB MSSmr3lP++UpAH/T2nN41O554C1b2coBBW2RcmAxf9Tdy5MDUehCFtoWU4JMa6Kr vevpjnOP0GoncNdVrO37BA== 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=fm2; t=1776609704; x= 1776696104; bh=RDoeymsxLq43DpMnCOXMzMqmJfa9+wclzBep+EnK/Wk=; b=B RgUYSj3bZV/DvLu2SRh4iS/LO3iPM58GcqSjYjTWzDFsjGkPivacv6d+TY4A3zEU 1xf27Xxw1DFhLMV7XdTCpG+okORWVtKtq3K/Fb28pAxqmhQFVb9fJziSin22ebpM q2XhoEf7hFhwAfSseH4DvVd3GcKT3fgB86Ivwu7MULVm+ulpyF0D60mbuwSOmoin 3w73vDxVMPMNUMomYcLMUlit8HKk3NTyEcWEG48jlfE4R47ZWQimqLXcEgQQLsYn ZGLArXPGIsqKWt02NGw9IR/jaiNB279XQssh//hmYU6tfS39catCkik6hzpRe5ax 2kjbmQVuJQJ+84Ge+u5lA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdehheeltdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthejredtredttdenucfhrhhomhepfdfirhgvghcu uehurhgufdcuoehgrhgvghessghurhgurdhmvgeqnecuggftrfgrthhtvghrnhepvdeuhf fftddvveeuffetheehfeelveetvdeftdeufeffieejfeduleevfedtffdunecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsegsuhhrug drmhgvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthho pegughhrohiflhgvhihmlhesghhmrghilhdrtghomhdprhgtphhtthhopehrrghnihgvrh drvhhfsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshes lhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepmhhitghhrggvlh esphgrqhhuihgvrhdrgiihiidprhgtphhtthhopegurghnihgvlheshigvshhqlhdrshgv X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 51858C4006E; Sun, 19 Apr 2026 10:41:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: A1C0NH_RcUUB Date: Sun, 19 Apr 2026 07:41:23 -0700 From: "Greg Burd" To: "David Rowley" , "Michael Paquier" Cc: "Ranier Vilela" , "Daniel Gustafsson" , "PostgreSQL Hackers" Message-Id: <12754d02-855c-4b11-ae7c-48a73124e715@app.fastmail.com> In-Reply-To: References: <2D90FFB0-C80A-4189-A5BF-C37F05E271D7@greg.burd.me> Subject: Re: [PATCH] Add tests for Bitmapset Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Apr 18, 2026, at 2:06 AM, David Rowley wrote: > On Fri, 10 Oct 2025 at 11:30, Michael Paquier wrote: >> Thanks for double-checking. Applied after running an indent. > > I was working on test_bitmapset.c to add some tests for a new > bitmapset function. I noticed a few weird things. Hi David, I took a look at your patch, it seems straight forward and valuable. Thanks for pushing this forward a bit. > 1. test_random_operations() is coded to use GetCurrentTimestamp() as a > seed when the given seed is <= 0. Of course, it'll be a while before > the return value of that wraps beyond 2^63 (292250 years), but I still > can't help but think that NULL is a better value to use to have the > seed auto-generate. I don't recall off hand why I had it coded that way, your changes make sense. > 2. Doing #1 means the function can't be STRICT. I do think it's wrong > that the function is marked as strict. That's normally reserved for > functions that we needn't call because NULL input(s) yield a NULL > output. That's not the case for this function. Agreed, good call. > 3. There's no CHECK_FOR_INTERRUPTS() in test_random_operations(). If > someone uses a large num_ops, there's no way to cancel the query. Absolutely, thanks for finding the oversight. > 4. If there happened to be some rare bug in bitmapset.c that > test_random_operations() we might struggle to find it again, as we > don't report which seed we used in the ERROR message. Makes perfect sense. > 5. Couple of minor cosmetics; header order, whilespace. +1 > I felt it was worth fixing these now as the function I plan to add > there does #1, #2, #3 and #4. If I add the new function for v20, the > discrepancy seems questionable. > > David I think these changes are reasonable and improve the tests. Now I need to review your new bitmapset feature... :) best. -greg > Attachments: > * test_bitmapset_fixes.patch