[Cbor] Re: Two dup detection questions

Rohan Mahy <rohan.mahy@gmail.com> Tue, 02 December 2025 21:23 UTC

Return-Path: <rohan.mahy@gmail.com>
X-Original-To: cbor@mail2.ietf.org
Delivered-To: cbor@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id C8F5694310F8 for <cbor@mail2.ietf.org>; Tue, 2 Dec 2025 13:23:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i3vwIOF3VORm for <cbor@mail2.ietf.org>; Tue, 2 Dec 2025 13:23:12 -0800 (PST)
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 7166994310F1 for <cbor@ietf.org>; Tue, 2 Dec 2025 13:23:12 -0800 (PST)
Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b73a9592fb8so80013666b.1 for <cbor@ietf.org>; Tue, 02 Dec 2025 13:23:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764710590; x=1765315390; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5M7k05rsbTQzVg2PR9Q2m8hqArO4D7wp2UqnsUO+ekU=; b=bDDM5DZE0eM095KUYrd2lDKt2GAzW6F/EdLdNaz/MGR0aQzEsZ19v9Uepauvk+PHaa m6jvRJPml/VyRiQXLHANt6wYsOELnlEPJeVjic6e92HyChzuQMylt3LI21UN6KFr9wCq 8lvazxVdmR8Odt7ZSwneuRSHPXI8n5XMVjCQ7K1rnmid1XMXFGaWJiN2yqELObp3A5Sr s2hTfLn00yqvJGhxmjVNVnZ0PV3oj2uSh+Z+YhEDa14M3HgRKMhJqIexHof0k3YLm9Vv VVkeyfBIzGzfnlppn3/wUZCcv3b9YToAu34BeRNR+h4sie1i+Px2d8tX+YhFjd3bVE+1 GymA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764710591; x=1765315391; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5M7k05rsbTQzVg2PR9Q2m8hqArO4D7wp2UqnsUO+ekU=; b=SCNhWeAMrsJ330JyC2owR2rbujy9BYQJ3d+lIshvHGxec1fCeTOE4VBLpXRlDBgMVy ACOAM58JgGEAAuNmNHRd7WohsZYicT1CXTMOkp6mTO0NYHf/g8Z6mCV0SSWsUuSQMnyr hvT1oJKU3v508iNwAlkp3ULTw0CxLCexzd6ipM31f0nK4lnBjR1czkJMG8UolSsyT8Zk kbGSgWS+gPGf9vxTDzbtjrobd/m6Ktvkh5qDcZTwAk9Wlv0a8QLScRtM5IgCztpWw1it 2TuLAMZG2k67YdrFGnLO8+J5CZOjgLjnd8zJbNvB0D1mTW6ia7G2aSaSJwCl+j25xDBj JmKw==
X-Gm-Message-State: AOJu0YzDponEIB0Bf2qDtSRB6C+n/y17pDdmv8nvNiGir82YStTHQD0Q aWuGf6wg67FNzpVHaaqcRTQQXx2cFn5HyEk2Q/vmO6TsDju3J6UK5zvEnbDWnCDYbUXhO4HnDvh 3BbXDiiHJzZMu/oIuGI7D6agREkgV4Kivf4Z5
X-Gm-Gg: ASbGncv6KoE1QM5u74eKrR3yNgcG7iFMKLM45Er/SlV/Ijdk5B346ntDcPKT8B6wnCl UgZlo3DXE0h7va6w7r2ekkkwSaShg+RH7XNxWUH/Qfled4XjI+Ewp0Fh+m0m5pwUfiq+ufaFqEJ +8M9GUEdxweulldB2BhPhznp1/0Au1I9THmvrR6GCp/bVbuZfSHAvIddcOzqgF594RohRLBT7Hk /LLI61jyvfHagMoMZyE1/YrhyaSc2EE4vYLlXS5keid570yLO/Y7kTr83BhZ6UVzbePs4cGmqjX SR+k/unrQ4tO8VGzB8ThpH3W8tg=
X-Google-Smtp-Source: AGHT+IEiND+BII3yPWKyZRVBo/CksrJiBmRe7faUTHgHvBoUzd9GHBS/pA7bF35JaskZ7mBAHfNDunvVzNoR/Yv1XjU=
X-Received: by 2002:a17:907:9714:b0:b70:4f7d:24f8 with SMTP id a640c23a62f3a-b79d65d6955mr6552466b.22.1764710590300; Tue, 02 Dec 2025 13:23:10 -0800 (PST)
MIME-Version: 1.0
References: <CCE4510D-DD9D-46DD-8274-E637D55D56D7@island-resort.com>
In-Reply-To: <CCE4510D-DD9D-46DD-8274-E637D55D56D7@island-resort.com>
From: Rohan Mahy <rohan.mahy@gmail.com>
Date: Tue, 02 Dec 2025 22:22:57 +0100
X-Gm-Features: AWmQ_bl4XvamUZeEg4AZax49fXM4xXkAkSdPZOl3P2QidC5oDE5vuChx73F0lPc
Message-ID: <CAKoiRuYLGAYP+01azoFs1ASiVSd-FVzsbTdPkTnjrBP2_zgJcg@mail.gmail.com>
To: Laurence Lundblade <lgl@island-resort.com>
Content-Type: multipart/alternative; boundary="000000000000ddc6690644feb308"
Message-ID-Hash: 72KXON5D3LVUBPNH5JWDHIL6CZ7KDES6
X-Message-ID-Hash: 72KXON5D3LVUBPNH5JWDHIL6CZ7KDES6
X-MailFrom: rohan.mahy@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cbor.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: CBOR <cbor@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Cbor] Re: Two dup detection questions
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/lTIxIszHa91PfRC6YpSfcbsiV6A>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Owner: <mailto:cbor-owner@ietf.org>
List-Post: <mailto:cbor@ietf.org>
List-Subscribe: <mailto:cbor-join@ietf.org>
List-Unsubscribe: <mailto:cbor-leave@ietf.org>

