[Webkit-unassigned] [Bug 229523] [Catalina GPU] fast/canvas/webgl/lose-context-on-timeout.html is a flaky timeout

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 10 02:40:41 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=229523

Kimmo Kinnunen <kkinnunen at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |kkinnunen at apple.com
           Assignee|webkit-unassigned at lists.web |djg at apple.com
                   |kit.org                     |

--- Comment #4 from Kimmo Kinnunen <kkinnunen at apple.com> ---
ebGL GPUP simulated timeout does not apply directly after invocation

Timeout is implemented as 

1) Remove the graphics context from the list of graphics contexts in the WP-GPUP session
     RemoteGraphicsContextGL::simulateEventForTesting

2) As a detail, ignore all out-of-stream messages that do not have a corresponding context in the list
     GPUConnectionToWebProcess::dispatchSyncMessage,  GPUConnectionToWebProcess::dispatchMessage


The test seems to work sometimes because when the simulated context is removed, the GPUP may become idle and is shut down. Further messages to shut down GPUP are correctly detected as failing and context is lost.




Bug 1:
The 1) happens in main thread, where as the stream message dispatch happens in the stream work queue. Removing the stream connection from the stream work queue happens at arbitrary moment in stream work queue perspective. This means that it can process messages to the timed out context after main thread has done the removal.

Bug 2:
Out-of-stream message sync replies of the removed contexts might be sent, and they might be interpreted as correct messages. The correct handling in GPUConnectionToWebProcess::dispatchSyncMessage,  GPUConnectionToWebProcess::dispatchMessage should be to mark the decoders as invalid (decoder.markInvalid()).

Bug 3:
RemoteGraphicsContextGL design is that the sender RemoteGraphicsContextGLProxy should stop sending immediately after context loss. However, given two threads of execution, this is not possible. RemoteGraphicsContextGL might have messages after simulated timeout, simulated context loss or real GPUP side context loss. This means that all the context calls after context loss should be skipped.





 E.g. generated functions should be fixed like so:

    void getFloatv(uint32_t pname, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<float>)>&& completionHandler)
    {
        WTFLogAlways("kkimmo GetFloat");
        Vector<GCGLfloat, 16> value(static_cast<size_t>(valueSize), 0);
        assertIsCurrent(workQueue());
        m_context->getFloatv(pname, value);
        completionHandler(IPC::ArrayReference<float>(reinterpret_cast<float*>(value.data()), value.size()));
    }

-->

    void getFloatv(uint32_t pname, uint64_t valueSize, CompletionHandler<void(IPC::ArrayReference<float>)>&& completionHandler)
    {
        WTFLogAlways("kkimmo GetFloat");
        Vector<GCGLfloat, 16> value(static_cast<size_t>(valueSize), 0);
        assertIsCurrent(workQueue());
        if (somecondition)
            m_context->getFloatv(pname, value);
        completionHandler(IPC::ArrayReference<float>(reinterpret_cast<float*>(value.data()), value.size()));
    }


the condition could. be like 
  LIKELY(m_context)

or
  LIKELY(!isLost())

or similar.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220510/2bc1fc3b/attachment.htm>


More information about the webkit-unassigned mailing list