Re: [Cbor] Reminder and call for agenda: CBOR WG Virtual Meeting on 2023-05-31

Anders Rundgren <anders.rundgren.net@gmail.com> Sat, 27 May 2023 04:46 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 1FF8FC14CF1A for <cbor@ietfa.amsl.com>; Fri, 26 May 2023 21:46:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 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_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 T-z2XJ8dm4Ah for <cbor@ietfa.amsl.com>; Fri, 26 May 2023 21:46:09 -0700 (PDT)
Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 7E12DC14F736 for <cbor@ietf.org>; Fri, 26 May 2023 21:46:09 -0700 (PDT)
Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-30789a4c537so830473f8f.0 for <cbor@ietf.org>; Fri, 26 May 2023 21:46:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685162768; x=1687754768; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VDgwaWxMFuB7L39tp3TiL8HK/4yFaim/AMh+Isg9Y1A=; b=mqZRftjBR8uWeOZKIFfzlx88ys3jH/M1Jsit9tCsfR7synV4RDc0Z0m81eoc1nZJRd qDqK3T6mQ7flMxeI0Nt2AwHylIDlv+AfN+LU4GFi0LxdbVsnN+02y0uQaWILBOhB5M53 i46Dl5Lw7Ftm881psGX9XDZ5pb5BivB+Q1ILQ2QjuPEDss7EDsHAKfly99VtXga6RtC4 HzH2VLcep5yuAUq08Es4AT7W/lc9b3y8BEUPfh478QVU8PRyTYzgFNj8kVYxLk8DhLWz Qys19erfXANl4czR0mXJq3sWW8XrfLAcjm3yDuNWR96Wvq9SMN9FQjX1r96l3frENATW /w6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685162768; x=1687754768; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VDgwaWxMFuB7L39tp3TiL8HK/4yFaim/AMh+Isg9Y1A=; b=Qcj3AJYtyCFfO5Avz7piCPtOMnWWkjcvUgNEozfnIWObti4JTg8Tic87xKV/IFj5l7 Y9Fu5JjXU8I6tiVzerGnmLZXZvKbCukHAUFsYeNrIc5zi7Wq5nXAotyM2TrwmVIduGKH QeB6xa9+5iluiNizSnSshCkZ8OTp8QlvqNQGCRV8k0TMCGH0flLh3bN61ndHrZp4FK8x sGC+N4EyZkkX26raFil9qurcUKTPHyzNuNIDGdUy0q9PjtEA2wJpiLkNAXRzbbM4qJy0 RpV+I42YjZce9McQhr66ZfeeABNoM0sUQ4sgKNa1Cosukdz5mSIEKvJBU5mV6sVBv1rP Tp7A==
X-Gm-Message-State: AC+VfDxbWhqRYlZMCQr4xI/0i7FjvY3b4zggScohbjI7jegWLvYwRM3q K8RFPnhA5i/KvILo0rRNf4gAoLr9OJw=
X-Google-Smtp-Source: ACHHUZ5/cya5dUlSy8zkg2QeXKAq+ipOUDw+eKLVM2WCBUBqfp1+IvJ6TlUVuHQKuLomjawm2ijy4A==
X-Received: by 2002:a05:6000:4c8:b0:30a:ceb3:26bd with SMTP id h8-20020a05600004c800b0030aceb326bdmr3206282wri.56.1685162767635; Fri, 26 May 2023 21:46:07 -0700 (PDT)
Received: from ?IPV6:2a01:e34:ec4e:5670:d164:cd96:7340:68d6? ([2a01:e34:ec4e:5670:d164:cd96:7340:68d6]) by smtp.googlemail.com with ESMTPSA id b3-20020a5d5503000000b002ca864b807csm7032703wrv.0.2023.05.26.21.46.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 May 2023 21:46:07 -0700 (PDT)
Message-ID: <4d846b33-40f2-4c10-6647-68f3b448f4cd@gmail.com>
Date: Sat, 27 May 2023 06:46:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
Content-Language: en-US
To: Emile Cormier <emile.cormier.jr@gmail.com>
Cc: cbor@ietf.org
References: <CALaySJJ8kwtR8y9us4Qi49KFAYwus0uBoRi49rMsEO4smwfKSA@mail.gmail.com> <CALaySJJqusJ=6X06Ee4UrhQp236h079Ng3MLbTgEzEd4=9EUhQ@mail.gmail.com> <CALaySJLGk9Ztg_kMmvk=PW+=2SLf1Bkb-kmQyPz=Dbs8=DuXMA@mail.gmail.com> <CALaySJLfJqcdy+GbpC0U44t1wi4p+zf7ObogAJFZuVheZ1UC0w@mail.gmail.com> <CALaySJ+eHZ5EeRM8wrO3o7b3UVzMwwAn+6Kuq_wMDLBxtOQmiw@mail.gmail.com> <CALaySJKOqZ0wp6ZBUTo=z6_pLKbQfekfZwJapOzRLWBvAjDiCA@mail.gmail.com> <CALaySJJR0ouauKKsy2uyYVtT2nsuawXGL_JKa0jLFNbxQCHLAw@mail.gmail.com> <118bed90-9c98-0da9-eefb-906e5b714369@gmail.com> <CAM70yxCJSF=9aDcpSOTQvZuT3rTUxVZZ5nJao-ANbDZ4U6Y-HQ@mail.gmail.com> <6aa6c6f6-632a-c621-5906-a8d8ab6c9fd9@gmail.com> <CAM70yxBNa0TJ7u9Tmq1CmjY57kKuDgrnvrdSzOuCLYipA0EMww@mail.gmail.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <CAM70yxBNa0TJ7u9Tmq1CmjY57kKuDgrnvrdSzOuCLYipA0EMww@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/2LdLs7dnK5h_KA1vt7xYgRrmPv0>
Subject: Re: [Cbor] Reminder and call for agenda: CBOR WG Virtual Meeting on 2023-05-31
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: Sat, 27 May 2023 04:46:14 -0000

On 2023-05-27 6:09, Emile Cormier wrote:
> On Sat, May 27, 2023 at 12:47 AM Anders Rundgren <anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>> wrote:
> 
>     My hands-on experience with deterministic encoding (using Java, C++, and JavaScript), indicates that it comes practically free of cost.   It only gets slightly more complex if provided as an option.
> 
> 
> I fail to see how deterministic encoding is free of cost when it comes to maps. For example, an ordered Map<int, T> in a programming language will be sorted numerically from most negative to most positive, whereas the order is different when sorted lexicographically by encoded bytes. So the encoded, unsorted map (or at least the encoded keys with back pointers) must be temporarily stored somewhere so that it can be sorted before being sent over the wire. This is not free! :-)

Right you are! This is indeed correct for encoders.  However, Ffor decoders deterministic encoding only requires saving the last key since keys [MUST] come in ascending order.

FWIW, I don't use Map objects in my high-level encoder implementations, only single linked lists + compare.  This is the only code that is slightly messy.

For very low-level encoders you may delegate the map sorting to the programmer 😱
https://github.com/cyberphone/D-CBOR/blob/main/d-cbor-4-constrained-devices.md
Ugly? Yes! Working? Presumably 😎

In case you want to test the proposed CBOR encoding scheme in practice, here is an on-line reference implementation:
https://test.webpki.org/csf-lab/convert

Anders