From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id KPIVFjHqZWUXbwEAG6o9tA:P1 (envelope-from ) for ; Tue, 28 Nov 2023 14:25:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KPIVFjHqZWUXbwEAG6o9tA (envelope-from ) for ; Tue, 28 Nov 2023 14:25:05 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5435F15C4E for ; Tue, 28 Nov 2023 14:25:04 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701177904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=iIU5DBp8z2Yy5SV7Q/3EptGOCE3HzwemTvtfVvOUCdA=; b=ZLZjFRcBMzlYu0QmtuzQ4GNDc3mmB6u1H8Ed9Uou96YzX3vZz01Ii5pzsQ/nu8shb6RevB l+L3oyhqOK4OAWCUaojPk8GPduZPlbZxNg+5cslEob59JjxMnp/hhc9QwhJsXKkDF0A1Dp 1ffo4KpcBgOuau3XB/UEGWJ9XSWXWKrcgiNUSW0NNbBYcBSR9khVvfX9KWwwXy55hiKzMD ukaCU1DIhacn3EM/4EDiNEYW1FDSiETktWdje/JhO93V5XT9I9RSMstYjeRR0/b1eZ5OAU XAFQ86c2IRale3MfyCEWjgK4G8/JwuK/YvsQ7I7akwVWMwSdHXueZJEBevYApw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701177904; a=rsa-sha256; cv=none; b=D2iCzTQ8uThKT0gXMNVfV9+rcnpqOD3pZH/xZOoa15BQpyYsTLZDVdPGUhSAFlX5breNMr CdCZcU9dyAqV8EuZvn2Y7n0wsb7xr+ogUWataCAiPYWRU6TbzhqKIeWmsg1oqKUDAij94d 6+Zy+RWz8lOlBIe6+S6e3HefJRykDchvrLyI9A4fhU8vPrrz4Ngus/6Em//p9FNoqAx21Y nHihaWDd+Bblq2b0BTVLPu+Yqw7lUKw4DmgVZNnyIpMzwEWfJoPxhJJYV16R8xB8dIl5cv Jr5MQ6qUmcZNU48Qjuy3WkcOJVW7nPvmM9q6+bEXqp8fn3BzEdYHeTJhS+cGcQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 23DFE60A1A; Tue, 28 Nov 2023 13:25:02 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1]) by mail.notmuchmail.org (Postfix) with ESMTPS id 46C1D609E2 for ; Tue, 28 Nov 2023 13:24:59 +0000 (UTC) Received: from tethera.net (fctnnbsc51w-159-2-185-147.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.185.147]) by phubs.tethera.net (Postfix) with ESMTPS id 70081180066; Tue, 28 Nov 2023 09:24:57 -0400 (AST) Received: (nullmailer pid 1924708 invoked by uid 1000); Tue, 28 Nov 2023 13:24:56 -0000 From: David Bremner To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] lib/string_map: simulate stable sorting In-Reply-To: References: <20231125123352.1508578-1-david@tethera.net> Date: Tue, 28 Nov 2023 09:24:56 -0400 Message-ID: <87sf4q1047.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 3V3OBOZHJAMFOWWLZMPPSLDUUGG2IXFU X-Message-ID-Hash: 3V3OBOZHJAMFOWWLZMPPSLDUUGG2IXFU X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 1.55 X-Spam-Score: 1.55 X-Migadu-Queue-Id: 5435F15C4E X-TUID: mzv/1K5Vu8WN Tomi Ollila writes: > On Sat, Nov 25 2023, David Bremner wrote: > >> qsort(3) does not promise stability, and recent versions of glibc have >> been showing more unstable behaviour [2]. Michael Gruber observed [1] test >> breakage due to changing output order for message properties. >> >> We provide a sorting order of (key,value) pairs that _looks_ stable by >> breaking ties based on value if keys are equal. Internally there may >> be some instability in the case of duplicate (key,value) pairs, but it >> should not be observable via the iterator API. > > I don't know (from the visible context here) why this is needed, but I > can image it is useful, so > > LGTM. > > Tomi Applied to release and master. d