Re: [Cbor] NaN behavior for CDE

"lgl island-resort.com" <lgl@island-resort.com> Tue, 09 January 2024 19:12 UTC

Return-Path: <lgl@island-resort.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 24E76C1519A6 for <cbor@ietfa.amsl.com>; Tue, 9 Jan 2024 11:12:57 -0800 (PST)
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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
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 pOAWZDQYtMVl for <cbor@ietfa.amsl.com>; Tue, 9 Jan 2024 11:12:52 -0800 (PST)
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2119.outbound.protection.outlook.com [40.107.243.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C1F96C1519A5 for <cbor@ietf.org>; Tue, 9 Jan 2024 11:12:52 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DNrHKOO2zaYno7oD4QgDPF4UGSqeRocpjUBDk6lhE6VOOH+ii6RQb9YxNvLIy640zJiUscuiT+H0Qj7Z3qnrAXdcwlyJsAxE758Q0JHGFXf1aYR91WxDijD/akgTBha0p0utFO96PhL+fPaaW+6Lh4rMVBpBQyyrjdku6kxIO0vQF76JFz6LXuA2kIjFmbpY/NSVvQcUjF5wDI1Nymr1vzhB2q3QLj/zjXRaiGizAbBW9kasH4titDm6ee/eXKXVNQ2ZVggOvTIoKv0knlyKliAY2GNVWazJTt8fqt/JX/H0tZhvDckDS9DUqB/kVrTx51CziGEoHg4cQTaxslv0Dg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gdOH0P1ddHNPIBUd2U1UeyaOKkXVuVPiLred6W74ZQY=; b=khA/Ib2d99wd2XJWbotO8JEE/giQDRXkdpMjBm1HVpVbpTNPVu+/QGAHUPDysRogDtxp2nFqqg9NiyErhVb0XdPG5CJof7EZEI80SQohnGW25TnzdqDmKfl5yTdfmusuQEqPre54oL+arvORXXtmgGBjtCqnCP1je8fDef5EUwVbS3vL8gD1UJO/WTFmxILwdmI/DE8ShwRPGn5DypVNgucJf2Yb8A42QXNrfu0DXriFL1NacohsfK/MFFhzv9JunV8h5LJXZ/10OeuVHVENDfK8ZxYTgXonrU6/MKwqP4BMFbieLpQq3B8KxiydO17pmlTSL6yZ45d8uSleEC5MEw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=island-resort.com; dmarc=pass action=none header.from=island-resort.com; dkim=pass header.d=island-resort.com; arc=none
Received: from PH7PR22MB3092.namprd22.prod.outlook.com (2603:10b6:510:13b::8) by LV2PR22MB3678.namprd22.prod.outlook.com (2603:10b6:408:175::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Tue, 9 Jan 2024 19:12:48 +0000
Received: from PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::353a:75f1:88a7:5f90]) by PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::353a:75f1:88a7:5f90%6]) with mapi id 15.20.7159.020; Tue, 9 Jan 2024 19:12:48 +0000
From: "lgl island-resort.com" <lgl@island-resort.com>
To: Joe Hildebrand <hildjj@cursive.net>
CC: Carsten Bormann <cabo@tzi.org>, "cbor@ietf.org" <cbor@ietf.org>
Thread-Topic: [Cbor] NaN behavior for CDE
Thread-Index: AQHaPcfjuok2xbvYS0y0BrDq4KCPbLDHFpgAgAADqQCACUqDgIABdd+AgAAGIICAAANKgA==
Date: Tue, 09 Jan 2024 19:12:48 +0000
Message-ID: <FC9DABEF-030D-4AE1-82A5-E0306CCF6B49@island-resort.com>
References: <B3993FCB-3878-47EE-A9D7-21F34530BE51@island-resort.com> <6B10BDA4-994A-4614-966E-487E0B6F46D3@tzi.org> <AEB51081-00F9-40CC-9043-29EB4A083CFC@island-resort.com> <D5F97344-DFD1-4298-B409-87504E654F0C@tzi.org> <A6EBE8A8-2A46-4061-AAD5-177DBC301AA2@island-resort.com> <CC160EDF-E9A4-4798-87E3-24219A20C8D8@cursive.net>
In-Reply-To: <CC160EDF-E9A4-4798-87E3-24219A20C8D8@cursive.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=island-resort.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PH7PR22MB3092:EE_|LV2PR22MB3678:EE_
x-ms-office365-filtering-correlation-id: 7e20a101-227c-4e6f-4f99-08dc1146f7e2
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: BRo2DrRayT4zH9TqMHfGOAp/c0VZ63lRzGqRM3Rs+RqO977yWHeKwO82qZcqiUK1bkIUrjtVnITDRNwAU4DE7ViWwZdDQ/cI9D9SrGRCkJX9Od8YpyxlY+Ji7vIJ383NmyA5aRqWfghZ0PoSVFH1K6+PI5h5h8Vki64QRX1VJjOfthgj8WhGezwyRUXaS3Cg/I9j5sRbD0CU7arsLhch+LBmgQ/nFWiFeTsoQL1rZdLJ9gY3dTTyPX5WnJoR73Yuy2stksjLzxjlfUn1EZp/fG3kgmNY1L53ubZeVfempzQGyKKP8/amu0TzzZ/0vxGYZGEEUgYDUtNzfSPErZnZ8C7XlitO1Jtetyx1Z8pkw/1VfFVybbQ1aroizhrzMZYrMh81z/5bjlN8zb+teckGWqUADSHAMQzTovgrqchChWuq1oMjLeQjrt/cQuYVSQ6keMEBXBCWT1Fywm7PrJ/d55vVKzNQuzjfgKRF5TCCDE8P8F9wHTKcMP9YAlslNh6nEixQCoxuiigesP7qSx4ZUG0VY2hzQLCSGpbSVjRDVIGd4+bCNKRkkVwwWzUs1mlkt9msAIjnvZvBMHQ/ileiOAB6LEJ3z46hbOYeeg+WA1ozZ7KYne6bQIJBDe8ky///4Na8KLqOjvMJApxDqL8hPQ==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR22MB3092.namprd22.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(366004)(346002)(396003)(376002)(39830400003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(2906002)(966005)(478600001)(5660300002)(36756003)(4326008)(38070700009)(76116006)(41300700001)(66946007)(91956017)(8936002)(66446008)(66556008)(66476007)(316002)(6916009)(64756008)(54906003)(33656002)(53546011)(71200400001)(6486002)(8676002)(6512007)(6506007)(86362001)(2616005)(26005)(83380400001)(38100700002)(122000001)(45980500001); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 23PSDH+EN2jLSVZ5HivWkXJpcqdQ9QO6s0g2gcroorRfNPEcvZV7ffZEon6A6rvGXj9c1Gd7XBlNRdhQ+vUCRaUvP2N8tYgX1LB4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9ooWwU3K5Ji0HGIM+Lt6M5/Ii+kht4mH7vs9Ive1ijGO9WMG7pHWCaqQ1a0FEoMP7IwNBcqKfuhFAULWOzDgeNq4bCYzpDcaEodcCNWxzF4ZnahW78+KWOFT9c/owsaeO/wjvloqQEw3gqZVXt57fBRs0oR7e8bxYEMMZ8T1cXMGj6MiHSh1BB7dQcQbYBBTJXgzn4iWEVSaPXVysU73hMlmy7vJ1N36Q6gVSumEx56h3tOoygXZWQlSbqwHnKI771JGxwXValZevbyLIdC4htdRMpv1Xh4xYJQOw92RieWBAlCYBoh/iLli6GBllzUNKt0C+EWLzLFXheuD5OctX7EbE82exQqQskvrKGVvqkI7/j4Ni/w0iucxVtA+CYtdhwqaCUrAhYKWyoNAkglnU+DWAfMBsdv/D7fhwDypbN9VxvTdl3Z/s9WUS3djFOVU3X4HA==
Content-Type: text/plain; charset="utf-8"
Content-ID: <11E8FC1197F5FE46B031DBEAD65F57B6@namprd22.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: island-resort.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH7PR22MB3092.namprd22.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7e20a101-227c-4e6f-4f99-08dc1146f7e2
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2024 19:12:48.3337 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: ad4b5b91-a549-4435-8c42-a30bf94d14a8
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 6k9kBTy4M60PoE0btfcog+g4gSoM3+WWKRZ1ofbbamp/7HMyTAjkp56h+yYGcxQEjOuObSwLdEMgP2Veu1WETw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR22MB3678
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/Npi2K0FW-kH8b3j6GZSMyuqhjks>
Subject: Re: [Cbor] NaN behavior for CDE
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 09 Jan 2024 19:12:57 -0000

