Re: [tsvwg] Eric Rescorla's Discuss on draft-ietf-tsvwg-rlc-fec-scheme-09: (with DISCUSS and COMMENT)

Eric Rescorla <ekr@rtfm.com> Wed, 10 October 2018 01:16 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tsvwg@ietfa.amsl.com
Delivered-To: tsvwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6B925130E48 for <tsvwg@ietfa.amsl.com>; Tue, 9 Oct 2018 18:16:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.com
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 RDtk2iaZPJRn for <tsvwg@ietfa.amsl.com>; Tue, 9 Oct 2018 18:16:45 -0700 (PDT)
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9F974130E46 for <tsvwg@ietf.org>; Tue, 9 Oct 2018 18:16:41 -0700 (PDT)
Received: by mail-lj1-x22e.google.com with SMTP id z21-v6so3329057ljz.0 for <tsvwg@ietf.org>; Tue, 09 Oct 2018 18:16:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ToEdzRBUoSNw3hB2vkgDUbGFA12Psm5dc9GizT6trNM=; b=Vhj1OrgnB6McqmdmCIvfatJGcOd+oHEKyvIziabRQN6ZVx/N52vr3n+vALcJC4pk1/ rnobrn4Ny3R1QW/J7XxWC6oaYKvNKXZ5mqKJiKIiOwWsMGDFx2f+EVhiOlmoCIrDzbfG r7D9hYV+HGqiBA8goPm3LP0a81caPEi7CTQ6FbVgBYL1YNRouRndcG9r8Rsg+gP1NLwF JEQuSl7KWFqKFJC5KovXC2z8IgCG1sXzUov3FRKc1NM8z8GrcUvJszsliDrD2T9/Gmsn q55PoFGL6O49XD46hyAlgtnIHRLEWdJ0ZtwarZ+LeXg1bP4rfmcMsS37EBxZCCbQnbaP BQJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ToEdzRBUoSNw3hB2vkgDUbGFA12Psm5dc9GizT6trNM=; b=eIfMqXqxnPf+YqZ+rk7ry4zgICgDLsHq5WDecsODGa6KgfN4BiyMGJTQcYqW3rxXoZ X/agaerZZG19bah0Eruqm0aM8TaQVuBfEumTNDNl20a9VfMsRHyl48dzP+rXdK+Y90Kb NrIirzFDhC4Dq5xnvcroCVnF+PQUb3GdW3oVk1Iyw8LGrW3PSHF9vf9tsN6huwzaTYAx gA3UW5Et+8voQLtB25uXtDt9TGEhlZSKPmDIKFvB8EgBbREeM8CF5ByL1T4OZfrOWyPm xd0l+YmDjwgcrX2AyzG6y/bVqY+8W1F77FSKP5nzVHcbl/iJZLz+4gXPihaICynpkoPn oHig==
X-Gm-Message-State: ABuFfoh83er+kmV8/1p4aRQ2GztOALyen1qrj+U3WHsRGQ+HX+PU8yBf CUUYf6xmMaEQN2BLLRCrTSmqAQv0gUmirkkeIlB03A==
X-Google-Smtp-Source: ACcGV60KmYydzRdkZLPt8HIvnKC7A/8sgXo3re0jhF/wFxWZdaLNqOw/wlxkutPUd2LRb2Z4C+tcg+6XDOZEvJcx9tw=
X-Received: by 2002:a2e:544f:: with SMTP id y15-v6mr20669310ljd.51.1539134199634; Tue, 09 Oct 2018 18:16:39 -0700 (PDT)
MIME-Version: 1.0
References: <153913354581.10680.5559650851083664752.idtracker@ietfa.amsl.com>
In-Reply-To: <153913354581.10680.5559650851083664752.idtracker@ietfa.amsl.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Tue, 09 Oct 2018 18:16:02 -0700
Message-ID: <CABcZeBPGRU_YTsYzq1NGdr-sm2Ljq4OKRud+wFfBwG1A670oyg@mail.gmail.com>
To: IESG <iesg@ietf.org>
Cc: wes@mti-systems.com, tsvwg-chairs <tsvwg-chairs@ietf.org>, "Black, David" <david.black@dell.com>, tsvwg@ietf.org, draft-ietf-tsvwg-rlc-fec-scheme@ietf.org, Thomas Daede <tdaede@mozilla.com>
Content-Type: multipart/alternative; boundary="0000000000003b33c80577d59bcf"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/8FLzwPobKfRh2Rwb6dxWqYtiI7U>
Subject: Re: [tsvwg] Eric Rescorla's Discuss on draft-ietf-tsvwg-rlc-fec-scheme-09: (with DISCUSS and COMMENT)
X-BeenThere: tsvwg@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Transport Area Working Group <tsvwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tsvwg/>
List-Post: <mailto:tsvwg@ietf.org>
List-Help: <mailto:tsvwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Oct 2018 01:16:47 -0000

