Re: [Cbor] CBOR-packed: comments and function tag suggestion

Carsten Bormann <cabo@tzi.org> Sun, 25 February 2024 14:35 UTC

Return-Path: <cabo@tzi.org>
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 55D5FC14F5FA for <cbor@ietfa.amsl.com>; Sun, 25 Feb 2024 06:35:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.907
X-Spam-Level:
X-Spam-Status: No, score=-1.907 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 dvxxyMF3oQN0 for <cbor@ietfa.amsl.com>; Sun, 25 Feb 2024 06:35:07 -0800 (PST)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 E450EC14F5EC for <cbor@ietf.org>; Sun, 25 Feb 2024 06:35:04 -0800 (PST)
Received: from eduroam-0148.wlan.uni-bremen.de (eduroam-0148.wlan.uni-bremen.de [134.102.16.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4TjR9J4rmBzDCdY; Sun, 25 Feb 2024 15:35:00 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <1edff8c7-7975-4ede-9737-eac0165ef1b3@tu-dresden.de>
Date: Sun, 25 Feb 2024 15:35:00 +0100
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 730564500.1391799-34b151e5a0fabfd90fb71191c6dc0379
Content-Transfer-Encoding: quoted-printable
Message-Id: <3C49548A-B6F4-4980-9FAF-57B511404E9D@tzi.org>
References: <1edff8c7-7975-4ede-9737-eac0165ef1b3@tu-dresden.de>
To: Mikolai Gütschow <mikolai.guetschow@tu-dresden.de>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/50HzmFo41eWMVG0mvmz20nANEcU>
Subject: Re: [Cbor] CBOR-packed: comments and function tag suggestion
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: Sun, 25 Feb 2024 14:35:11 -0000

Hi Mikolai,

I’m finally getting to your detailed editorial comments.

> On 2024-02-19, at 13:52, Mikolai Gütschow <mikolai.guetschow@tu-dresden.de> wrote:
> […]
> 
> - The abstract is repeated literally as the first three paragraphs of the introduction. Not sure whether this is good practice, just wanted to point it out.

It is a good placeholder until we know what additional information beyond the abstract should be in the introduction.
We have published RFCs doing this, so it is not fundamentally wrong; it just turns out at some point one wants to write more, make use of references, etc. in the introduction, so it’s not normally the way things et published.

I have started a PR [1] for addressing the following suggestions:

[1]: 

> - The terminology section doesn't match the current draft very well:
>  - some terms are (almost) not used in the remaining document: "affix" (only mentioned in parenthesis in introduction),

Indeed, this now has been generalized into argument, so we don’t need this any more.

> "expansion" (only used once at the end of 3.1, while it is described as "reconstruction of the original data item" in 2.{2,3}),

I aligned that into using “reconstruction” everywhere.

> "function reference" (nowhere else used, and also specified to allow function tags for both the argument and the rump which contradicts the description in 2.3)

Well, it is allowed for both, just not at the same time (the function tag is extracted from the left hand side, which is the argument for straight references and the rump for inverted references).  Fixed.

We haven’t use the potential of the term “function reference” to simplify the wording in various places; I cleaned up the definition to define “function tag” for now.  We might still want to clean up the places using the phrase “involving a function tag” to use a term such as “function reference”.

>  - terms that appear quite frequently in the document are missing: "rump item" (interchangeably referred to as "rump"/"rump item"/"rump data item" throughout the draft), "function tag", "straight/inverted reference", "original data item"

I defined a few terms, also adding “packed data item”, and sticking with “rump” (which I think is still OK in the combinations you list).

>  - Renaming "Current Set" to something like "Active (Packing) Tables" would appear more straightforward to me.

I called it “active set” because that is grammatically easier to handle.

> - Section 2.3 states:
> > When reconstructing the original data item, such a reference is replaced by a data item constructed from the argument data item found in the table (argument, which might need to be recursively unpacked first) and the rump data item (rump, again possibly recursively unpacked).
> The rump data item might be recursively _packed_ or "need to be recursively _unpacked_"

Fixed.

> - Table 3 appears to make a distinction between "straight rump" and "inverted rump", although the distinction really comes from the involved tag ("straight/inverted reference"). Maybe just rename to "rump" (or the common term, cf. above) in the table.

Fixed.

> - straight/inverted and prefix/suffix seem to be used as synonyms, I would drop usage of prefix/suffix unless maybe for illustrative purpose in Appendix A (Examples).
> 
> - Section 3.1: I got a bit confused while reading the tag definitions for 113 and 1113 as they are described with almost identical words. I would suggest to add "respectively" to the definition of 1113.
> 
> - The examples in section 4.1 would result in the same original data item without usage of the join/ijoin function tags due to the definition of concatenation in 2.4. I think it would be worth pointing that out in 4.1.

TODO (bursting my timebox now…)

> - Section 6.1 registers the straight/inverted tags for "text string, byte string, array, map, tag" while Section 2.3 explicitly mentions an "integer rump" - should the enclosed data item just allow any type?

Tag 6 does allow any type, but does mean something different for integers and for other types — you need to use tag 224 for integers.

(Discussion of record tag skipped, as there is a separate PR for those.)

> In general, irrespective of whether the record tag is included in the document or not, I think it should refer to or mention other tags that have been defined with data compression in mind, potentially pointing out their weaknesses (e.g. undefined CBOR order in maps). I came across stringref [4] and cbor-records [2], not sure if there are more. In any case, people reading a CBOR packed RFC will probably be interested in those alternatives and their trade-offs, too.

Leaving this for another editorial round.

Grüße, Carsten


> Best
> Mikolai Gütschow
> 
> [1] https://github.com/mguetschow/NanoCBOR/tree/packed-cbor
> [2] https://github.com/kriszyp/cbor-records
> [3] https://mailarchive.ietf.org/arch/msg/cbor/IEfXAOBMYPfA8s5UACxCUNk0ddU/
> [4] http://cbor.schmorp.de/stringref
> 
> 
> --
> 
> Mikolai Gütschow
> TU Dresden, Chair of Distributed and Networked Systems
> https://tu-dresden.de/cs/netd/about/team/guetschow
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor