Closed Bug 928003 Opened 11 years ago Closed 9 years ago

WebGL conformance test error in conformance/typedarrays/typed-arrays-in-workers.html

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jujjyl, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: webgl-conformance)

On my laptop with the specs

Windows 7 Home Premium 64-bit
Intel(R) Core(TM) i5-2557M CPU @ 1.70GHz (4 CPUs), ~1.7GHz
4096MB RAM
Intel(R) HD Graphics 3000
Intel(R) GPU driver version 9.17.10.2932
Intel(R) GPU driver date 12/14/2012 (up-to-date)

running https://www.khronos.org/registry/webgl/sdk/tests/conformance/typedarrays/typed-arrays-in-workers.html 
with both Firefox 24 stable and Firefox 27.0a1 Nightly (2013-10-17) gives output:



Tests copying and transferring typed arrays and ArrayBuffers to and from workers

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS copy Float32Array from worker to main thread
PASS copy ArrayBuffer containing Float32Array values from worker to main thread
FAIL transfer Float32Array from worker to main thread: expected [ -500.5, 500.5 ], received [ ]
PASS transfer ArrayBuffer containing Float32Array values from worker to main thread
PASS copy Float32Array from worker to main thread
PASS ping-pong with copy Float32Array from worker to main thread
PASS copy ArrayBuffer containing Float32Array values from worker to main thread
PASS ping-pong with copy containing Float32Array values from worker to main thread
FAIL transfer Float32Array from worker to main thread: expected [ -500.5, 500.5 ], received [ ]
FAIL ping-pong with transfer Float32Array from worker to main thread: expected [ -500.5, 500.5 ], received [ ]
PASS transfer ArrayBuffer containing Float32Array values from worker to main thread
PASS ping-pong with transfer containing Float32Array values from worker to main thread
Whiteboard: webgl-conformance
Depends on: 1135550
The first issue here is that the test has an issue:
In typed-array-worker.js, postMessage(foo, null) is called when they mean postMessage(foo, undefined) or postMessage(foo, []), since the second parameter is optional. I'll get this fixed.

After that, though, postMessage(DataView) throws ": DataCloneError: The object could not be cloned.".

Does the spec say we should succeed here?
What will it take to make DataViews clonable?
Flags: needinfo?(jwalden+bmo)
Component: Canvas: WebGL → JavaScript Engine
OS: Windows 7 → All
Hardware: x86 → All
http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#safe-passing-of-structured-data says DataView objects are clonable.  So that probably should work.

As for making it work.  It's probably not too bad, just modify JSStructuredCloneWriter::startWrite to include a DataView case, and modify JSStructuredCloneReader::startRead to include a corresponding DataView case.  Both functions residing in js/src/vm/StructuredClone.cpp.  There's some trickiness to it because of cloning preserving graphs wrt shared ArrayBuffers and all when those are designated to be transferred that way, but I imagine looking at the typed array cases would demonstrate how to do that, not too trickily.

I don't have time to do this right now.  sfink has done more in the structured cloning case, so he might be a better shot, and he probably should review whatever patch issues here.  I don't know what his time/schedule looks like, to say if this is practical for him soonish or not.

There's also the chance this is a good first bug, for someone able to sort through the things just mentioned.  I think it would be, but I could be mistaken about that.
Flags: needinfo?(jwalden+bmo) → needinfo?(sphink)
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #3)
> http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#safe-
> passing-of-structured-data says DataView objects are clonable.  So that
> probably should work.
> 
> As for making it work.  It's probably not too bad, just modify
> JSStructuredCloneWriter::startWrite to include a DataView case, and modify
> JSStructuredCloneReader::startRead to include a corresponding DataView case.
> Both functions residing in js/src/vm/StructuredClone.cpp.  There's some
> trickiness to it because of cloning preserving graphs wrt shared
> ArrayBuffers and all when those are designated to be transferred that way,
> but I imagine looking at the typed array cases would demonstrate how to do
> that, not too trickily.
> 
> I don't have time to do this right now.  sfink has done more in the
> structured cloning case, so he might be a better shot, and he probably
> should review whatever patch issues here.  I don't know what his
> time/schedule looks like, to say if this is practical for him soonish or not.
> 
> There's also the chance this is a good first bug, for someone able to sort
> through the things just mentioned.  I think it would be, but I could be
> mistaken about that.

Great, I may give this a shot myself.
Assignee: nobody → jgilbert
I would just echo everything Waldo said. I remember back when I did this stuff that I intended to do DataViews too, just never got around to it. I would dupe this bug to bug 789594, but this bug has more info to it so I think I'll let you do it the other way around if you'd prefer.
Flags: needinfo?(sphink)
Oh. Sadly, this will depend on bug 789589 too, which may not be entirely straightforward yet. (I'm not sure how many of the comments in that bug have been addressed already by now.)
Depends on: 789589
Reproduced this to still fail. In the web console, I am seeing the error ": DataCloneError: The object could not be cloned.", and as a result, the test always times out when run as part of the conformance suite (e.g. click "run" on this page: https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html )

The failure is seen to occur (looks hardware independent) on the following configurations:
 - SPARK, GIADA, MACBOOK_AIR_OSX, MACBOOK_AIR_WIN, MACBOOK_PRO_OSX, MACBOOK_PRO_WIN, MACMINI, MACPRO, NEXUS-4, NEXUS-5, NEXUS-10, SURFACE, WINDBOX, HASWELL, HPOMEN

See https://bugzilla.mozilla.org/show_bug.cgi?id=1178601 for hardware configuration details of these systems)
I'm not currently working on this.
Assignee: jgilbert → nobody
Depends on: 789594
Someone could give this a try with an updated browser with bug 789594 fixed and see if it resolves this issue. I briefly tried, but got some webgl error message.
Tested this to pass on the HASWELL configuration from above, with Firefox Nightly 64bit 43.0a1 (2015-08-24). Since the assumption was that this was hardware independent, I am ok to believe this to have been fixed across the board. Unless :sfink or others can find failures here still - what was the failure message?
@Jukka Jylänki
The single test page at
https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/conformance/typedarrays/typed-arrays-in-workers.html
is passing.

However, when I navigate to 
https://www.khronos.org/registry/webgl/conformance-suites/1.0.2/webgl-conformance-tests.html 
and press "run" next to conformance/typedarrays/typed-arrays-in-workers.html, I get a *timeout*
Whatever was hanging up the Conformance Test Runner has been fixed now. This passes with Nvidia gtx 650 on both Linux and Windows now. Tested with FF 44.0a1 (2015-09-25)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.