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 1uwb7E-0056R4-B2 for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Sep 2025 06:49:08 +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 1uwb7B-005qQb-0X for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Sep 2025 06:49:05 +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 1uwb7A-005qQT-NL for pgsql-hackers@lists.postgresql.org; Thu, 11 Sep 2025 06:49:05 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uwb76-00093j-2p for pgsql-hackers@lists.postgresql.org; Thu, 11 Sep 2025 06:49:04 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-336c86796c0so2593571fa.2 for ; Wed, 10 Sep 2025 23:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757573341; x=1758178141; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o00QAOWpWTyHftjTVwtA/zeEI+Og9nf6oMtrcK8zSBw=; b=nnsFVJg/kRsKDW8GE694dBPb/r/G+yZ2vzcxVBuFd1ntHfXEMdlPpJQ4NgfkAl0PMO hHZ09GdGJ1weBCtfmIKG3S/mDgFS76a7g8IsbrHg4//ldKLdZB0GKAKggjakMyGVJiHy QFW87p4pXXZjMpOZgTamAcp8AaFvoBUBkiu/cJZgse/Fg+xcvCoFT2btWHrTZwuTLyvU IEu7HM+4gECoT6gsOgY9+faxZatyFktQ9Er3twPiKTc7f/h3zDhAN6GTrIeNEBoAaQxr F1T9UdKjp/TD0EEVCaG7LxKVFWeik0rqvNyZWN9yFjhxfzCEnbY6LRLEoqTms0jomS6T J8kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757573341; x=1758178141; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o00QAOWpWTyHftjTVwtA/zeEI+Og9nf6oMtrcK8zSBw=; b=jq7U8w5FxGmIi17WiwxRY+88k1AlzXHfP0VUoec1RZeO+XRyRfIcI+6fXkdlauRav2 ElZXyG3GhuVrunheM+tDKIXTyMMPRma/VW/AegidxaC092MkEmWmVb4mErM9OZ/TwPs6 fFPPz7PzZ2OogJI+lsdkqLVZMkugCOiRXQp5rve1/qqqmFSW2aJguEPnTYVI5CVDd5D4 2rVkuuZ1XqJX1WTPl3yJV3u1GgEVIdr+PeBZvytZwUn/cnlDxjCz2QWPsvtiF7DVvpu5 5SBxvsEQL0XsqbBbB9ImzUV2YmBHipcrANSBMAIVQ1Vmtqz0hQi1OSQtS9Sd0cOeh60z ebzA== X-Forwarded-Encrypted: i=1; AJvYcCXudqhKmDbydMIJ8VypDKdDtBTjVpheudtghnse8HIENwEL8Gpon47TEERbn9AKJEGec/VCf1p4mwoJmG+n@lists.postgresql.org X-Gm-Message-State: AOJu0YxY4SQsxh7Cg/qHoTPa88ew557/na5hAwg/wbmUtfgY41EcMJkh J88/i9yVDss9chqJtWxu82FMJ787jJB+F/+u9/b6owhfgEEXxMjpV3GbM5P6JEDSSqY7ZR/mzUt x2cjRbECiFmfpHGywTdJJd0IDxtzR/Us= X-Gm-Gg: ASbGncv61Vz1VPa9xck/dqXTnRem5kec5exinibT2wK4PllTz7BJ0QvcXf9Ku0epxqY Vq+L5hJ/IeZkx9REk3gHndWMpoYH3ZT076kMRvd8LBPaNZNeuVFukHJvgp8aIYPv5nFMr3FRAhT RCGK+ZuLGVqB9OJTGBIZ2NR3zS0bG/RJvu1eamlYXXv96IZWYr3YmWTLsTb7trzQ/JSIbd6EZpS R7msQc= X-Google-Smtp-Source: AGHT+IHjb6JasjYBestSOgOIVB6CvpjYOYMG3qkVx2RqtuIovVEqJBUGS2xYbiadnfX8wih2W1wNFB0sGCvwyti4Vy8= X-Received: by 2002:a05:651c:2153:b0:333:bb82:f8af with SMTP id 38308e7fff4ca-33b553ae9d4mr34740801fa.22.1757573341161; Wed, 10 Sep 2025 23:49:01 -0700 (PDT) MIME-Version: 1.0 References: <7BD1ABDB-B03A-464A-9BA9-A73B55AD8A1F@getmailspring.com> <02DB5E92-1E94-4617-AC11-836486F63BD5@burd.me> <9E1E0BA4-952C-412A-884A-6E700F26B0CA@burd.me> In-Reply-To: <9E1E0BA4-952C-412A-884A-6E700F26B0CA@burd.me> From: Masahiko Sawada Date: Wed, 10 Sep 2025 23:48:24 -0700 X-Gm-Features: Ac12FXxIh_rNzPI1F5I3zhXl_Xq1_uPun1fEPecXezPmd30JBWgpeyjMHL08PfQ Message-ID: Subject: Re: [PATCH] Add tests for Bitmapset To: "Burd, Greg" Cc: Nathan Bossart , PostgreSQL Hackers 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 Mon, Sep 8, 2025 at 11:21=E2=80=AFAM Burd, Greg wrote: > > > > 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 random se= ts when > >> testing. Binary heap uses it to create different random sets of numbe= rs to > >> use across multiple tests while radix tree has a single function that = focuses > >> on randomized data. I decided not to add randomization into the tests= of > >> Bitmapset simply because I like avoiding non-deterministic behavior. = But in > >> tests I guess that can be helpful finding future unknown corner cases.= I'm > >> on the fence as to the value, your call. :) > > > > I'm not too concerned about it. We've lived without a dedicated test s= uite > > for Bitmapset for a very long time, so any amount of test coverage is a= n > > improvement. Like you said, adding some randomization might be helpful= for > > finding weird bugs we wouldn't have thought to test. And, given the ma= ny, > > many machines that run the tests, IMHO it'd only help build even more > > confidence in the code. If my suggestion inspires you to update the pa= tch, > > great, but I'm fine with proceeding with what you already wrote, too. > > 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 and do= cument > 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. Regards, --=20 Masahiko Sawada Amazon Web Services: https://aws.amazon.com