Re: [Cbor] Status of Appendix A in RFC 8949
Anders Rundgren <anders.rundgren.net@gmail.com> Fri, 05 May 2023 19:55 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 9CD3DC17B354 for <cbor@ietfa.amsl.com>; Fri, 5 May 2023 12:55:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 0-32vEUO1iy9 for <cbor@ietfa.amsl.com>; Fri, 5 May 2023 12:55:12 -0700 (PDT)
Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 A7565C17B353 for <cbor@ietf.org>; Fri, 5 May 2023 12:55:12 -0700 (PDT)
Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f19323259dso22328405e9.3 for <cbor@ietf.org>; Fri, 05 May 2023 12:55:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683316511; x=1685908511; 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=7U0dgTgNCHojhg9bk6Aea/PwhqembYujqj4wI46x0T0=; b=GoY+mjUPSCSYAEA3CZAK8IQwNQ6iwFF0mQWWb9899lmnafQYqdMj1h7nIpbZ/oZEw7 ltdMBkLw9FAm7/3MWKVCXP/x039VdpesTWF+ANUQpaRyLRZSaPwTIBUoUfxs0egmrTqE KfH/xMi3oRKTmubgWZZFsnmqURXZ8pcVg5O7eo40kkFFHzjzwerNpQFiWWnfWA86xq/o KYt4NFr9rUv2asR7kOlYpb+vK4muLwFJtzFIuIDmb726iEMa/baMSBbL0VhO4N5j6E25 uPsnr6sTxNodYNJSqiwnS0D0jlfseeCGQP0EkXlxomB9DW2d1BSP+zFGbBQvCKUAZ09p CETA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683316511; x=1685908511; 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=7U0dgTgNCHojhg9bk6Aea/PwhqembYujqj4wI46x0T0=; b=d30hv4272qCb0c9jv2+yqcYtryT0p6+TWZUa548+nriZLUojGlUh//liM2ArvaP57m qAsg00ZUBUZemoyvpn/PlritbCA3b6jo7trA1eBOdb9WpFsfyyQ1AUthAn1yb9foOKyz 1dElktmReIs30YzDIDboZDfmEq8Q0c8uZ8LRUa54k7+E9LfwyKojvkwo4eTINtTGQG9K S5vbk8dngyWX7BQrWp99Rt1SViN4YMi6GvZmLIY4AcUSpae6VP+zCHYN0yejbh85x7sn MbLolOnjA5tjWC8Uw7Ideh33Q1leoou/pDVVpY28C01uG/HDelaWnGhQvW4Cxrs4mfyh l4Eg==
X-Gm-Message-State: AC+VfDwHRPBWfFplDwprCYrLup/elLjOR5P2Moc9SYiFDaWJYtkt2WEr 0MFPYfhuCx4AINR3x0mEbji6HWKi28o=
X-Google-Smtp-Source: ACHHUZ6wRyoFs304HUU1KDWozqn/OLM8ika2+e1OoZQ/sRW6X/hnP7aPTUNclEYH8ds62tcH4aIyJw==
X-Received: by 2002:a1c:750a:0:b0:3f1:72fb:461a with SMTP id o10-20020a1c750a000000b003f172fb461amr1894777wmc.2.1683316510793; Fri, 05 May 2023 12:55:10 -0700 (PDT)
Received: from ?IPV6:2a01:e34:ec4e:5670:b310:ae53:9c1e:16cc? ([2a01:e34:ec4e:5670:b310:ae53:9c1e:16cc]) by smtp.googlemail.com with ESMTPSA id t15-20020a1c770f000000b003ee63fe5203sm8874490wmi.36.2023.05.05.12.55.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 12:55:10 -0700 (PDT)
Message-ID: <d241367a-fd2e-ca8c-fba9-47526eafb31a@gmail.com>
Date: Fri, 05 May 2023 21:55:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1
To: Laurence Lundblade <lgl@island-resort.com>
Cc: Carsten Bormann <cabo@tzi.org>, "cbor@ietf.org" <cbor@ietf.org>
References: <8233a692-df84-f093-96bf-fe99c03adfc5@gmail.com> <31111796-3CF7-4F8F-A805-4CBE1124E9D8@tzi.org> <e16961f5-edbc-233e-3e24-e3a20bc57ea4@gmail.com> <14044F50-CAC6-4F4E-ADC2-D4C545FA5A63@island-resort.com>
Content-Language: en-US
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <14044F50-CAC6-4F4E-ADC2-D4C545FA5A63@island-resort.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/wF8EtcOaCt5MNBAarz09yQemYok>
Subject: Re: [Cbor] Status of Appendix A in RFC 8949
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: Fri, 05 May 2023 19:55:16 -0000
On 2023-05-05 19:29, Laurence Lundblade wrote: > Us humans can indicate the value in question in many ways, “negative four”, “X subtract XIV" (a stretch since Roman’s didn’t have negative numbers), “-4” or “-4.0”. My understanding is that diagnostic notation is just another way to express a value and does NOT require any particular serialization. There’s not any normative requirement that diagnostic notation encode / decode in any particular way (and that is OK). According to Carsten, Appendix A is normative. > It’s up to individual applications to say whether a particular data item is to be encoded as a float or an integer, just like a particular application says whether to use an array or a map, a bstr or a tstr. > > DCBOR changes this by removing this flexibility. It always requires “negative four”, “-4.000000000” or how ever us humans denote it to be encoded as a preferred encoded CBOR integer 0x23. This is a good thing and if you want that behavior use DCBOR. DCBOR will not work for everyone though, so we can’t make it the rule. Some will still want to specify a particular value is always encoded as a float. > > If an application says that an item must be encoded as an integer, then there is the question of 0x23 (preferred) or 0x38 0x03 (not preferred) or a few others. In practice there’s no profile needed here as every widely used encoder will do preferred and also be able to decode non-preferred, but if you want to be super tight in a spec, you should say only preferred encoding. DCCBOR covers this too. > > To summarize: > - int vs float encoding of a number is an application layer decision > - Serialization of CBOR int type 0 and 1 might be a profile issue for some, but isn’t really in practice > - DCBOR gives specific behavior for the two above for those that want it > > LL > > > To give an example from QCBOR. An application calls QCBOREncode_AddInt64() if it wants CBOR integer encoding or QCBOREncode_AddDouble() if it wants float encoding. QCBOREncode_AddDouble() will never produce CBOR integer encoding. There will probably be a new method, QCBOREncode_AddDCBORNumDouble() that will implement the behavior of outputting -4.0000 as a CBOR integer. > >> On May 5, 2023, at 12:27 AM, Anders Rundgren <anders.rundgren.net@gmail.com> wrote: >> >> https://cbor.me produces CBOR data items like 0xf9c400 that are rejected by applications building on https://www.ietf.org/archive/id/draft-mcnally-deterministic-cbor-01.html#name-reduction-of-floating-point >> >> Still both solutions claim to be RFC compliant. >> >> So the question is simply: is a CBOR interoperability profile a suitable work item for the CBOR WG, or should it preferably be taken to OASIS, ETSI, or the W3C? >> >> The target for an interoperability profile are the 80-90% of all developers working with enterprise systems as well as open standards for banking and similar. >> >> thanx, >> Anders >> >> On 2023-05-05 8: >> 52, Carsten Bormann wrote: >>>> In >>>> https://www.rfc-editor.org/rfc/rfc8949.html#name-examples-of-encoded-cbor-da >>>> there is a table with some example values given in Diagnostic Notation and how they are to be encoded in CBOR. >>>> >>>> A problem with this is that the appendix is not marked as "non-normative" although it it is (apparently…) >>> It is not marked as informative because it is normative. >>> As far as examples can be normative, of course. >>> But if your CBOR diagnostic notation implementation does not handle these examples as given, it is not a CBOR diagnostic notation implementation. >>>> based on Rule 2 in section 4.2.2. >>> CBOR diagnostic notation is a readable representation for what is actually being interchanged. >>> If your are changing a 4.0 to a 4, this becomes visible at this level. >>>> Why is that a problem? Well, in >>>> https://www.ietf.org/archive/id/draft-mcnally-deterministic-cbor-01.html#name-reduction-of-floating-point >>>> Rule 1 is (apparently...) applied, which means that "-4.0" would return 0x23 rather than 0xf9c400 proposed in Appendix A as well as by Carsten's CBOR playground (https://cbor.me/) >>> Again, diagnostic notation for 0x23 is “-4”. >>> Both “-4” and “-4.0” actually have multiple encodings each, with a defined preferred encoding. >>>> Taking CBOR to the world of shrink-wrapped software comparable to Open API will undoubtedly require a CBOR interoperability profile. >>> You keep saying that. >>>> In such a profile, deterministic encoding is a side effect. >>> Not at all, as deterministic encoding also does things like determining map ordering, which many applications (and thus their “profiles”) do not need. >>> Grüße, Carsten >> >> _______________________________________________ >> CBOR mailing list >> CBOR@ietf.org >> https://www.ietf.org/mailman/listinfo/cbor >
- [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren
- Re: [Cbor] Status of Appendix A in RFC 8949 Carsten Bormann
- Re: [Cbor] Status of Appendix A in RFC 8949 Carsten Bormann
- Re: [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren
- Re: [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren
- Re: [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren
- Re: [Cbor] Status of Appendix A in RFC 8949 Carsten Bormann
- Re: [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren
- Re: [Cbor] Status of Appendix A in RFC 8949 Carsten Bormann
- Re: [Cbor] Status of Appendix A in RFC 8949 Laurence Lundblade
- Re: [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren
- Re: [Cbor] Status of Appendix A in RFC 8949 Brian E Carpenter
- Re: [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren
- Re: [Cbor] Status of Appendix A in RFC 8949 Laurence Lundblade
- Re: [Cbor] Status of Appendix A in RFC 8949 Anders Rundgren