In r283855, EqualPowerPanner::pan() was modified to use vector instructions where available. This caused a regression on GTK and WPE in the test imported/w3c/web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/panner-equalpower.html, presumably because of some problem in the implementation of VectorMath::multiplyByScalarThenAddToVector() which is implemented in the WebKit code for non-Apple platforms but uses an Apple library on Apple platforms.
(In reply to Arcady Goldmints-Orlov from comment #0) > In r283855, EqualPowerPanner::pan() was modified to use vector instructions > where available. This caused a regression on GTK and WPE in the test > imported/w3c/web-platform-tests/webaudio/the-audio-api/the-pannernode- > interface/panner-equalpower.html, presumably because of some problem in the > implementation of VectorMath::multiplyByScalarThenAddToVector() which is > implemented in the WebKit code for non-Apple platforms but uses an Apple > library on Apple platforms. What architecture does it fail on? ARM or Intel?
Ok, I can reproduce the following failure on Intel if I disable the `#if USE(ACCELERATE)` in VectorMath.cpp: --- /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/layout-test-results/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/panner-equalpower-expected.txt +++ /Volumes/Data/WebKit/OpenSource/WebKitBuild/Debug/layout-test-results/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-pannernode-interface/panner-equalpower-actual.txt @@ -14,7 +14,13 @@ PASS Mono: Left and right channels is identical to the array [expected array]. PASS < [mono source=listener] All assertions passed. (total 1 assertions) PASS > [stereo source=listener] Source and listener at the same position -PASS Stereo: Left and right channels is identical to the array [expected array]. -PASS < [stereo source=listener] All assertions passed. (total 1 assertions) -PASS # AUDIT TASK RUNNER FINISHED: 3 tasks ran successfully. +FAIL X Stereo: Left and right channels expected to be equal to the array [expected array] but differs in 8025 places: + Index Actual Expected + [129] -9.094678e-1 -9.937366e-1 + [130] -8.316806e-1 -9.996189e-1 + [131] -7.479766e-1 -9.983897e-1 + [132] -6.589520e-1 -9.900583e-1 + ...and 8021 more errors. assert_true: expected true got false +FAIL < [stereo source=listener] 1 out of 1 assertions were failed. assert_true: expected true got false +FAIL # AUDIT TASK RUNNER FINISHED: 1 out of 3 tasks were failed. assert_true: expected true got false Seems to confirm that the Intel implementation for one of our vector math functions is somehow wrong. The results seem pretty different so it doesn't look like a simple precision issue.
Seems that this is wrong somehow: ``` void multiplyByScalarThenAddToVector(const float* inputVector1, float scalar, const float* inputVector2, float* outputVector, size_t numberOfElementsToProcess) { multiplyByScalarThenAddToOutput(inputVector1, scalar, outputVector, numberOfElementsToProcess); add(outputVector, inputVector2, outputVector, numberOfElementsToProcess); } ``` I am looking into it.
Created attachment 445333 [details] Patch
Comment on attachment 445333 [details] Patch Thanks Arcady for spotting this issue and Chris for fixing it ;)
Committed r286264 (244627@main): <https://commits.webkit.org/244627@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 445333 [details].
<rdar://problem/85835819>
*** Bug 217845 has been marked as a duplicate of this bug. ***