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

Anders Rundgren <anders.rundgren.net@gmail.com> Mon, 17 June 2024 03:32 UTC

Return-Path: <anders.rundgren.net@gmail.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 7570AC1840F4 for <cbor@ietfa.amsl.com>; Sun, 16 Jun 2024 20:32:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 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, SPF_HELO_NONE=0.001, SPF_PASS=-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=gmail.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 QwT6s3WbIv5V for <cbor@ietfa.amsl.com>; Sun, 16 Jun 2024 20:32:04 -0700 (PDT)
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8E109C18DBAC for <cbor@ietf.org>; Sun, 16 Jun 2024 20:31:59 -0700 (PDT)
Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-52c89d6b4adso3616125e87.3 for <cbor@ietf.org>; Sun, 16 Jun 2024 20:31:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718595105; x=1719199905; darn=ietf.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=XrWqo+TCVgnGPVzJXqdQX3EnPkJExENeju6MNKQVtZk=; b=PV6axZLfgRmIz47hU78Hyl0C4XQ19QjlVoL/8WR1EtIhv8/FqasyceJPEXTxjY9ysO 7LsQwFSRrjkW4unhtXcbVQTyEym8RXlMGMNZwcD4Q5hm7mCUjSLQtoYuteGe+MPd4Y06 Gp1C+J0Wl6UOQ+X8wNNbINcbPHc2EiZVFOHlerRjL3QryXgxWTWKYLQvtssu4gssy240 WSUJ4TJO6llF2+u9lsI4L1FNyOGzBww8Ek7qJFatVTPIQzjTdloAVr4Uy8XKfqWplgS6 GsukMjTseYSPosKSPRYPLUHF0typJRjLHDJfjNNHf13I8Yc3UOkNzNcGAdyBuSl8eUL1 k9Hg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718595105; x=1719199905; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XrWqo+TCVgnGPVzJXqdQX3EnPkJExENeju6MNKQVtZk=; b=er1GkHUNVn9KAf3JhSY8qymsy8woCiH8fDK3snJe/Uitd40UYcmsGHAyk3Y0I962lT XeWqkh+OVQ0Zuajo+D8De+jOvYZgnEyCw6nP9IYCp5usZDb1iWM1KgcngDEV72Nkub8A fLwqBpac1yprI7bmPxuPS3zd3fYRHz08r+gCqWB2SMAnrrVHB6NtYitXNVSHK67WCJgb 9Qmed/aUG48r50CjmA6ZRISaFEXKotWF2PQAQC+rMjQKR/YBdkYaekA2NphbUENwI4Wd 9jMpOJna5dTGdQDLO9nB8+GCZaJJTzgaj7u8Hovm9Kz3ZuVrDl2CfqU+vXUzsmQxv4Kj Z/uQ==
X-Gm-Message-State: AOJu0Yw2PXdlAkH0P048gC8c4nOMBKiCdOqoXqmHGAR6EkEedjVWIb/n J5kUpDqS7Ziu/YDfK8+N9Gbo86NVzE/2MT7ClHHjVrTOcJq8fRpzie9Uf2gQ
X-Google-Smtp-Source: AGHT+IFbbQvSeT55VkRZXXP+cu5x7h+jZnrM36bc5OdixBLzezX2jBSUJUXtBoWZ/LyxnZohkTql4g==
X-Received: by 2002:a05:6512:4015:b0:52c:b11a:bfb3 with SMTP id 2adb3069b0e04-52cb11ac093mr4147796e87.57.1718595104263; Sun, 16 Jun 2024 20:31:44 -0700 (PDT)
Received: from [192.168.0.101] (212-107-132-189.customers.ownit.se. [212.107.132.189]) by smtp.googlemail.com with ESMTPSA id 2adb3069b0e04-52ca288702csm1128343e87.250.2024.06.16.20.31.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Jun 2024 20:31:43 -0700 (PDT)
Message-ID: <6601a16c-2b2e-45b2-b4e8-7bd4ba136401@gmail.com>
Date: Mon, 17 Jun 2024 05:31:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: "lgl island-resort.com" <lgl@island-resort.com>
References: <a962e326-ab3f-4857-a1ee-2042cf87f32a@gmail.com> <F3E4450A-EA4B-437E-9C58-5DB3972A152C@island-resort.com>
Content-Language: en-US
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <F3E4450A-EA4B-437E-9C58-5DB3972A152C@island-resort.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Message-ID-Hash: 74CLNFCVZTN6CKJYL4WAVUO4CEMNGOVZ
X-Message-ID-Hash: 74CLNFCVZTN6CKJYL4WAVUO4CEMNGOVZ
X-MailFrom: anders.rundgren.net@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@ietf.org" <cbor@ietf.org>
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/uARCDxulestFmCele5A_xrIQxYc>
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>

On 2024-06-16 19:57, lgl island-resort.com wrote:
> On Jun 16, 2024, at 7:50 AM, Anders Rundgren <anders.rundgren.net@gmail.com> wrote:
>>
>> 2.3 Numeric Reduction
>> To provide deterministic encoding in platforms that do not separate integer
>> and floating point values (like JavaScript), numbers must be canonicalized.
>> Numeric reduction ensures that semantically equal numeric values (e.g. 2 and 2.0)
>> are encoded into identical byte streams (e.g. 0x02) by encoding "Integral floating point values"
>> (floating point values with a zero fractional part) as integers when possible.
>>
>> Since this is the essence of dCBOR, I would drop all other parts of dCBOR, since similar restrictions and limitations can be found in just about any other CBOR-using application as well.
> 
> There’s only two other things:
> 
> 1) requirement to validate (the requirement to validate dCBOR implies validation of CDE which implies the requirement to reject dup map keys).

Wouldn't that better belong to CDE?  Duplicate keys are already invalid CBOR.


> 2) restriction of simple types to true, false and null
> 
> Agreed that the numeric reduction is the center of dCBOR, but I don’t mind that these other things are part of it too.
> 
> If some protocol wants dCBOR numeric reduction plus the simple value undefined, they can just say so in a specification and it will be OK. Seems like the main problem is that they won’t be able to use the “.dcbor” CDDL control.

Assume you have an application that is rather using CDE and it outlaws all simple types except for true, false and null.  Would the authors be encouraged writing a specific profile document and run it trough the IETF?  I hope not.


> 
> That kind of begs the question whether there should be a separate CDDL control  “.float-num_reduce” so someone can say all they want is dCBOR floating point number reduction in CDDL.
> 
> LL
>