Closed Bug 2086271 Opened 26 days ago Closed 9 days ago

[wpt-sync] Sync PR 64267 - [WebAudio] Guard chunk rendering state during promise resolution

Categories

(Core :: Web Audio, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
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.html

Change-Id: I142eff32cf01b18161c7e7ce32cd7cfc97971f60
Reviewed-on: https://chromium-review.googlesource.com/8661658
WPT-Export-Revision: ded6883eaccf4b366c134261156eaed8719ac98a

Component: web-platform-tests → Web Audio
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

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

  • /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
  • /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)
  • /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
  • /webaudio/the-audio-api/the-offlineaudiocontext-interface/offlineaudiocontext-suspend-rendersizehint.https.html [wpt.fyi]
    • Offline suspend quantizes to custom render quantum size: FAIL
Status: NEW → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.