The question is how and where to express this best current practice.

- Built into the CDE definition (I’m suggesting that)
- As extra text in the CDE definition (Carsten is kind of going for that)
- Other document (yuck — too many documents)
- Rely on library documentation

A big part of my motivation is that I think CBOR serialization variation is already messy and confusing for most reader and users of CBOR. It is one of the messiest and least understood parts of CBOR (IMO). I’m hoping that the CDE document is sharp and clarifying.

LL


> On Jan 9, 2024, at 12:00 PM, Joe Hildebrand <hildjj@cursive.net> wrote:
> 
> Agree with this. I'd go as far as to say that it might be a best current practice that protocols intended for wide interoperability SHOULD NOT rely on sending or receiving NaN payloads (including quiet bits) in CBOR or any other encoding. 
> 
> — 
> Joe Hildebrand
> 
>> On Jan 9, 2024, at 11:39 AM, lgl island-resort.com <lgl@island-resort.com> wrote:
>> 
>> I understand what you are proposing now. It is the same as Attempt-to-Preserve-Payload in my TL message that you probably DR  because it was TL :-) 
>> 
>> I still think some of the points I make apply:
>> - No support for NaN payloads in CDDL or in other text or literal representations of float
>> - Cbor.me does preferred serialization, but not NaN payloads
>> - CBOR Sample code for conversion to half-precision doesn’t support NaN payloads
>> - No C/C++ APIs to support encoding/decoding of NaN payloads
>> - No compelling use cases
>> 
>> LL
>> 
>> 
>> 
>>> On Jan 8, 2024, at 1:20 PM, Carsten Bormann <cabo@tzi.org> wrote:
>>> 
>>> On 2024-01-02, at 23:27, lgl island-resort.com <lgl@island-resort.com> wrote:
>>>> 
>>>> I think what you are saying here is that CDE does not make a choice about NaN payloads. It is left up to the protocol / profile.
>>> 
>>> That is not what I was trying to say.
>>> 
>>> I was trying to point out that, since CBOR supports NaN payloads, CDE needs to support them, too.
>>> 
>>>> Thus, a particularly thorough generic CBOR encoder supporting CDE probably has a configuration setting that allows the user to pick NaN payload behavior.
>>> 
>>> I hope not.
>>> 
>>> I submitted a -01 that should clarify this:
>>> 
>>> Status:   https://datatracker.ietf.org/doc/draft-ietf-cbor-cde/
>>> HTML:     https://www.ietf.org/archive/id/draft-ietf-cbor-cde-01.html
>>> Diff:     https://author-tools.ietf.org/iddiff?url2=draft-ietf-cbor-cde-01
>>> 
>>> Grüße, Carsten
>>> 
>>>> 
>>>> LL
>>>> 
>>>> 
>>>>> On Jan 2, 2024, at 2:14 PM, Carsten Bormann <cabo@tzi.org> wrote:
>>>>> 
>>>>> I wish everyone a great new year.
>>>>> 
>>>>> On Jan 2, 2024, at 23:06, lgl island-resort.com <lgl@island-resort.com> wrote:
>>>>>> 
>>>>>> The TLDR for this is that I think CDE should not support NaN payloads.
>>>>> 
>>>>> Since CBOR supports NaN payloads, CDE needs to define how to deterministically represent them.
>>>>> 
>>>>>> CDE NaN should always be 0xf97e00 the same as dCBOR.
>>>>> 
>>>>> That is a perfectly fine application profile.
>>>>> I think the consensus on this list appears to be that we put very little blame on "generic encoders" that do not support NaN payloads, i.e., aren’t really fully generic in the fullest sense.
>>>>> We probably need better nomenclature for “not quite fully generic” encoders in this sense.
>>>>> 
>>>>>> Also, it appears to me that Preferred Serialization (RFC 8949 section 4.1)  requires NaN payload support. Looking for confirmation on that.
>>>>> 
>>>>> Preferred Serialization tells you the preferred serialization *if* CBOR provides a choice between multiple encodings with the same semantics.
>>>>> If your implementation doesn’t provide support at all for something in the CBOR generic data model, preferred serialization doesn’t place any constraints on you.
>>>>> If you convert all NaNs to quiet NaNs with zero payloads before encoding them in CBOR, preferred serialization will make you emit f97e00 for all of them.
>>>>> 
>>>>> Grüße, Carsten
>>>>> 
>>>> 
>>> 
>> 
>> _______________________________________________
>> CBOR mailing list
>> CBOR@ietf.org
>> https://www.ietf.org/mailman/listinfo/cbor
>