Closed Bug 2070654 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 62482 - [WebAudio] Add tests and baseline failure for unaligned looping

Categories

(Core :: Web Audio, task, P4)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 62482 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/62482
Details from upstream follow.

Mahesh Kannan <kmaheshb@google.com> wrote:

[WebAudio] Add tests and baseline failure for unaligned looping

This is Part 1 of a 2-part CL addressing crbug.com/553218226.

This CL introduces test coverage for looping AudioBufferSourceNodes
across boundary conditions, refactors the test suite using a factory
and generator paradigm to reduce boilerplate, and checks in the baseline
failure for unaligned buffer looping:

  1. audiobuffersource-loop-continuous.html:
    WPT test covering multi-cycle looping of unaligned buffer lengths
    (65,201 frames) and grain duration boundaries.

  2. audiobuffersource-loop-continuous-expected.txt:
    Captures the existing trunk failure where frame 65,200 is duplicated
    and frame 0 is skipped upon wrap.

  3. AudioBufferSourceHandlerTest:

    • Refactored test fixture to AudioBufferSourceHandlerTestBase with
      shared ProcessOnAudioThread helper returning std::array.
    • Introduced CreateAudioBuffer generator helper and
      CreateEnvironmentWithBuffer factory helper, cutting boilerplate.
    • LoopOffsetBeyondLoopEndPositiveRate: Tests clamping when
      offset >= loopEnd.
    • LoopOffsetBelowLoopStartPositiveRate: Tests intro playback before
      loopStart.
    • LoopSingleSampleBuffer: Tests 1-sample buffer looping without
      division by zero.
    • LoopInvertedBoundsFallbackToWholeBuffer: Tests fallback to whole
      buffer when loopStart >= loopEnd per W3C §1.15.3.
    • LoopNegativeRateBackwardWrap: Tests backwards looping with negative
      playbackRate, including boundary wrap back to loopEnd.
    • LoopingUnalignedBufferFractionalLoopEndInterpolation: Tests
      fractional loopEnd interpolation.
    • DISABLED_LoopingUnalignedBufferPrecision: Reproduction of
      bug 553218226, to be re-enabled in Part 2.
    • DISABLED_LoopingUnalignedBufferExplicitLoopEnd: Tests explicit
      loopEnd = buffer.duration, to be re-enabled in Part 2.
    • DISABLED_LoopingGranularityWrapPrecision: Granularity matrix
      reproduction in AudioBufferSourceGranularityTest, to be
      re-enabled in Part 2.
    • DISABLED_VaryingRatesInterpolatedWrapPrecision: Rate 0.5 wrap
      reproduction, to be re-enabled in Part 2.

TAG=agy
CONV=dcf17c2a-023a-4313-a7d5-deba45eca250

