Re: [ogpx] type-system : guidance for binary serialization implementers

"Hurliman, John" <john.hurliman@intel.com> Mon, 29 March 2010 18:10 UTC

Return-Path: <john.hurliman@intel.com>
X-Original-To: ogpx@core3.amsl.com
Delivered-To: ogpx@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 3B0163A684B for <ogpx@core3.amsl.com>; Mon, 29 Mar 2010 11:10:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.98
X-Spam-Level:
X-Spam-Status: No, score=-3.98 tagged_above=-999 required=5 tests=[BAYES_05=-1.11, DNS_FROM_OPENWHOIS=1.13, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FjX2DCwYQLLN for <ogpx@core3.amsl.com>; Mon, 29 Mar 2010 11:10:40 -0700 (PDT)
Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by core3.amsl.com (Postfix) with ESMTP id 3864C3A67AC for <ogpx@ietf.org>; Mon, 29 Mar 2010 11:10:38 -0700 (PDT)
Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 29 Mar 2010 11:11:06 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.51,329,1267430400"; d="scan'208";a="259927035"
Received: from rrsmsx604.amr.corp.intel.com ([10.31.0.170]) by azsmga001.ch.intel.com with ESMTP; 29 Mar 2010 11:11:06 -0700
Received: from rrsmsx601.amr.corp.intel.com (10.31.0.151) by rrsmsx604.amr.corp.intel.com (10.31.0.170) with Microsoft SMTP Server (TLS) id 8.2.176.0; Mon, 29 Mar 2010 12:11:06 -0600
Received: from rrsmsx506.amr.corp.intel.com ([10.31.0.39]) by rrsmsx601.amr.corp.intel.com ([10.31.0.151]) with mapi; Mon, 29 Mar 2010 12:11:05 -0600
From: "Hurliman, John" <john.hurliman@intel.com>
To: Meadhbh Hamrick <ohmeadhbh@gmail.com>, Dahlia Trimble <dahliatrimble@gmail.com>
Date: Mon, 29 Mar 2010 12:11:00 -0600
Thread-Topic: [ogpx] type-system : guidance for binary serialization implementers
Thread-Index: AcrO9yYbodJ32iABRmKkcz7nx9qaPgAc8hWg
Message-ID: <62BFE5680C037E4DA0B0A08946C0933DCB5FB6AD@rrsmsx506.amr.corp.intel.com>
References: <b325928b1003281034s55fae732n7be979446759bd12@mail.gmail.com> <ab84ceb11003282104mc2b02cfg326bc163d0fd279e@mail.gmail.com> <b325928b1003282119w19949ca4l9998de8cba4aa8d0@mail.gmail.com>
In-Reply-To: <b325928b1003282119w19949ca4l9998de8cba4aa8d0@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: ogpx <ogpx@ietf.org>
Subject: Re: [ogpx] type-system : guidance for binary serialization implementers
X-BeenThere: ogpx@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Virtual World Region Agent Protocol - IETF working group <ogpx.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ogpx>
List-Post: <mailto:ogpx@ietf.org>
List-Help: <mailto:ogpx-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 29 Mar 2010 18:10:48 -0000

I plan on updating the library when we can settle down on an LLSD spec that looks like it will be set in stone. Given the years of implementation experience and minimal disagreement on LLSD serialization details I don't think that's an unreasonable goal.

John

> -----Original Message-----
> From: ogpx-bounces@ietf.org [mailto:ogpx-bounces@ietf.org] On Behalf Of
> Meadhbh Hamrick
> Sent: Sunday, March 28, 2010 9:20 PM
> To: Dahlia Trimble
> Cc: ogpx
> Subject: Re: [ogpx] type-system : guidance for binary serialization
> implementers
> 
> well.. john hurliman's been pretty supportive of VWRAP generally.
> (thanks, john!) so it's not outside the realm of possibility that
> libOMV would get modified to be compliant with the VWRAP specs.
> 
> --
> meadhbh hamrick * it's pronounced "maeve"
> @OhMeadhbh * http://meadhbh.org/ * OhMeadhbh@gmail.com
> 
> 
> 
> On Sun, Mar 28, 2010 at 9:04 PM, Dahlia Trimble
> <dahliatrimble@gmail.com> wrote:
> > OpenSim in general uses the serializer and deserializer classes in
> > libOpenmetaverse (1). There may be a few lingering places in the code
> base
> > where they are hard coded with other methods, but I suspect they
> would be
> > converted to using the libOpenmetaverse implementation rather than be
> > modified to conform to any spec modifications.
> >
> >
> > 1. http://www.openmetaverse.org/projects/libopenmetaverse
> >
> > On Sun, Mar 28, 2010 at 10:34 AM, Meadhbh Hamrick
> <ohmeadhbh@gmail.com>
> > wrote:
> >>
> >> so this has stuck in my craw for a couple weeks, finally remembering
> >> to post it to the list.
> >>
> >> the JSON and XML serialization schemes use well known grammars that
> >> have wide adoption. not so for the binary serialization. so if i
> >> wanted to write an XML parser, i would have a lot of 3rd party
> >> resources and discussion to guide me. specifically when it comes to
> >> handling errors.
> >>
> >> as i was writing my own implementation of the LLSD binary
> >> serialization scheme, a couple issues came up.
> >>
> >> i think we should *somewhere* address them. either as a section of
> the
> >> type-system document, or as an informational RFC. i would like to
> have
> >> clear guidance for how implementers would handle the following
> >> exceptional events.
> >>
> >> one of the things we were trying to do was make a type system and
> >> serialization schemes that were resilient in the face of error. so i
> >> think there's a strong preference that we recover as best we can
> from
> >> an error instead of throwing up our hands and just saying "error!"
> >>
> >> i would actually go and look at how LL implemented the binary
> >> serialization (i'm sure it's in the viewer code somewhere) but i'm
> in
> >> the middle of my gnu/bsd cool down period, and i don't want to reset
> >> the timer. i think there may be other people in the same situation,
> >> which is why we should have a document describing what we should do
> in
> >> the face of parsing errors.
> >>
> >> so... if someone out there who's more of a viewer person wants to
> look
> >> at the linden implementation and describe it's behavior in a textual
> >> format, and then someone wants to look at the opensim implementation
> >> and describe it's behavior in a textual format, we could then
> document
> >> how things work and avoid this situation for other people.
> >>
> >> here's a list of encoding / decoding errors i think about, along
> with
> >> suggestions for how to handle them.
> >>
> >> 1. the object count following the opening tag ('{' or '[') is less
> >> than the actual number of objects in the collection. (that is, the
> >> closing tag is not found after iterating through "object count"
> number
> >> of elements, but is found later in the stream.)
> >>
> >> the "simple" thing to do would be to simply say, "the array ends
> after
> >> $(OBJECT_COUNT) number of elements, even if there's not a closing
> >> tag."
> >>
> >> the "smart" thing to do would be to look at the LLIDL definition of
> >> the array you're parsing and try to come up with a "best fit" for
> >> what's supposed to be there vs. what's actually there. in other
> words,
> >> you look at the LLIDL and if it says you're supposed to have three
> >> elements in the array and you have three elements in the array, then
> >> you're done. or maybe you're supposed to have one additional element
> >> in the array.
> >>
> >> the "smart" thing to do could get quite complicated while the
> "simple"
> >> thing is sure to introduce failures the "smart" thing could recover
> >> from.
> >>
> >> 2. the object count following the opening tag ('{' or '[') is
> greater
> >> than the actual number of objects in the collection. (that is, you
> get
> >> a closing tag before "object count" number of elements)
> >>
> >> the "simple" thing to do is to simply say, "a closing tag ends the
> >> collection"
> >>
> >> combining this with the previous error case, we could say, "a
> >> collection continues until the closing tag is reached or
> >> $(OBJECT_COUNT) elements are found in the collection."
> >>
> >> 3. there is no closing tag. (that is, after "object count" number of
> >> elements, you find a tag that is not a '}' or a ']'.)
> >>
> >> this is more or less the same as error case number 1 above.
> >>
> >> though i wonder if it makes sense to differentiate the two cases. if
> >> we were, we would have to have the smarts enough to look forward in
> >> the stream, count the number of opening tags, then count the number
> of
> >> closing tags and see if they're unbalanced. ugh.
> >>
> >> 4. lack of 'k' elements in a map. (that is, you haven't reached the
> >> "object count" number of elements and are expecting a 'k' but get
> >> something else.)
> >>
> >> my druthers would be to say, if you encounter a type that can be
> >> converted to a string, you just do the conversion and use the result
> >> as the key.
> >>
> >> another way to handle it would be to ignore it.
> >>
> >> 5. you encounter a bare 'k'. (that is, you encounter a 'k' tag
> outside
> >> the context of a map.)
> >>
> >> i vote for "convert to string"
> >>
> >> 6. duplicate keys in a map. (actually this applies to all
> serializations)
> >>
> >> i vote for "the last key in the map with the same name wins." that
> is,
> >> if you have two or more keys with the same name, the one found
> >> furthest in the stream is the one that's used.
> >>
> >> ideas? comments?
> >> --
> >> meadhbh hamrick * it's pronounced "maeve"
> >> @OhMeadhbh * http://meadhbh.org/ * OhMeadhbh@gmail.com
> >> _______________________________________________
> >> ogpx mailing list (VWRAP working group)
> >> ogpx@ietf.org
> >> https://www.ietf.org/mailman/listinfo/ogpx
> >
> >
> _______________________________________________
> ogpx mailing list (VWRAP working group)
> ogpx@ietf.org
> https://www.ietf.org/mailman/listinfo/ogpx