[Cbor] Re: I-D Action: draft-mcnally-deterministic-cbor-10.html

Wolf McNally <wolf@wolfmcnally.com> Mon, 29 July 2024 08:08 UTC

Return-Path: <wolf@wolfmcnally.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 37224C14CE22 for <cbor@ietfa.amsl.com>; Mon, 29 Jul 2024 01:08:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level:
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=wolfmcnally-com.20230601.gappssmtp.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pNNCAsfkrQ3Q for <cbor@ietfa.amsl.com>; Mon, 29 Jul 2024 01:08:15 -0700 (PDT)
Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (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 ietfa.amsl.com (Postfix) with ESMTPS id 747E6C14F75F for <cbor@ietf.org>; Mon, 29 Jul 2024 01:08:15 -0700 (PDT)
Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3db157d3bb9so1604508b6e.2 for <cbor@ietf.org>; Mon, 29 Jul 2024 01:08:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfmcnally-com.20230601.gappssmtp.com; s=20230601; t=1722240494; x=1722845294; darn=ietf.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AT9joEcOAhFXyf8vfbEvfdhoq+dGYmSat8t1ZOZwsSk=; b=QTYiRLRq6kM0lSS30fFgGzmj5HiDcQfD9ev2seUqTXg46K3DJM6MPGscPB8MYTD2Yb rO3BLJT0ftcTy2CkmvOhf20Y7/8J3GVvzbba3ESyFpbKF+S//IxbFuhgoK34XoSgvVG+ CM9trwgAb/PogDKtwqWpY/P+mxomZvARiQmpcrCikR2h4ks3Lu8q7si91ACwpt0zxiGo a1nftjZGSzKDIx/ZLti+uxaVBJ05xf4JyeLTYLIb837IQHdgHIZBk6t4sXpLU3xzjLgC YirAqRIb2ruAchVNJsSWEENkQAPKFdQxXDt5f9HGjo0Nty6vceE9MIgKX96Uj+l3e/no 96nA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722240494; x=1722845294; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AT9joEcOAhFXyf8vfbEvfdhoq+dGYmSat8t1ZOZwsSk=; b=XNN9Ilf5XB1emtKQJQlhTKFFNJPGIOsfKQ6KqKuNdPMZoJxM4nxhqCH81xtZBSSX5c gdbLXzqrK1gCXHHjNYmrMeUHSHP8WCQUdOwWu9NGpAkcVpNJovTnu9WtfkHC2NJlbNpa 7q9srd1RmFk6upZky1ATOlwLbpixzDCO9gondoUTS9S/E2ZpeQ/sBOBAOJSwvB+rBJkB bHxnMy4WJmkX8tBBHb8q19dStURCuZKJWuZn++OfRqoFwiLGtiFK2T/xap+WxGz16mz7 QQAcg+ddVtZ5uicsxUm5B+w5/q7+nrqRfmHYz/JHqf/Vh85dCR/COgAsrVOu5vljyZYi zb+Q==
X-Gm-Message-State: AOJu0YyV20oVryoigIJamCZoe+D3N5TMUUJO1GfXV/p62VOuk2PiF8+O QKFM81p8zt8iHqbjTaY2PWukhEWhckBsCO0soIE8VXxTHOYK+zBV50Ty9y4fhd7QRfHJdSN0YpN +
X-Google-Smtp-Source: AGHT+IGKizBzNIyA+rzZu/+N08SjW1mjzLXCYoTDA9KGZdmQiH2aSD/1zbKD9KR7XYw0hYKZQ2wbmA==
X-Received: by 2002:a05:6808:3026:b0:3db:27eb:c660 with SMTP id 5614622812f47-3db27ebc689mr4915118b6e.20.1722240494375; Mon, 29 Jul 2024 01:08:14 -0700 (PDT)
Received: from smtpclient.apple ([192.145.119.154]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7a9f8751ab7sm5668231a12.42.2024.07.29.01.08.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jul 2024 01:08:13 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
From: Wolf McNally <wolf@wolfmcnally.com>
In-Reply-To: <ea6a35e1-18a7-4bea-8ff8-5249e1f26b71@gmail.com>
Date: Mon, 29 Jul 2024 01:08:01 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <CAEBC446-7730-4473-AC93-7908ADCB78B4@wolfmcnally.com>
References: <a962e326-ab3f-4857-a1ee-2042cf87f32a@gmail.com> <F3E4450A-EA4B-437E-9C58-5DB3972A152C@island-resort.com> <6601a16c-2b2e-45b2-b4e8-7bd4ba136401@gmail.com> <ea6a35e1-18a7-4bea-8ff8-5249e1f26b71@gmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>
X-Mailer: Apple Mail (2.3774.600.62)
Message-ID-Hash: STRN7FXLY3BIKNDWAHS66HUTN62XVMA3
X-Message-ID-Hash: STRN7FXLY3BIKNDWAHS66HUTN62XVMA3
X-MailFrom: wolf@wolfmcnally.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@ietf.org" <cbor@ietf.org>, Christopher Allen <christophera@lifewithalacrity.com>, Shannon Appelcline <shannon.appelcline@gmail.com>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Cbor] Re: I-D Action: draft-mcnally-deterministic-cbor-10.html
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/CybNeZxnFsoQKoYifTh9E_kn5DU>
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>

Anders,

I don’t hear anyone here agreeing with you.

Not this time, or the last ten times you’ve repeated yourself.

You might want to consider the reasons for that.

(And I definitely call on anyone else here who does agree with you to speak up.)

There are no “breaking changes” in dCBOR.

dCBOR can be decoded with any CBOR (or CDE) decoder.

dCBOR can be encoded with any CBOR (or CDE) encoder.

It won’t be super easy, but you can do it.

That means that dCBOR is interoperable *enough*.

But interoperability is *not the point.*

If CBOR were all about “interoperability” then you could use a CBOR decoder to read a JPEG.

But you can’t do that. Does that mean CBOR is “broken”?

No.

Because the purpose of CBOR is not to be interoperable with everything, or indeed *anything* except CBOR.

And it is not the purpose of dCBOR to be interoperable with anything except dCBOR.

“All dCBOR is CBOR, but not all CBOR is dCBOR.”

“All JPEGs are binary files, but not all binary files are JPEGs.”

See the pattern?

CBOR floating point '2.0' is *not* dCBOR and never will be.

So if you encode CBOR '2.0' and send it to a dCBOR decoder, it *will* be rejected.

That’s not a “breaking change”.

And if you present ‘2.0’ to a dCBOR encoder, then it will be encoded as an integer '2'.

You simply *can’t* encode '2.0' with a strict dCBOR encoder.

But that is *also* not a “breaking change”.

Not what you want? Don’t use dCBOR.

Interoperability is great. But it's *not* the be-all-and-end-all of standards.

dCBOR is not *about* interoperability.

It’s about *takes deep breath*…

…DETERMINISM.

~ Wolf

> On Jul 28, 2024, at 10:47 PM, Anders Rundgren <anders.rundgren.net@gmail.com> wrote:
> 
> Hello WG,
> 
> You may think I'm repeating myself and to some extent I do.  However, this posting is about INTEROPERABILITY which is one of the pillars of standards.
> 
> 
> Since dCBOR introduces a BREAKING change [1] with respect to its parent profile (CDE), I felt inclined commenting a bit on the actual draft.
> 
> IMO, a revised draft should be fitted with an *Interoperability Section*, giving potential application developers a "heads up" on what to expect: CDE and dCBOR are incompatible at the application level [2].
> 
> The primary source of the incompatibility is the reliance on numeric reduction.  According to the draft the integer value 2 and the floating point value 2.0 are "semantically equivalent".  This seems like a stretch since floating point numbers and integers have quite different characteristics with respect to math and value ranges, which also make them having pretty distinct use cases.  In addition, the draft alludes that numeric reduction better matches the requirements for deterministic representation of numbers.
> 
> Anders
> 
> 1] Although the draft claims that dCBOR is not a "fork" since it maintains compatibility with CBOR [RFC 8949], the reality (the only thing that matters for application developers), is that the referenced decoder implementations [rightfully] reject 2.0 if encoded as CDE.  In the other direction, CDE-compliant decoder implementations and associated applications like https://github.com/cyberphone/CBOR.js/blob/main/test/xyz-decoder.js#L20 would equally rightfully balk at 2.0 encoded according to dCBOR.
>