I looped in Thomas Daede, who works on codecs here at Mozilla. He says
about the cast in S 12.2.

"It is deterministic, but it relies on implementation-defined behavior -
in particular, the format of a double precision float. e.g. you would
need to specify C99 Annex F. The most important platform where this
isn't the case is 32-bit x86.

It would be much better if you could do it with fixed point arithmetic."

-Ekr


On Tue, Oct 9, 2018 at 6:05 PM Eric Rescorla <ekr@rtfm.com> wrote:

> Eric Rescorla has entered the following ballot position for
> draft-ietf-tsvwg-rlc-fec-scheme-09: Discuss
>
> When responding, please keep the subject line intact and reply to all
> email addresses included in the To and CC lines. (Feel free to cut this
> introductory paragraph, however.)
>
>
> Please refer to https://www.ietf.org/iesg/statement/discuss-criteria.html
> for more information about IESG DISCUSS and COMMENT positions.
>
>
> The document, along with other ballot positions, can be found here:
> https://datatracker.ietf.org/doc/draft-ietf-tsvwg-rlc-fec-scheme/
>
>
>
> ----------------------------------------------------------------------
> DISCUSS:
> ----------------------------------------------------------------------
>
> Rich version of this review at:
> https://mozphab-ietf.devsvcdev.mozaws.net/D3423
>
>
> I do not believe that this specification is sufficiently precise to be
> interoperably implemented.
>
> DETAIL
> S 3.4.
> >      value, in addition to the maximum FEC-related latency budget
> >      (Section 3.1).
> >
> >   3.4.  Pseudo-Random Number Generator (PRNG)
> >
> >      The RLC FEC Schemes defined in this document rely on the TinyMT32
>
> What is the normative reference here? We can't really plausibly
> normatively reference a github link without even a version hash. Is
> the code in the appendix the normative description of the algorithm.
>
>
> S 3.5.
> >      These considerations apply both the RLC over GF(2) and RLC over
> >      GF(2^^8), the only difference being the value of the m parameter.
> >      With the RLC over GF(2) FEC Scheme (Section 5), m MUST be equal to
> 1.
> >      With RLC over GF(2^^8) FEC Scheme (Section 4), m MUST be equal to 8.
> >
> >      <CODE BEGINS>
>
> Again, is the normative reference here the code? I note that this code
> contains references to constants which are not defined here and
> therefore will not compile
>
>
> S 6.2.
> >      ew_size coding coefficients that are computed by the same
> coefficient
> >      generation function (Section Section 3.5), using the repair key and
> >      encoding window descriptions carried in the Repair FEC Payload ID.
> >      Whenever possible (i.e., when a sub-system covering one or more lost
> >      source symbols is of full rank), decoding is performed in order to
> >      recover lost source symbols.  Each time an ADUI can be totally
>
> You should provide an algorithm for solving this system or at least a
> pointer to a description of how to do so
>
>
> S 12.2.
> >    #define TINYMT32_MEXP 127
> >    #define TINYMT32_SH0 1
> >    #define TINYMT32_SH1 10
> >    #define TINYMT32_SH8 8
> >    #define TINYMT32_MASK UINT32_C(0x7fffffff)
> >    #define TINYMT32_MUL (1.0f / 16777216.0f)
>
> ANSI C doesn't specify any particular method of computing floating
> point arithmetic, so I don't believe that any of this code is portably
> deterministic.
>
>
> S 12.2.
> >        s->status[0] = s->status[1];
> >        s->status[1] = s->status[2];
> >        s->status[2] = x ^ (y << TINYMT32_SH1);
> >        s->status[3] = y;
> >        s->status[1] ^= -((int32_t)(y & 1)) & s->mat1;
> >        s->status[2] ^= -((int32_t)(y & 1)) & s->mat2;
>
> You also can't assume that negative numbers have any particular
> representation (e.g., twos complement) so this XOR is not
> deterministic.
>
>
> ----------------------------------------------------------------------
> COMMENT:
> ----------------------------------------------------------------------
>
> S 3.4.
> >      RLC FEC Schemes defined in this document, the following parameter
> set
> >      MUST be used:
> >
> >      o  mat1 = 0x8f7011ee = 2406486510;
> >      o  mat2 = 0xfc78ff1f = 4235788063;
> >      o  tmat = 0x3793fdff = 932445695.
>
> What is the significance of the semicolons versus periods?
>
>
>
> S 3.5.
> >       * provided with the appropriate number of coding coefficients to
> >       * use for the repair symbol key provided.
> >       *
> >       * (in) repair_key    key associated to this repair symbol. This
> >       *                    parameter is ignored (useless) if m=2 and
> dt=15
> >       * (in) cc_tab[]      pointer to a table of the right size to store
>
> This is not just in, because you are writing it. It is rather in/out.
>
>
> S 3.5.
> >                      if (tinymt32_rand(&s, 16) <= dt) {
> >                          cc_tab[i] = (uint8_t) 1;
> >                      } else {
> >                          cc_tab[i] = (uint8_t) 0;
> >                      }
> >                  }
>
> This code can be simplified either by using the ternary operator, as
> in:
>
> ```
> cc_tab[i] = tinymt32_rand(&s, 16) <= dt) ? 1 : 0;
> ```
>
> Actually, you could just do:
>
> ```
> cc_tab[i] = tinymt32_rand(&s, 16) <= dt);
> ```
>
> Because C guarantees that comparison operators produce 1 for true and
> 0 for false.
>
>
> S 3.5.
> >                      do {
> >                          cc_tab[i] = (uint8_t) tinymt32_rand(&s, 256);
> >                      } while (cc_tab[i] == 0);
> >                  }
> >              } else {
> >                  /* here a certain fraction of coefficients should be 0
> */
>
> It's not a certain fraction, it's just a certain probability.
>
>
> S 12.2.
> >     *    Erlang", ACM 11th SIGPLAN Erlang Workshop (Erlang'12),
> >     *    September, 2012.
> >     */
> >    #define TINYMT32_MAT1_PARAM     0x8f7011ee
> >    #define TINYMT32_MAT2_PARAM     0xfc78ff1f
> >    #define TINYMT32_TMAT_PARAM     0x3793fdff
>
> Is there a reason not to have these be const uint32_t?
>
>
> S 12.2.
> >        s->status[0] = seed;
> >        s->status[1] = s->mat1 = TINYMT32_MAT1_PARAM;
> >        s->status[2] = s->mat2 = TINYMT32_MAT2_PARAM;
> >        s->status[3] = s->tmat = TINYMT32_TMAT_PARAM;
> >        for (int i = 1; i < MIN_LOOP; i++) {
> >            s->status[i & 3] ^= i + UINT32_C(1812433253)
>
> This constant should not be int he code like this.
>
>
> S 12.2.
> >    /**
> >     * This function outputs an integer in the [0 .. maxv-1] range.
> >     * @param s     pointer to tinymt internal state.
> >     * @return      32-bit unsigned integer between 0 and maxv-1
> inclusive.
> >     */
> >    uint32_t tinymt32_rand (tinymt32_t * s, uint32_t maxv)
>
> This casting is extremely scary. Are you sure that this code is
> portably deterministic?
>
>
>