Re: [Cbor] I-D Action: draft-ietf-cbor-array-tags-06.txt

Thiago Macieira <thiago.macieira@intel.com> Wed, 14 August 2019 15:01 UTC

Return-Path: <thiago.macieira@intel.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 EB6481208B6 for <cbor@ietfa.amsl.com>; Wed, 14 Aug 2019 08:01:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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 whz6-4dwvXAz for <cbor@ietfa.amsl.com>; Wed, 14 Aug 2019 08:01:41 -0700 (PDT)
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 06CC71208C0 for <cbor@ietf.org>; Wed, 14 Aug 2019 08:01:40 -0700 (PDT)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 08:01:40 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.64,385,1559545200"; d="scan'208";a="170810176"
Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga008.jf.intel.com with ESMTP; 14 Aug 2019 08:01:39 -0700
Received: from tjmaciei-mobl1.localnet (10.251.26.59) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 14 Aug 2019 08:01:39 -0700
From: Thiago Macieira <thiago.macieira@intel.com>
To: cbor@ietf.org
Date: Wed, 14 Aug 2019 08:01:39 -0700
Message-ID: <47553393.hEemA0blV4@tjmaciei-mobl1>
Organization: Intel Corporation
In-Reply-To: <156579180295.30485.7938673889841914143@ietfa.amsl.com>
References: <156579180295.30485.7938673889841914143@ietfa.amsl.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
X-Originating-IP: [10.251.26.59]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/mFSy75eleaFGJCMDEPwFGO_zad8>
Subject: Re: [Cbor] I-D Action: draft-ietf-cbor-array-tags-06.txt
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: Wed, 14 Aug 2019 15:01:44 -0000

On Wednesday, 14 August 2019 07:10:03 PDT internet-drafts@ietf.org wrote:
> Abstract:
>    The Concise Binary Object Representation (CBOR, RFC 7049) is a data
>    format whose design goals include the possibility of extremely small
>    code size, fairly small message size, and extensibility without the
>    need for version negotiation.
> 
>    The present document makes use of this extensibility to define a
>    number of CBOR tags for typed arrays of numeric data, as well as two
>    additional tags for multi-dimensional and homogeneous arrays.  It is
>    intended as the reference document for the IANA registration of the
>    CBOR tags defined.

I'm missing the ability to tell a binary16 floating point ("half float") from 
the truncated binary32 float ("bfloat16"). Those have become relevant in the 
AI and machine learning industries to the point of specialised instructions 
for them coming to CPU processors. 

One idea would be to use the sign bit with binary16 to indicate that it's a 
bfloat16 instead. That would make tags 88 and 92 be used
	0x40[constant] + 0x10[float] + 0x8[sign] = 0x58 = 88
	0x40[constant] + 0x10[float] + 0x8[sign] + 0x4[endian] = 0x5c = 92

If we add 89-91 as reserved, that means the table will be allocating 29 
entries, plus tags 40 and 41 in the 1-byte range.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products