Subject: Re: [quicwg/base-drafts] Time format (#109)

From: Christian Huitema <[email-masked]>
Date: Tue, 04 Jul 2017 14:08:07 +0000 (UTC)

Here are the test vectors that I use in my implementation:
~~~
struct _float16test_st {
    uint64_t n64;
    uint16_t f16;
    uint64_t n64_decoded;
};

static struct _float16test_st float16_test_case[] = {
    { 0, 0, 0},
    { 1, 1, 1},
    { 0x7FF, 0x7FF, 0x7FF},
    { 0x800, 0x800, 0x800},
    { 0x801, 0x801, 0x801 },
    { 0xFFF, 0xFFF, 0xFFF },
    { 0x1000, 0x1000, 0x1000 },
    { 0x1001, 0x1000, 0x1000 },
    { 0x1002, 0x1001, 0x1002 },
    { 0x2004, 0x1801, 0x2004 },
    { 0x10000000, 0x9000, 0x10000000 },
    { 0x10080000, 0x9004, 0x10080000 },
    { 0x3FFC0000000, 0xFFFF, 0x3FFC0000000 },
    { 0x40000000000, 0xFFFF, 0x3FFC0000000 },
    { 0x7F00000000000, 0xFFFF, 0x3FFC0000000 }
};

static size_t nb_float16_test_case = sizeof(float16_test_case) / sizeof(struct _float16test_st);
~~~
Hope it helps...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/109#issuecomment-312887072

---

From: MikkelFJ <[email-masked]>
Date: Tue, 04 Jul 2017 16:06:42 +0000 (UTC)

I updated the gist to include the above tests as an alternative to the existing tests, and a shell script to run them.

The original tests are more thorough but I like the triple format and a simpler test structure for reference use.

More vectors can be added as needed. The old tests remain for now.

https://gist.github.com/mikkelfj/64deb01b86d68f3d7aacff4b113c22d8

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/109#issuecomment-312912022

---

From: MikkelFJ <[email-masked]>
Date: Tue, 04 Jul 2017 09:15:40 -0700

BTW: I suggest avoiding the name float16 or f16 - there are numerous 16bit floating formats around for computer graphics, and this format is different, and decidedly unsigned. GQUIC and GOQUIC uses the term ufloat16.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/109#issuecomment-312913438

---

From: MikkelFJ <[email-masked]>
Date: Tue, 04 Jul 2017 10:06:19 -0700

I have changed to text description and implementation very slightly: The test vector would originally have encoded `{k', v, k}` but I now use `{n, v, k}` for input, encoded and decoded value respectively. I also moved the old test code to a seperate file in the gist - the names are currently not consistent there.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/109#issuecomment-312920779