I don't know the ServiceWorker mechanisms too much, but if the Javascript dies in 30 seconds then WebGPU operations will soon after. There isn't a lot of use in keeping WebGPU computations running for much longer as Javascript is needed to get the result of any computation in any useful places (canvas, ArrayBuffer, MediaStream, etc). Technically the ServiceWorker could send a much longer running job to the GPU (think an infinite loop) but apart from DDoS there wouldn't be any use to this.
You might also be interested in the privacy and security section <https://gpuweb.github.io/gpuweb/#malicious-use> of the WebGPU spec. On Wednesday, March 13, 2024 at 9:55:02 AM UTC+1 Daniel Bratell wrote: > Just to ask what is probably a FAQ to get it out here... > > The Service Worker timeout is 30 seconds right, so regardless of how heavy > the calculations are, a service worker and its associated calculations will > die in 30 seconds after the user closes the associated page? > > I ask because while it's been possible to run heavy calculations in > various workers in the past, this explicitly encourages it. It would be a > bad situation if a user cannot detect or stop a runaway WebGPU operation > from a possibly hostile site. > > /Daniel > On 2024-03-13 08:06, 'François Beaufort' via blink-dev wrote: > > > > On Tue, Mar 12, 2024 at 10:14 PM Yoav Weiss (@Shopify) < > yoav...@chromium.org> wrote: > >> LGTM1 >> >> On Tue, Mar 12, 2024, 15:10 'François Beaufort' via blink-dev < >> blin...@chromium.org> wrote: >> >>> >>> >>> On Tue, Mar 12, 2024 at 6:58 PM Mike Taylor <mike...@chromium.org> >>> wrote: >>> >>>> On 3/11/24 4:06 PM, 'François Beaufort' via blink-dev wrote: >>>> >>>> Contact emails fbea...@google.com >>>> >>>> Explainer None >>>> >>>> Could you write a few sentences why this is a useful addition? >>>> >>> >>> Service Workers enable offline capabilities and background processing >>> for WebGPU. This means graphics-intensive web applications or Chrome >>> Extensions can cache resources and perform computations even when the user >>> isn't actively interacting with the page. >>> Shared Workers allow multiple tabs or extension contexts to coordinate >>> and share WebGPU resources. This leads to smoother performance and more >>> efficient use of the user's graphics hardware. >>> >>>> >>>> Specification https://gpuweb.github.io/gpuweb/#navigator-gpu >>>> >>>> Summary >>>> >>>> Functionality added to the WebGPU spec after its first shipment in a >>>> browser. ServiceWorker and SharedWorker support is added to WebGPU, >>>> aligning with existing WebGL capabilities. >>>> >>>> Blink component Blink>WebGPU >>>> <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EWebGPU> >>>> >>>> TAG review None >>>> >>>> TAG review status Not applicable >>>> >>>> Risks >>>> >>>> >>>> Interoperability and Compatibility >>>> >>>> ServiceWorker and SharedWorker support have not yet been implemented in >>>> any browser, but have been approved by the GPU for the Web Community >>>> Group, >>>> with representatives from Chrome, Firefox, and Safari. See minutes at >>>> https://docs.google.com/document/d/15w7nsvqWwITA5yvCrsO3SEIEuZziXzj7YsrHN4Jd2uM/edit#heading=h.jbe7pg8ebd43 >>>> >>>> >>>> *Gecko*: No signal ( >>>> https://github.com/mozilla/standards-positions/issues/971) >>>> >>>> Not officially a positive signal, but looking positive based on the >>>> comments. >>>> >>> >>> Indeed. >>> >>>> >>>> *WebKit*: No signal ( >>>> https://github.com/WebKit/standards-positions/issues/294#issuecomment-1877411933 >>>> ) >>>> >>>> This is kind of an "N/A to positive", given it's WebGPU. >>>> >>> >>> Agree ;) >>> >>>> >>>> *Web developers*: Positive ( >>>> https://github.com/gpuweb/gpuweb/issues/4197) >>>> >>>> *Other signals*: >>>> >>>> WebView application risks >>>> >>>> Does this intent deprecate or change behavior of existing APIs, such >>>> that it has potentially high risk for Android WebView-based applications? >>>> >>>> None >>>> >>>> >>>> Debuggability >>>> >>>> None >>>> >>>> >>>> Will this feature be supported on all six Blink platforms (Windows, >>>> Mac, Linux, ChromeOS, Android, and Android WebView)? No >>>> All platforms will eventually have support. Will immediately be >>>> available on Android, ChromeOS, Mac, and Windows, since those platforms >>>> already support WebGPU. Linux is planned to have WebGPU support in the >>>> future, so this feature will become available when WebGPU does. >>>> >>>> What about WebView? Do we ship support for WebGPU there? >>>> >>> >>> Yes. WebGPU is supported on Android WebView as well. >>> >> > Note that Shared Workers are not available on Android for now. See > https://issues.chromium.org/issues/40290702 > >> >>>> Is this feature fully tested by web-platform-tests >>>> <https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md> >>>> ? Yes >>>> >>>> WebGPU/WGSL have a conformance test suite ( >>>> https://github.com/gpuweb/cts) that is regularly pulled into Chromium >>>> and part of the testing of Dawn/Tint in Chromium. PRs: >>>> https://github.com/gpuweb/cts/pull/3419 - >>>> https://github.com/gpuweb/cts/pull/3345 >>>> >>>> >>>> Flag name on chrome://flags None >>>> >>>> Finch feature name WebGPUExperimentalFeatures >>>> >>>> Requires code in //chrome? False >>>> >>>> Tracking bug >>>> https://bugs.chromium.org/p/chromium/issues/detail?id=1521763 >>>> >>>> Estimated milestones >>>> Shipping on desktop 124 >>>> Shipping on Android 124 >>>> >>>> Anticipated spec changes >>>> >>>> Open questions about a feature may be a source of future web compat or >>>> interop issues. Please list open issues (e.g. links to known github issues >>>> in the project for the feature specification) whose resolution may >>>> introduce web compat/interop risk (e.g., changing to naming or structure >>>> of >>>> the API in a non-backward-compatible way). >>>> None >>>> >>>> Link to entry on the Chrome Platform Status >>>> https://chromestatus.com/feature/4875951026733056 >>>> >>>> Links to previous Intent discussions Intent to prototype: >>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5%2BewUL-PTEQ_ZQgdtViKU2fSVXeDNab2oEy6RsGqkgcGQ%40mail.gmail.com >>>> >>>> This intent message was generated by Chrome Platform Status >>>> <https://chromestatus.com/>. >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "blink-dev" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to blink-dev+...@chromium.org. >>>> To view this discussion on the web visit >>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5Lo3k-Gynt4M%2BwgV3yfg%2BFvM1npij%2BGTNZLW-VZHojXYA%40mail.gmail.com >>>> >>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5Lo3k-Gynt4M%2BwgV3yfg%2BFvM1npij%2BGTNZLW-VZHojXYA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "blink-dev" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to blink-dev+...@chromium.org. >>> To view this discussion on the web visit >>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5LZJChJe3EwDeGMwkXgMNqRk%3DM5-bBAM7Jya6Ln5_0SOA%40mail.gmail.com >>> >>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5LZJChJe3EwDeGMwkXgMNqRk%3DM5-bBAM7Jya6Ln5_0SOA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "blink-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to blink-dev+...@chromium.org. > > To view this discussion on the web visit > https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5L2HE3mLZWvRNGsrh0-5sr0M4wmXNzhBhcwYfQSiTKqzQ%40mail.gmail.com > > <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5L2HE3mLZWvRNGsrh0-5sr0M4wmXNzhBhcwYfQSiTKqzQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/775b3102-89af-4910-a85b-6ca1c70e2cb6n%40chromium.org.