From 3d430fa99c971a81e6738321d5ba42cc7255abf2 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Wed, 15 Jan 2025 19:34:20 -0800 Subject: [PATCH] Specify destroy() methods and behavior around context loss and error reporting (#744) * Specify behavior around context loss and error reporting. Based on @mingmingtasd's work in the Chromium prototype implementation. For #477 * Add link for 'settled' * Add 'is lost' check to build() * Add 'is not lost' dfn alias * Add "can (not) build" defn, fix throwing vs. rejecting for methods * Make build() and compute() explicitly invoke context lost steps * reword to reduce some indenting * restore missing algorithm class * Specify various destroy() methods * Lint/wording fix * whitespace change * another whitespace change * Move destroy of dependencies to 'lost' steps and other feedback * Abort steps / reject promises when context is lost * Separate out lost/lose steps, make dispatch() use abort-when * Incorporate more feedback, another lint rule * Include tensor creation in MLContext/destroy() note * Move async 'abort when'/'if aborted' into substeps * Update index.bs Co-authored-by: Reilly Grant * Add suggested wording by @reillyeon for freeing graph resources on context timeline --------- Co-authored-by: Reilly Grant --- index.bs | 270 ++++++++++++++++++++++++++++++++++--------------- tools/lint.mjs | 24 ++++- 2 files changed, 210 insertions(+), 84 deletions(-) diff --git a/index.bs b/index.bs index 0e955244..6e3a9342 100644 --- a/index.bs +++ b/index.bs @@ -45,6 +45,7 @@ urlPrefix: https://tc39.es/ecma262/; spec: ECMA-262 text: element type; url: table-the-typedarray-constructors text: view constructor; url: table-the-typedarray-constructors text: equally close values; url: sec-ecmascript-language-types-number-type + text: settled; for: Promise; url: sec-promise-objects