#795: Compute Pressure Specification Review

Visit on Github.

Opened Dec 8, 2022

Wotcher TAG!

We are requesting a TAG review of the Compute Pressure API. The Compute Pressure API provides a way for websites to react to high-level changes in the CPU pressure, in a privacy preserving manner, such that websites can trade off resources for an improved user experience.

  • Explainer: explainer
  • Specification URL: specification
  • Tests: wpt
  • User research:
  • Security and Privacy self-review: specification
  • GitHub repo: repo
  • Primary contacts:
  • Organization(s)/project(s) driving the specification: Intel, Google. Web Capabilities (Project Fugu, Chromium)
  • Key pieces of existing multi-stakeholder review or discussion of this specification: reviews
  • External status/issue trackers for this specification: issues

Further details:

As a result of earlier feedback received from among other WebKit, we have updated the spec to introduce the high level states concept

You should also know that... We'd prefer the TAG provide feedback as:

Leave review feedback as a comment in this issue and @-notify @kenchris

Discussions

Discussed Jan 1, 2023 (See Github)

Sangwhan: I have looked at this. Was reviewed by us - this is a re-design. The other API was a polling mechanism. This changes that into an observer based pattern. I'm happy about that change. That said I have some concerns - some gaps in this. The compute pressure - trigger could be cases where it's artificial. Not because you're busy but because you're constraining the system because of power saving. It's one bit of entropy. If you take the browser process and constrain the cores it can access... you will be able to mine this information out by heuristics. Functionality wise it seems sensible. Other thing I'm a little worried about is sample rate - will it cause problems - certain ways of sampling this info can be high CPU consumption - not sure if sampling rate is too high? Overall other question that remains to be answered : do we think this is a good thing? I know Mozilla has been negative about this - it's info that a compute heavy applicaiton would make use of - but it makes more informnation - intimite platform info - to an origin. Do we want to expose this to the web platform?

Dan: will move to devices and sensors wg. You mentioned multistakeholder - any others besides chromium?

Sangwhan: nothing from webkit. Mozilla is against it.

Dan: what is an example of a compute heavy application that we'd expect people to..

Sangwhan: cryptpad plus google meet on a low end machine... if one or the other application can acknowledge that they can't use the whole cpu they can do something about it. Right now there's no information that lets them take action. Now a video conf app can reduce resolution or disable certain streams to reduce data needed to process. Cryptpad could reduce the amount of worker threads to reduce the footprint.

Dan: I think we should raise the issues, in particular the privacy related issue.. they've done a security and privacy.. minimising information exposure.. they are talkinga bout some of these issues in the document itself.

Sangwhan: they reduced the granularity of the information to make it a bit more safe

Amy: is there a UX improvement that could help with the privacy issues? off by default, and you can turn it on if you're doing something compute heavy?

Dan: or the browser can use a heuristic to prompt the user to enable it if it's struggling, with a warning?

Sangwhan: gated behind a permission - but problem because of how observer kicks in ... the user doesn't see it when there are problems, but before...

Dan: can they share additional information about multistakeholder?

Sangwhan: [will leave comment]

Discussed Feb 1, 2023 (See Github)

bump

Discussed Apr 1, 2023 (See Github)

Sangwhan: compute pressure makes a lot of sense. the new design is good. the re-design driven by Ken. Some privacy concerns. I think every new capability feature we have to think about the potential trade-offs. The immediate user need is...

Dan: You read my mind.

Sangwhan: if you are web app that is compute heavy - or a video conf that has background blur - the applications dont know when the CPUs are starved. The apps can take away certain non-critical functionality to serve the needs of the user. E.g. non-critical features in video conf deprioritised compared to hearing the person... If they know how much pressure they can adapt. Right now on the web there's no way to adapt. On top of that you have artificial compute pressure - e.g. battery saver - you're trying to save resources. Compute pressure is a way to convey that... Some level of concerns from app implementers that the level of info exposed is not enough - but this is a good compromise...

Dan: is there a permission required for even this level?

Sangwhan: no. You can use compute presure as a way to expose info...

Sangwhan: i have a conflict of interest as I work on this topic in ChromeOS.

Sangwhan: from a user and application dev pov - it sucks if the app is just blasting the CPU...

... 621 was the original issue.... A lot of privacy discussion happened on the previous one. They are aware of the privacy concerns....

Dan: from their privacy considerations it looks like they are excercising data minimization... one of our privacy principles... Also lots of other mitigations against privacy issues listed.

Sangwhan: one thing that may be a small concern is syncronization...

Dan: You could establish cross-origin correlation... I think that should be discussed in the privacy consideration section...

Sangwhan: it would be a very expensive way to do it...

Sangwhan: Overall we see the developer needs are pretty clear.

Dan: data minimization important...

Dan: what's the problem with doing this as a permission gate?

Sangwhan: most video conference apps have to ask for 3 permissions already... how you would convey this to average users is really tricky...

<blockquote>

Positive feedback on data minimization approach detailed in the privacy & security considerations seciton - see data minimization for our emerging work in this area. Also the user needs are well defined in the explainer.

We'd like to hear what the developers think about how useful this is especially in multi-core (especially heterogenous) setups, once it moves on to trial.

We noticed that WebKit position is WIP, could you poke that thread and see what they think?

</blockquote>
Comment by @cynthia Apr 19, 2023 (See Github)

