[Cbor] Re: I-D Action: draft-mcnally-deterministic-cbor-10.html
Anders Rundgren <anders.rundgren.net@gmail.com> Mon, 17 June 2024 11:03 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 4B3DEC14F736 for <cbor@ietfa.amsl.com>; Mon, 17 Jun 2024 04:03:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.108
X-Spam-Level:
X-Spam-Status: No, score=-2.108 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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=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 3X-sR4PSMwr2 for <cbor@ietfa.amsl.com>; Mon, 17 Jun 2024 04:03:20 -0700 (PDT)
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (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 D694FC14F714 for <cbor@ietf.org>; Mon, 17 Jun 2024 04:03:20 -0700 (PDT)
Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ebec2f11b7so41494081fa.2 for <cbor@ietf.org>; Mon, 17 Jun 2024 04:03:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718622199; x=1719226999; 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=5ivYWNeB+40QQm0na+UFu7OUBk13kxXo282/KKuZLOc=; b=V0OJtmqMgfcYkCAZo10bUQVsjB6PBmz8WGNHG8n8z+Kbl8QTDDsJORt10box73LTwz Ya5luFJripWv0fVYqaWGi3niNob/Y4aZUBvGKFRUEyULyN0TkTkxsD/vNvUJPHPmIw+w HLvnHWdslQF8aaecBZnflytlkpBOG2pDbvM5H/AKpxuxgYL2MQRDaeUeBlnQ+T5XFYh+ KMHrDwaD7PmfzIxOrzXPWtV8C2mJKPMh62jOFTIRYrOnSxp2huMXsI3qbSklTOG4q2/V o7l2pZvXbNI2Z42+FFuARBv4h+CToC4x5D55R9puF9R8P5u1KwxgCMTfEnw0wMMkc9IA Sfdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718622199; x=1719226999; 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=5ivYWNeB+40QQm0na+UFu7OUBk13kxXo282/KKuZLOc=; b=Ph/tZqYtrtAf0/GykaKGsl4SkgSAdPhIdTIWbXqkKH2pFMQc0gpJz1UCPi34aTlFxT pYj4mvViVGAqBcAiEafXeNY2C+1ZlTswzUpMN+DVJWB3VS1OYFhcNpvT6pRTzIAphsMk xXbvyLrbU+4PNd5pcn9nWaw6tLQb/v245qLlF4HhTaf88OBo0uTe5//KL9n9khSlLN40 DFIXbJAhv4WBpliXt37ZT+cm2OWZgn3EouiAgcC/EHzUvN9u0Ds8PXdU5CtMy5reFFjN 9HqyASMWWvzSOqgQqAVkSOwsaXYmxnlEHWsCarqKR5d5chl7qw37iRWfPJbRoIYjxJOw 3mQw==
X-Gm-Message-State: AOJu0YzCFBXnCpDNebMShoQYBaSBq+Mbw2nOe1nos5VUx92ld9BL0ACk aFWaXzyZDPXtyzPtTmcuxqOWOQ33vEV4bBrQSNDCYMvzVlr19HeLGigEzACr
X-Google-Smtp-Source: AGHT+IFCkd6oCLiJQbvpzXjR6DaPt9e9P6GWEt5Au9ADLrZe6OUC83lwtsWDpOrkX3BKDuUeI1GAZQ==
X-Received: by 2002:a2e:9858:0:b0:2ec:12ba:f3f3 with SMTP id 38308e7fff4ca-2ec12baf575mr58978271fa.7.1718622198408; Mon, 17 Jun 2024 04:03:18 -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 38308e7fff4ca-2ec07126057sm13072801fa.59.2024.06.17.04.03.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jun 2024 04:03:17 -0700 (PDT)
Message-ID: <70d8a86d-2574-4241-ac2d-7a102d29a40e@gmail.com>
Date: Mon, 17 Jun 2024 13:03:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Wolf McNally <wolf@wolfmcnally.com>
References: <a962e326-ab3f-4857-a1ee-2042cf87f32a@gmail.com> <DF2C7CA0-FC4E-45A8-BBFC-B3243AD34F7D@wolfmcnally.com>
Content-Language: en-US
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <DF2C7CA0-FC4E-45A8-BBFC-B3243AD34F7D@wolfmcnally.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Message-ID-Hash: 2V43AS7N2Y6EM67P2KK2GMMPPLPXIS3W
X-Message-ID-Hash: 2V43AS7N2Y6EM67P2KK2GMMPPLPXIS3W
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/c102T1SLXM2-Q3ZdIynN_zEBrUk>
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-17 11:23, Wolf McNally wrote: > Anders, > >> On Jun 16, 2024, at 7:50 AM, Anders Rundgren <anders.rundgren.net@gmail.com> wrote: >> >> Revised text proposal: >> >> 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. > > This is *not* the "essence of dCBOR.” There is *nothing* platform-specific in the motivation or specification of dCBOR, not for JavaScript or any other execution environment. Well, my wording was maybe not the best. New try: Numeric reduction provides deterministic encoding of common number types which fits both systems that separate integer and floating point values (like Java) and those that do not (like JavaScript). 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. > The motivation for numeric reduction is: to give the most common types of numeric values a *deterministic* serialization. Right. This makes perfect sense in the scenario I just described. However, if you put platform-native data types in CBOR wrappers or use type-specific write methods, preferred serialization à la CDE is a more logical choice [1,2,3]. Using Swift, I could even ditch the wrappers! With respect to the "quality" of the determinism, I am not aware of any differences. Anders 1] WG-adopted work-item 2] Simpler code 3] Preserves the self-describing nature of CBOR > > That’s it. > > No more no less. > > Please stop mischaracterizing. > > ~ Wolf
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… lgl island-resort.com
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… lgl island-resort.com
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Joe Hildebrand
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Carsten Bormann
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Carsten Bormann
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Christopher Allen
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… lgl island-resort.com
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Carsten Bormann
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Anders Rundgren
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Carsten Bormann
- [Cbor] Re: I-D Action: draft-mcnally-deterministi… Wolf McNally