Hi Laurence,
Nice framing of the question.

On Tue, 2 Dec 2025, 20:50 Laurence Lundblade, <lgl@island-resort.com> wrote:

> Q: Why does dup detection operate on data mode values (and sorting
> doesn’t)?
>
> I think the answer is that the application makes use of the map keys in a
> critical way — to distinguish data items like a person’s last name from
> their shoe size. The application probably doesn’t have access to the
> serialized form of the map key. It doesn’t want access to it either — the
> point of CBOR is to serialize/deserialize data so applications don’t have
> to worry about it.
>
I agree that this seems to be the intent, but the spec language is
sufficiently vague I think it can cause inconsistent/ unpredictable
behavior that is the result of different encoders/decoders and the
languages they are written in. Not just different application logic


This contrasts to map sorting where the important thing is that they are in
> the same order, not so much what that order actually is.
>
>
>
> Q: Is -0.0 == +0.0 the only exception?


If deterministic serialization is used (regardless of which one or its
> name), then the only difference between binary comparison of the encoded
> forms and data model comparison is -0.0 == +0.0. Is that right? This is
> because in the general CBOR basic data model -0.0 != +0.0; and that is
> because they are not equal in the (implicit) IEEE 754 data model.

Almost, what about bigint demotion?

thanks,
-rohan


> Maybe these are kind of a “duh” question, but I think it helps for us to
> be all on the same page to keep the discussion grounded.
>
> I also kindly ask that you answer / discuss the question directly rather
> than say how your favorite flavor of CBOR works for these question. My
> questions are *only* about RFC 8949. I think that can also help the
> discussion grounded and progressing.
>
> LL
>
>
>
> _______________________________________________
> CBOR mailing list -- cbor@ietf.org
> To unsubscribe send an email to cbor-leave@ietf.org
>