[wpt-sync] Sync PR 64267 - [WebAudio] Guard chunk rendering state during promise resolution
Categories
(Core :: Web Audio, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64267 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64267
Details from upstream follow.
Hongchan Choi <hongchan@google.com> wrote:
[WebAudio] Guard chunk rendering state during promise resolution
When an incremental render chunk completes, OnChunkRendered() removes
the target buffer from pending_render_targets_ before resolving the
chunk promise. Resolving a promise with an AudioBuffer synchronously
invokes any 'then' getter on its prototype chain, allowing re-entrant
startRendering() calls to observe an empty queue and start a duplicate
render pass for the next chunk.Changes:
- Keep the completed target in pending_render_targets_ until Resolve()
finishes so re-entrant startRendering() calls only enqueue targets.- Re-check IsContextCleared() and kClosed after resolving the chunk
promise in OnChunkRendered() before popping the target or starting
the next chunk.- Stop the offline render thread in CloseInternal() before finishing
tail processing or transitioning the context state to kClosed.- Promote queue and duplicate-start invariants in OfflineAudioContext
and SetSharedRenderTarget() to CHECKs.- Add unit tests and WPTs covering re-entrant startRendering() and
close() calls from a synchronous thenable getter.Fixed: 577366760
Test: blink_unittests --gtest_filter=OfflineAudioContextTest.*
Test: wpt/webaudio/.../offlineaudiocontext-incremental-rendering.htmlChange-Id: I142eff32cf01b18161c7e7ce32cd7cfc97971f60
Reviewed-on: https://chromium-review.googlesource.com/8661658
WPT-Export-Revision: ded6883eaccf4b366c134261156eaed8719ac98a
| Assignee | ||
Updated•26 days ago
|
| Assignee | ||
Updated•17 days ago
|
| Assignee | ||
Updated•14 days ago
|
| Assignee | ||
Comment 1•14 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=116403
| Assignee | ||
Comment 2•14 days ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 10 tests and 1 subtests
Status Summary
Firefox
OK : 9[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 10[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 1[GitHub] 46[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL : 7[GitHub] 33[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
ERROR : 1
Chrome
CRASH : 1
Safari
PASS : 1
FAIL : 4
TIMEOUT: 2
NOTRUN : 2
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /webaudio/the-audio-api/the-offlineaudiocontext-interface/ctor-offlineaudiocontext.html [wpt.fyi]
- Executing "options-1":
FAIL - X new OfflineAudioContext({"sampleRate":12345}) incorrectly threw TypeError: "OfflineAudioContext constructor: Missing required 'length' member of OfflineAudioContextOptions.".:
FAIL -
AUDIT TASK RUNNER FINISHED: 1 out of 4 tasks were failed.:
FAIL
- Executing "options-1":
- /webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-close.html [wpt.fyi]
- close before rendering closes the context:
FAIL - calling close twice rejects the second call:
FAIL - close after rendering a chunk closes the context:
FAIL - close while rendering a large chunk stops the context:
FAIL - close while suspended rejects current and queued incremental renders:
FAIL
- close before rendering closes the context:
- /webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-incremental-rendering.html [wpt.fyi]:
ERROR[Gecko-android-em-14-x86_64-debug-geckoview,Gecko-android-em-14-x86_64-opt-geckoview,Gecko-windows11-32-25h2-debug,Gecko-windows11-32-25h2-opt,GitHub],OK[Gecko-android-em-14-x86_64-lite-opt-geckoview,Gecko-linux2404-64-debug,Gecko-linux2404-64-opt,Gecko-windows11-64-25h2-debug,Gecko-windows11-64-25h2-opt] (Chrome:CRASH, Safari:TIMEOUT)- Null length and no chunk size returns one render quantum:
FAIL(Safari:FAIL) - Null length and a chunk size returns the rounded chunk size:
FAIL(Safari:FAIL) - Finite length and a chunk size returns rounded chunks and the remainder:
FAIL(Safari:FAIL) - startRendering rejects when committed frames reach the render length:
FAIL(Safari:FAIL) - suspend at a chunk boundary is applied by the next startRendering call:
FAIL(Safari:TIMEOUT) - startRendering called synchronously from AudioBuffer.prototype.then:
FAIL(Safari:NOTRUN) - startRendering and close called synchronously from AudioBuffer.prototype.then:
FAIL(Safari:NOTRUN)
- Null length and no chunk size returns one render quantum:
- /webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-rendersizehint.html [wpt.fyi]
- OfflineAudioContext with no hint hint:
FAIL - OfflineAudioContext with "default" hint:
FAIL - OfflineAudioContext with "hardware" hint:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 1:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 13:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 127:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 129:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 256:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 500:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 16383:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 3000, renderSizeHint 18000:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 48000, renderSizeHint 288000:
FAIL - OfflineAudioContext [Honored Exactly]: sampleRate 44100.1, renderSizeHint 264600:
FAIL - OfflineAudioContext [Throws Exception]: sampleRate 48000, renderSizeHint 0:
FAIL - OfflineAudioContext [Throws Exception]: sampleRate 3000, renderSizeHint 18001:
FAIL - OfflineAudioContext [Throws Exception]: sampleRate 48000, renderSizeHint 288001:
FAIL - OfflineAudioContext [Throws Exception]: sampleRate 48000, renderSizeHint -1:
FAIL
- OfflineAudioContext with no hint hint:
- /webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-suspend-rendersizehint.https.html [wpt.fyi]
- Offline suspend quantizes to custom render quantum size:
FAIL
- Offline suspend quantizes to custom render quantum size:
Comment 4•9 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/5f085962c5b9
https://hg.mozilla.org/mozilla-central/rev/225b7d3b0151
Description
•