Bug: 553218226
Test: external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-loop-continuous.html
Test: out/Release/blink_unittests --gtest_filter="AudioBufferSource"
Change-Id: I4262acd240362268b5a1dff20b8c6721e3c2d8bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8333135
Reviewed-by: Michael Wilson \<mjwilson@chromium.org>
Commit-Queue: Mahesh Kannan \<kmaheshb@google.com>
Cr-Commit-Position: refs/heads/main@{#1694250}

Component: web-platform-tests → Web Audio
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 29 tests and 51 subtests

Status Summary

Firefox

OK : 1[GitHub] 28[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]
PASS: 5[GitHub] 277[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: 43

Chrome

OK : 1
PASS: 4
FAIL: 1

Safari

OK : 1
PASS: 5

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html [wpt.fyi]: SKIP
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-duration-loop-playbackrate.html [wpt.fyi]
    • loop and playbackRate with duration: FAIL
    • loop and playbackRate 3.0 with duration 3.0: FAIL
    • loop and playbackRate 0.5 with duration 2.0: FAIL
    • loop and playbackRate with fractional duration: FAIL
    • loop and duration with dynamic playbackRate automation: FAIL
    • loop and duration with non-zero start offset: FAIL
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-playbackrate-dynamic-direction.html [wpt.fyi]
    • Dynamic direction switch negative to positive honors duration: FAIL
    • Dynamic direction switch positive to negative honors duration: FAIL
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-playbackrate-negative.html [wpt.fyi]
    • AudioBufferSourceNode supports negative playbackRate (-1.0): FAIL
    • AudioBufferSourceNode supports high negative playbackRate (-2.0): FAIL
    • AudioBufferSourceNode supports high negative playbackRate (-5.0): FAIL
    • AudioBufferSourceNode supports fractional negative playbackRate: FAIL
    • AudioBufferSourceNode supports very low negative playbackRate (-0.02): FAIL
    • AudioBufferSourceNode enters loop backwards from offset > loopEnd: FAIL
    • AudioBufferSourceNode clamps offset to loopStart for playbackRate < 0: FAIL
    • AudioBufferSourceNode handles offset exactly at duration with negative rate: FAIL
    • AudioBufferSourceNode handles out-of-bounds start offset correctly: FAIL
    • AudioBufferSourceNode performs sub-sample interpolation backwards: FAIL
    • AudioBufferSourceNode loops backwards using entire buffer when loopStart > loopEnd: FAIL
    • AudioBufferSourceNode loops backwards using clamped loopStart when loopStart < 0: FAIL
    • AudioBufferSourceNode loops backwards using entire buffer when loopEnd < 0: FAIL
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-playbackrate-zero.html [wpt.fyi]
    • Synthesize and verify sample-and-hold behavior when playbackRate is set to zero halfway: FAIL
    • Subsample start with playbackRate 0 should produce sample-and-hold from exact start frame: FAIL
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-reverse-long-buffer.html [wpt.fyi]
    • Reverse playback of a short buffer renders a sub-sample interpolated signal: FAIL
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-start-null-buffer.html [wpt.fyi]
    • start() with null buffer fires ended event immediately and ignores subsequent buffer assignment: FAIL
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiosource-time-limits.html [wpt.fyi]
    • buffersource: huge stop time: FAIL
    • oscillator: huge stop time: FAIL
  • /webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-scheduling.html [wpt.fyi]
    • X output0[0:33]: Expected 0 for all values but found 1 unexpected values:
      Index Actual
      [33] 1: FAIL
    • X output0[34:8190] does not equal [1.899999976158142,2.9000000953674316,3.9000000953674316,4.900000095367432,5.900000095367432,6.900000095367432,7.900000095367432,8.899999618530273,9.899999618530273,10.899999618530273,11.899999618530273,12.899999618530273,13.899999618530273,14.899999618530273,15.899999618530273,16.899999618530273...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.
      Index Actual Expected AbsError RelError Test threshold
      [0] 2.0000000000000000e+0 1.8999999761581421e+0 1.0000002384185791e-1 5.2631592156154129e-2 0.0000000000000000e+0
      [1] 3.0000000000000000e+0 2.9000000953674316e+0 9.9999904632568359e-2 3.4482724601392921e-2 0.0000000000000000e+0
      [2] 4.0000000000000000e+0 3.9000000953674316e+0 9.9999904632568359e-2 2.5641000560833845e-2 0.0000000000000000e+0
      [3] 5.0000000000000000e+0 4.9000000953674316e+0 9.9999904632568359e-2 2.0408143405366560e-2 0.0000000000000000e+0
      [4] 6.0000000000000000e+0 5.9000000953674316e+0 9.9999904632568359e-2 1.6949136104436064e-2 0.0000000000000000e+0
      ...and 8152 more errors.
      Max AbsError of 1.0009765625000000e-1 at index of 2047.
      [2047] 2.0490000000000000e+3 2.0488999023437500e+3 1.0009765625000000e-1 4.8854341852180105e-5 0.0000000000000000e+0
      Max RelError of 5.2631592156154129e-2 at index of 0.
      : FAIL
    • X output1[34:8190] does not equal [1.100000023841858,2.0999999046325684,3.0999999046325684,4.099999904632568,5.099999904632568,6.099999904632568,7.099999904632568,8.100000381469727,9.100000381469727,10.100000381469727,11.100000381469727,12.100000381469727,13.100000381469727,14.100000381469727,15.100000381469727,16.100000381469727...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.
      Index Actual Expected AbsError RelError Test threshold
      [0] 1.0000000000000000e+0 1.1000000238418579e+0 1.0000002384185791e-1 9.0909110613105290e-2 0.0000000000000000e+0
      [1] 2.0000000000000000e+0 2.0999999046325684e+0 9.9999904632568359e-2 4.7619004368509764e-2 0.0000000000000000e+0
      [2] 3.0000000000000000e+0 3.0999999046325684e+0 9.9999904632568359e-2 3.2258034744817511e-2 0.0000000000000000e+0
      [3] 4.0000000000000000e+0 4.0999999046325684e+0 9.9999904632568359e-2 2.4390221209414906e-2 0.0000000000000000e+0
      [4] 5.0000000000000000e+0 5.0999999046325684e+0 9.9999904632568359e-2 1.9607824804414951e-2 0.0000000000000000e+0
      ...and 8152 more errors.
      Max AbsError of 1.0009765625000000e-1 at index of 2047.
      [2047] 2.0480000000000000e+3 2.0481000976562500e+3 1.0009765625000000e-1 4.8873419987893697e-5 0.0000000000000000e+0
      Max RelError of 9.0909110613105290e-2 at index of 0.
      : FAIL
    • < [sub-sample accurate start] 3 out of 6 assertions were failed.: FAIL
    • X output1[33] should not be equal to 0. Got 0.: FAIL
    • < [sub-sample accurate stop] 1 out of 9 assertions were failed.: FAIL
    • X output0 expected to be equal to the array [0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1...] but differs in 2 places:
      Index Actual Expected
      [3] 1.0000000000000000e+0 0.0000000000000000e+0
      [37] 0.0000000000000000e+0 1.0000000000000000e+0: FAIL
    • X output0[3] is not equal to 0. Got 1.: FAIL
    • X output0[37] should not be equal to 0. Got 0.: FAIL
    • < [sub-sample-grain] 3 out of 16 assertions were failed.: FAIL
    • X With playbackRate 0.25: output0[17] is not equal to 0. Got 0.6892558932304382.: FAIL
    • X With playbackRate 0.25: output0[18] is not close to 1.0499999999999998 within a relative error of 4.542e-8 (RelErr=0.07462642306373217). Got 0.971642255783081.: FAIL
    • X With playbackRate 4: output1[17] is not equal to 0. Got -0.09868232905864716.: FAIL
    • X With playbackRate 4: output1[18] is not close to 1.7999999999999972 within a relative error of 4.542e-8 (RelErr=0.05661286248101295). Got 1.9019031524658203.: FAIL
    • < [sub-sample accurate start with playbackRate] 4 out of 5 assertions were failed.: FAIL
    • AUDIT TASK RUNNER FINISHED: 4 out of 4 tasks were failed.: FAIL

Tests Disabled in Gecko Infrastructure

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5844804a8358 https://hg.mozilla.org/integration/autoland/rev/3e0cae962d83 [wpt PR 62482] - [WebAudio] Add tests and baseline failure for unaligned looping, a=testonly
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.