Positive feedback on data minimization approach detailed in the privacy & security considerations seciton - see data minimization for our emerging work in this area. Also the user needs are well defined in the explainer.

We'd like to hear what the developers think about how useful this is especially in multi-core (especially heterogenous) setups, once it moves on to trial.

We noticed that WebKit position is WIP, could you poke that thread and see what they think?

Comment by @kenchris Apr 19, 2023 (See Github)

Thanks @cynthia !

We are working our way through the PING feedback and will poke WebKit after that

Comment by @hober Apr 20, 2023 (See Github)

WebKit's position on this from May 2021

Comment by @hober Apr 20, 2023 (See Github)

Mozilla's standards-positions issue on this

Comment by @anssiko Apr 24, 2023 (See Github)

@cynthia thanks for your feedback! Speaking as the co-chair of the WG responsible for this API, I'm hearing the TAG is not suggesting any concrete changes to the API at this time but is interested in feedback from early-adopter developers. The WG will provide the TAG this information when it becomes available.

Informed by both WebKit and Mozilla folks' feedback provided in May 2021 the WG has improved the API substantively from its earlier version using in particular data minimization principle as a guide. The WG believes it has addressed this feedback from May 2021 with its redesigned API.

Discussed Jul 1, 2023 (See Github)

Dan: no activity on multistakeholder. Some concerns from mozilla. Webkit negative from 2021.

Sangwhan: on an old version

Dan: We reviewed and gave positive feedback on the fact they were referencing data minimisation principle in april.

Sangwhan: previous proposal was polling based, had a high granularity, not great usability. Privacy risks due to granularity - that's why webkit says it's a side channel. CPU architectures with a heterogenous setups (big and small clusters, modern intel cpus, atom cores, core cores, common). THe compute pressure, % aggregated, doesn't mean anything, in these kinds of configurations. But you can use those readings to create artificial workloads to create a side channel. A lot of that was saddressed by making it more coarse - high pressure, medium or low pressure, three levels or so. If you're in a high pressure situation a web application can choose to do things to improve the situation within their control, eg. blackground blur is a very expensive feature that video conferencing supports and uses a lot of cpu cycles - could black it out instead. Apps can reactively deal with this. Also reduces the side channel attack surface, but doesn't completely eliminate it. You can sync things - two origins. There are other ways to do this, not overly concerned.

... In low power mode, tell the application to use less energy, you can signal to the application.

... It's a huge gap. If we want applications to be more advanced and considerate about resource consumption this kind of mechanism lets them do that. It benefits good actors. On the other hand, it benefits bad actors.. if a bitcoin minor is sitting in the background and sees 'idle' they can crank it up to medium and not get noticed too much. There's a tradeoff.

Dan: the other signals that are coming through.. the work is happening in devices and sensors. There's multistakeholder with intel and google. Privacy and security considerations section is good. Concerns around lack of multi browser support. But webkit's position was on the old version, so need to review the new version. No information from mozilla. We don't have current information about negative feedback on this version.

Sangwhan: good use cases in video conferencing

Dan: and in web gaming [proposed close satisfied with concerns] - concerns purely based on multiple browser support

Discussed Aug 1, 2023 (See Github)

Dan: proposed closed, but have concerns about multiple browser support. Any further information since July?

Sangwhan: Probably some of this is going to launch.. experiment ongoing

Dan: based on discussion at the f2f the concerns were not applicable to the latest version.. that they'd been addressed?

Sangwhan: yes, it's been completely redesigned

<blockquote> Hi Anssi - thanks for this review. We're generally happy with the design and the articulated user needs. We remain concerned about multi-stakeholder support. We note that this API is going to experimental implementation. We'd be interested to review the results of that experiment. Thanks! </blockquote>

closed

Comment by @torgo Aug 22, 2023 (See Github)

Hi @anssiko - thanks for the opportunity to review this spec. We're generally happy with the design and the articulated user needs. We remain concerned about multi-stakeholder support. We note that this API is going to experimental implementation. We'd be interested to review the results of that experiment. Thanks! ✨

Comment by @anssiko Aug 24, 2023 (See Github)

@torgo, Zoom, Whereby and Slack have shared with the WG they're experimenting with this API. Also other players are trialing but haven't publicly shared this information.

When we receive the final feedback from the first wave of early adopters we'll share a summary as applicable. Thank you for your review and suggestions.

Comment by @kenchris Mar 7, 2024 (See Github)

Though we cannot share the exact feedback from the origin trial due to confidentiality, the feedback was quite positive with all respondents extremely likely to continue using the API. None of the respondents found the API hard to use, but we received some minor feedback on the API shape and feature requests that we have adopted or at least filed issues for.

Please see below for aggregated and manually vetted OT feedback that was shared as per Google's policy:

  • 100% of the respondents are extremely likely to continue using the API.

  • 43% of the respondents found the API 'Extremely easy'

  • 43% found it 'Neither easy nor difficult'

  • 14% found it 'Moderately easy' to use.

  • 7% of the respondents mentioned that they would prefer to give the callback frequency in time units (secs, milliseconds), similar to other APIs such as setInterval in place of Hz as currently designed. A number scale along with labels would be more useful e.g. { pressure: 2, label: 'nominal' }.

  • 2% of the respondents suggested adjusting thresholds or combining states to reduce "flapping" between fair and nominal