Re: [Cbor] my (WGLC re-)views on error processing in RFC7049bis and future-proofing

Laurence Lundblade <lgl@island-resort.com> Fri, 22 May 2020 19:22 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 62A2B3A00B2 for <cbor@ietfa.amsl.com>; Fri, 22 May 2020 12:22:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jpREezTZJ1iS for <cbor@ietfa.amsl.com>; Fri, 22 May 2020 12:22:32 -0700 (PDT)
Received: from p3plsmtpa12-01.prod.phx3.secureserver.net (p3plsmtpa12-01.prod.phx3.secureserver.net [68.178.252.230]) (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 53BDD3A005B for <cbor@ietf.org>; Fri, 22 May 2020 12:22:32 -0700 (PDT)
Received: from [192.168.1.78] ([76.167.193.86]) by :SMTPAUTH: with ESMTPA id cDFWjEzf3dUjIcDFXj4ZMT; Fri, 22 May 2020 12:22:31 -0700
X-CMAE-Analysis: v=2.3 cv=V4wDLtvi c=1 sm=1 tr=0 a=t2DvPg6iSvRzsOFYbaV4uQ==:117 a=t2DvPg6iSvRzsOFYbaV4uQ==:17 a=l70xHGcnAAAA:8 a=_O5UbtG09yanlUfFYO0A:9 a=QEXdDO2ut3YA:10 a=aCfU-6BJkAhjHx_qEzUA:9 a=ltQafFx8tGN9ivf1:21 a=_W_S_7VecoQA:10 a=JtN_ecm89k2WOvw5-HMO:22
X-SECURESERVER-ACCT: lgl@island-resort.com
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <5DBD6E24-BD31-493A-84DD-852D8985DE93@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_584850CF-E0DE-414E-B355-19A8F5AA2690"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Fri, 22 May 2020 12:22:30 -0700
In-Reply-To: <4347.1590102644@dooku>
Cc: Carsten Bormann <cabo@tzi.org>, cbor@ietf.org
To: Michael Richardson <mcr+ietf@sandelman.ca>
References: <17300.1588779159@localhost> <38BB6FFF-737F-4C11-AD7A-DA3F28A9F570@tzi.org> <CANh-dXkdjMyO=WFUxrF06OfP+RE9v11unKJXL8P3UtEe+prV1w@mail.gmail.com> <13690.1588894939@localhost> <CANh-dXmjD=RCwh7ExjSvFx+5ciew+eqHoVS88OommQ2xVnX5=Q@mail.gmail.com> <2963.1589473899@localhost> <377E8232-0638-419F-8D79-710F42C2B4E3@tzi.org> <4347.1590102644@dooku>
X-Mailer: Apple Mail (2.3445.104.11)
X-CMAE-Envelope: MS4wfNsLXEG6T8IpKAL794tbp9l2H4tGoMe31lKs65xdG5NxOiBZ72ODQu+S5fLXMuLt+KhEGrwKsd2brQmw/kXEDXN6ooKO56QAaNd0dtbjvuGAdHtemPqY oGEpPWcVJPj3MGRXRy8Gtn66MV0WPZKyVGv6xDEXRIYIdsFkSzEBpZMLSqp3h5pFoaa0VAJ67+Zezws0QDPysDfxvuufvJvXWiqvhJUu1TkeZRnjzs7/Czyd
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/xv3kxHOYonvKcwsWbYrAqgd0cro>
Subject: Re: [Cbor] my (WGLC re-)views on error processing in RFC7049bis and future-proofing
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
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, 22 May 2020 19:22:35 -0000


> On May 21, 2020, at 4:10 PM, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
> 
>>> Why can't we use decimal fractions, or bigfloats for time?
> 
>> That may have been a mistake (which is one reason we have tag 1001
>> now).  The WG has generally taken a dim view on extending the domain
>> (allowable syntax for tag content) for a tag, so we can’t “fix” that —
>> note that for the date tag, we have taken the decision not to reuse one
>> tag for two different tag content syntaxes either.
> 
> okay.

I think the main time type should have solely been an integer. You can express +/- 500 billion years to 1 second accuracy with 64 bits. The earth is only 4.5 billions years old so it is even good enough for most science. It’s only really odd scientific use cases that would need anything else as far as I can imagine.

I would disallow float dates in the main time type. Floats only enable microsecond accuracy. They give no greater range that is of much use. Also, they have less precision and the precision varies by year.

This is about code size and HW support. You don’t want to have to implement decoding of a variety of time formats for 0.0001% of the use cases. It is also a pain for every protocol to say “use the time tag, but disallow floats”. The CDDL type for time has this problem. Maybe should probably have a new CDDL type “simple_time” or that is tag 1, but disallows float.

Then I’d create a second Swiss army knife time format that can use floats, bignums, decimal fractions and so on. I’ve been playing with implementations of conversions of these types and so far it takes 500-1000 bytes of code to convert all of them in some form or other.

I’m kind of in favor of defining yet another time tag that just allows integers, but the current epoch time tag has been around for a long time now so it seems ugly to do so.

In reality, probably everyone will just implement 64-bit only time as sort of an unstated best practice and it will be OK.

LL