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

Wolf McNally <wolf@wolfmcnally.com> Tue, 30 July 2024 21:59 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 82C5EC14F71C for <cbor@ietfa.amsl.com>; Tue, 30 Jul 2024 14:59:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.905
X-Spam-Level:
X-Spam-Status: No, score=-1.905 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MIME_QP_LONG_LINE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] 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 Ua0RcpmaOgFx for <cbor@ietfa.amsl.com>; Tue, 30 Jul 2024 14:58:58 -0700 (PDT)
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (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 956BDC14F5FB for <cbor@ietf.org>; Tue, 30 Jul 2024 14:58:58 -0700 (PDT)
Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-70d1d818c42so3206781b3a.1 for <cbor@ietf.org>; Tue, 30 Jul 2024 14:58:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfmcnally-com.20230601.gappssmtp.com; s=20230601; t=1722376737; x=1722981537; darn=ietf.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=xG2AvlKcrJ8Fln2viELWvXJy+0mcoVjCssPO4fsmvB0=; b=3SBXrmZvegJyIVdV8Ycfgi+TiKOt4WnQAMzfRgAmW866YmNpBxFXJ6IYdks9+W6c9S ftKXBUALCsGzQcMzPdag9I7gAmwqHrkcj7aHmYXdrVh1CZ2Fa0IzA6YGO2zjbsd9arj4 XQJk75OqpxD22aM66mfEGIN2vrl+9GsQDVq/aNa/vFBZ4NdcullGuQEE7JUdDK9QrsnL ogtW/saVpFofYhc+GncOqvezNEX/pTKg5jDCV23vGRrjdgmryHK9sddGijCjWgJoVCeF BwCbxcHb2zvcxIQKzeCuh1kTFGxfv5eSkW86k+dMiUYB7pwIoUQ24cwjLMAvNoSEcpy/ QhvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722376737; x=1722981537; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xG2AvlKcrJ8Fln2viELWvXJy+0mcoVjCssPO4fsmvB0=; b=cQeZxTaGrnJDxL0vmEKYzy4wak4fcxZR/Rxk5PzeI7sxLnvjzPT9XKUDNBTXeV3Zqv CU5AId599rLQNMTjsJ/2H8T3nPNeeojEv7WTr98kPkSXATNjn4bjUkb35a2rWQ/pReGo UwuzTtp9L45I0+FIC7+6Hge72WaTifDwDX3eq8Zdj2IY/kLElhAjguII4Y8R6rs2QN9q fiK5BFI4hZjNV5h07Og8NkceVMTrEenBM27xkNZlqctUM+wHYxhWZwFZIGWDdX4H+Cfc IP1b/srn0CGDqZvMiweuDw8qp9xFSGRG3IC63eFkVMyogy07Q42a4Q6iXPd5GVi0+VTe dETQ==
X-Forwarded-Encrypted: i=1; AJvYcCUw6EuvH+x0dDNf6N6XX5Nx4uqTZjxORimSDO/euBENluUBBMMVDQSiJDm7L3h1dHTJyfCQybOep12VFtSo
X-Gm-Message-State: AOJu0YzzLIMWF4G6+9IjxAiKtWcqGVpuEZiIsrCnKMs7QeZzIb7gYlDv YrIESiZzfhqovPtM36yeqToRLZakuPFDoJKgimrWP3wTF3mKgXmLShfxZyh4YH0=
X-Google-Smtp-Source: AGHT+IGJFEJq/u/Cq/Iw+FuBoyH8r17ZMuUOxyg2BjyXNrZUYN7Fyvq2oTBhiL1TNGi/umWl2b2mjQ==
X-Received: by 2002:a05:6a21:78a7:b0:1c4:21c0:e835 with SMTP id adf61e73a8af0-1c4a1179b4bmr11846427637.2.1722376737488; Tue, 30 Jul 2024 14:58:57 -0700 (PDT)
Received: from smtpclient.apple ([2600:381:4d13:5c80:90e:e1e2:ae9:f578]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70ead7156easm8880642b3a.85.2024.07.30.14.58.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jul 2024 14:58:56 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
From: Wolf McNally <wolf@wolfmcnally.com>
Mime-Version: 1.0 (1.0)
Date: Tue, 30 Jul 2024 14:58:45 -0700
Message-Id: <A69EAB24-D21D-4D67-BADE-976991506FFE@wolfmcnally.com>
References: <ae409f6c-f5f9-4fa4-b8aa-bb4565fffbd3@gmail.com>
In-Reply-To: <ae409f6c-f5f9-4fa4-b8aa-bb4565fffbd3@gmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>
X-Mailer: iPhone Mail (21F90)
Message-ID-Hash: M5SJUHXL3HVGV6FRSNCL2IQBTMJ4TFSF
X-Message-ID-Hash: M5SJUHXL3HVGV6FRSNCL2IQBTMJ4TFSF
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: Christopher Allen <ChristopherA@lifewithalacrity.com>, Joe Hildebrand <hildjj@cursive.net>, CBOR <cbor@ietf.org>, Shannon Appelcline <shannon.appelcline@gmail.com>, Carsten Bormann <cabo@tzi.org>, Laurence Lundblade <lgl@island-resort.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/xkKZtCksKeDOZ8AO9dZHE52Ypyg>
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,

> On Jul 30, 2024, at 1:46 PM, Anders Rundgren <anders.rundgren.net@gmail.com> wrote:
> 
> Hi Christopher,
> 
>> On 2024-07-30 22:22, Christopher Allen wrote:
>> On Mon, Jul 29, 2024 at 11:21 PM Anders Rundgren <anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>> wrote:
>>    On 2024-07-29 15:49, Joe Hildebrand wrote:
>>     > - I'm still not sold on bidirectional diagnostic notation, and have not planned on writing a parser for it, but I'm still thinking about that.  However, I don't see what it has to do with this discussion.
>>    Well, it has.  This feature permits writing and reading fully compatible CDE from external text based databases [1].  Gordian Envelopes rely on a similar feature but using dCBOR.
>> To be clear, we do have something called Envelope Notation, but it is not bidirectional. It is designed to make the envelope structures clear for debugging purposes only.
>> ```
>> "Alice" [
>>     "knows": "Bob"
>> ]
>> ```
>> or with --tree
>> ```
>> e54d6fd3 NODE
>>     27840350 subj "Alice"
>>     55560bdf ASSERTION
>>         7092d620 pred "knows"
>>         9a771715 obj "Bob"
>> ```
>> We do have a `dcbor-cli` app
>> https://github.com/BlockchainCommons/bc-dcbor-cli <https://github.com/BlockchainCommons/bc-dcbor-cli> that supports basic CBOR diagnostic output, but I would not say that it is a full implementation of latest notation specs — again, our purpose is not round trip but to enable clarity of structures for debugging. I'm not even sure we test round-tripping.
> 
> Thanx!
> 
>> An important point here is that round-tripping of binary to text and back can actually get in the way of useful debugging support for software engineers.
> 
> FWIW, this ability is why I prefer CDE.  If you write 2.0 in the left window of https://cbor.me and press the -> button it will come out as CBOR hex in the right window.  If you then push the <- button it will still render as 2.0.  Using the dCBOR option breaks this scheme.

It actually depends on what you mean by “this scheme”, and whether you think the concept of “two” should have many different encodings. For the purpose of supporting determinism for most common purposes we have identified, we don’t think that conceding the semantics of numbers to specifics of processor architectures (any more than is absolutely necessary) is as desirable as you clearly do.

In the case of the CBOR playground used with the dCBOR option on, I would argue that the semantics round-trip perfectly for every purpose we care about, and *that* is what matters. There is absolutely nothing broken there.

It is on you to argue why deterministic encoding of identical semantics for such a common data type as “number” should be a secondary consideration, and you have so far failed to do this.

~ Wolf