Skip to content

Commit

Permalink
WIP: spec: update in parallel steps to resolve or reject in enqueued …
Browse files Browse the repository at this point in the history
…tasks
  • Loading branch information
wacky6 committed Sep 20, 2024
1 parent 498e365 commit e31a0e9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,19 @@ If the handwriting recognizer wasn't able to recognize anything, {{HandwritingDr
<div algorithm="handwriting-drawing-get-prediction">
When {{HandwritingDrawing/getPrediction()}} is invoked:

1. If `this`.[=HandwritingDrawing/recognizer=].[=HandwritingRecognizer/active=] isn't true, return a [=/a promise rejected with=] {{"InvalidStateError"}} {{DOMException}}.
1. If `this`.[=HandwritingDrawing/strokes=] is empty, return a [=a promise resolved with=] a new empty [=list=].
1. <a lt="convert">Convert `this` drawing into a format suitable</a> for [=handwriting recognizer=].
1. Let |p| be a new Promise, run the following step [=in parallel=]
1. If `this`.[=HandwritingDrawing/recognizer=].[=HandwritingRecognizer/active=] isn't true, reject |p| with a new {{DOMException}} whose name is {{"InvalidStateError"}} and abort.
1. If `this`.[=HandwritingDrawing/strokes=] is empty, resolve |p| with a new empty [=list=].
1. Let |result| be a list.
1. <a lt="convert">Convert `this` drawing into a format suitable</a> for [=handwriting recognizer=].
1. Send the converted drawing to [=handwriting recognizer=], and retrieves its prediction.
1. <a lt="convert">Convert the retrieved predictions into </a> {{HandwritingPrediction}}, then [=list/append=] the converted predictions to |result|.
1. Resolve |p| with |result|.
1. Send the converted drawing to [=handwriting recognizer=].
1. Wait for [=handwriting recognizer=] to return its predictions.
1. Queue a global task, perform the following steps:
1. Let |result| be a list.
1. [=list/For each=] returned prediction |pred|:
1. <a lt="convert">Convert |pred| it into </a> {{HandwritingPrediction}} |idl_pred|.
1. [=list/Append=] |idl_pred| to |result|.
1. Resolve |p| with |result|.
1. Return |p|
</div>

<h3 id="handwriting-prediction">{{HandwritingPrediction}} attributes</h3>
Expand Down Expand Up @@ -795,4 +800,4 @@ Below are some types of recognizer implementations, and their associated risks:
However, we aren't aware of any recognizer implementations that falls within this type. But we recommend using privacy protection for these models, or use a fresh / clean state for each session.
**Cost of fingerprinting**: the fingerprinting solution need to craft and curate a set of handwriting drawings (adversarial samples) to exploit differences across models. The cost of generating these samples may be high, but it's safe to assume a motivated party can obtain such samples.
**Cost of fingerprinting**: the fingerprinting solution need to craft and curate a set of handwriting drawings (adversarial samples) to exploit differences across models. The cost of generating these samples may be high, but it's safe to assume a motivated party can obtain such samples.

0 comments on commit e31a0e9

Please sign in to comment.