[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Typed Array spec nitpicks
- To: Joshua Bell <email@example.com>
- Subject: Re: [Public WebGL] Typed Array spec nitpicks
- From: Kenneth Russell <firstname.lastname@example.org>
- Date: Tue, 11 May 2010 17:37:36 -0700
- Cc: email@example.com
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1273624660; bh=YSz8gEFeQmh3q1jWR8EDom2rhRo=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=aMUCHVSjI+a75WwuE+ohrqBo2jshGTe4j79JhLcL4W7bgWIo3icuHCAxlraojUYQy 8zyAh3TEb4wMM4gQCgBSQ==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=iXhXBTpkcQhM2ZpA7Zu72Cbe/V1wY8oPWX8PnVl/NU9ngtbstRLzZzONT8EsadYwQ FYMoMiVr6i6vGkbligMAw==
- In-reply-to: <firstname.lastname@example.org>
- References: <email@example.com>
- Sender: firstname.lastname@example.org
I apologize for the long delay in replying. Please see my other post
to the list regarding recent changes made.
On Mon, Apr 12, 2010 at 12:02 PM, Joshua Bell <email@example.com> wrote:
> For experimental purposes unrelated to WebGL, I
> implemented https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html as
> closely as I could in ECMAScript 3, and observed a few issues:
> * Please update the date at the top; the spec has evolved quite a bit since
> the version Vladimir posted to es-discuss but they are dated the same. To a
> casual visitor, they might appear to be the same at first glance. This
> doesn't have to be an accurate version/last-edited date, just something
> newer than 25 January 2010.
> * It is unclear if ArrayBuffer data is initialized, i.e. is the output of
> this defined:
> var buf = new ArrayBuffer(1);
> var bytes = new Uint8Array(buf);
> alert(bytes.get(0)); // shows ... ?
> It is obviously a security issue if the buffer exposes uninitialized memory.
> The spec should indicate how it is initialized.
> * The behavior of TypedArray slice() method is undefined if the length ends
> up being negative. This could presumably raise an exception, clamp the
> length to 0, or imply support for "inverted" views (which are otherwise
> disallowed by the TypedArray constructors).
Specified as clamping the length to 0.
> * Possibly not worthwhile to mention in the spec since it's basically
> Floating Point 101, but writing/reading Floats (single-precision) will in
> general be "lossy" due to the extension back to double-precision values. For
> var da = new DataArray(new ArrayBuffer(8));
> da.setDouble(0, 1.2);
> alert( da.getDouble(0) === 1.2 ); // Probably true
> da.setFloat(0, 1.2);
> alert( da.getFloat(0) === 1.2 ); // Probably false
> The reason to consider calling this out is that it's not an issue in
> languages like C/C++ where single precision floating point variables and
> byte-level data access are a given and so you can store/read back a float
> without loss. Typed Arrays would grant ECMAScript byte-level data access but
> *not* single precision floating point variables, and that may trip up some
> developers. (Of course, you should be using an compares-with-epsilon
> * Really minor: IEEE754 Single- and Double-precision support a variety of
> NaN values, which are black boxes to ECMAScript (which has NaN and isNaN
> only). When dealing with externally created data, f = da.getDouble(0);
> da.setDouble(0, f); may be "lossy". I would expect that most implementations
> actually would preserve the specific IEEE754 NaN value internally, but the
> Typed Array spec probably doesn't want to require this.
I've left this untouched for the moment. We still need to clarify the
conversions that occur during stores.
You are currently subscribe to firstname.lastname@example.org.
To unsubscribe, send an email to email@example.com with
the following command in the body of your email: