[compute-pressure] Add hysteresis to notify pressure observers algorithm (#176)

anssiko has just created a new issue for https://github.com/w3c/compute-pressure:

== Add hysteresis to notify pressure observers algorithm ==
We've received [Dev Trial](https://chromestatus.com/feature/5597608644968448) feedback from a major ISV that the state changes between ["serious"](https://www.w3.org/TR/compute-pressure/#dom-pressurestate-serious) and ["fair"](https://www.w3.org/TR/compute-pressure/#dom-pressurestate-fair) [pressure states](https://www.w3.org/TR/compute-pressure/#dfn-pressure-states) are too rapid as illustrated below:

![cp-demo](https://user-images.githubusercontent.com/765510/215411760-a8b8042a-bbba-4c9e-b684-6962e909e622.png)

This suggests the spec should add an informative note that recommends implementers to add [hysteresis](https://en.wikipedia.org/wiki/Hysteresis#In_engineering) to the [notify pressure observers](https://www.w3.org/TR/compute-pressure/#dfn-notify-pressure-observers) algorithm and amend the algorithm steps accordingly to allow an implementation to bail out without notifying if the threshold has not been reached. This seems particularly important at the top-end of the range based on the feedback received.

Adding hysteresis in the implementation as opposed to in the JS logic would also further improve privacy by lowering the entropy of the overall system. This improvement could be noted in the [security and privacy considerations](https://www.w3.org/TR/compute-pressure/#security-and-privacy-considerations) section.

(The mathematical model is formalized as [Preisach model of hysteresis](https://en.wikipedia.org/wiki/Preisach_model_of_hysteresis) and is being used in various fields of science and engineering.)

Please view or discuss this issue at https://github.com/w3c/compute-pressure/issues/176 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 30 January 2023 08:05:55 UTC