-
Notifications
You must be signed in to change notification settings - Fork 19
Some work in progress on running the web-platform-tests suite for WebAudio #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
orottier
commented
Nov 25, 2023
•
edited
Loading
edited
- figure out how to run wpt on our bindings
- add all tests via a git submodule
- add a stub implementation for missing bindings (e.g. OfflineAudioContext.suspend) to avoid some crashes
- avoid all other crashes via the filter list
- get the full suite to run
- collect initial report
- bindings for AudioListener
- implement OfflineAudioContext.suspend
- bindings for event listeners (edit)
- make OfflineAudioContext.start_rendering take &self instead of self
- check if we can run on all wpt files now
- collect new report
- can we drop the wpt fork?
- start working on panics that occur
- start working on failed assertions
- start working on missing functionality
From https://github.com/web-platform-tests/wpt/tree/master/webaudio Only leave 'the-audiobuffer-interface' for now. Drop the crashtests/ dir as they hang the runner
Coo thanks! Nice that you found Will have a look soon, some Node stuff can be made more idiomatic and simplified |
Yes please:) Meanwhile I'm looking for a method to collect and track the test results. |
Ok it's a bit more node friendly now,
I sketched something using the programmatic API, seems to be the way to go
Yup maybe that would be better, I think you didn't move all the files yet isn't it? |
Thanks, definitely beats my
Indeed, we make the NodeJs runtime crash for many tests and the wpt runner is not properly isolated so the whole suite terminates. I will try to see if I can add some process level isolation to the test runner but since my javascript is terrible I probably won't make it work. Alternative is to put all crashing tests into the |
Hum I see, if you have one crashing test in mind maybe you could just add it, then I can try to see what we can do? |
In mobile now, but e.g. analysernode invalid constructor tests (in ctor.html file) |
ok thanks will try to have a look later today |
Didn't really see how fix that in the test runner, seems more like a napi issue to me, so I fixed the issue in the lib itself (which is anyway what we want I guess :) I also discriminated all errors of kind All in all, at first sight:
(I really like the fact that the ScriptProcessorNode is deprecated but that some tests rely on it :) |
Thanks for the additional work. Adding a different result type for "expected error ... but got error .." is very useful. The wpt runner still crashes a lot for stupid reasons (missing bindings) but I also discovered a real bug, nice. |
Slowly making progress, I managed to get into the I need these changes in the wpt repo, I will make a fork for that later
That new file is created with I will create a tracking issue with all issues that make the runner crash (and hence why I deleted these 6 files) |
Alright, I got the full suite to run. |
For wpt @ web-platform-tests/wpt@83f318a
|
Cool, nice work! Few question/remarks:
Let me know if you need some help on some points and/or when you think this is ready to merge |
src/offline_audio_context.rs
Outdated
let obj = match napi_obj.0.as_ref() { | ||
Some(v) => v, | ||
None => return ctx.env.create_double(0.), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit surprised about this change at first, but I guess it prevents crashing when we do something like this?
const result = await offlineContext.startRendering();
const now = offlineContext.currentTime
Seems that all this Option
stuff was required to work around:
pub fn start_rendering_sync(self) -> AudioBuffer
Did you think it could be resolved at the rust level to have something like this instead:
pub fn start_rendering_sync(&self) -> AudioBuffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes definitely, let's change that API. And also implement https://webaudio.github.io/web-audio-api/#dom-offlineaudiocontext-suspend because it is used so much in the wpt.
Yes that would probably be better. My intend is to get rid of the fork soon, but we also have this issue of the missing resource file. I think that needs patching in wpt-runner repo.
Hum right, this has a large performance impact. I could probably use your help here. Is there a way to lazily return the Listener on request? Also let's move the Listener bindings to a separate PR, right? |
New results with webaudio-rs v0.38 en new templating:
Previous results #42 (comment) |
Attempting to get OfflineAudioContext.suspend to work
to prevent a wpt crash
You may need to run `git submodule sync --recursive`
New results with suspend/resume and AudioListener.setPosition
Previous results #42 (comment) |
// | ||
// When any of the positionX, positionY, and positionZ AudioParams for this AudioListener have | ||
// an automation curve set using setValueCurveAtTime() at the time this method is called, a | ||
// NotSupportedError MUST be thrown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is actually ok as the error will be thrown by the set_value
call. The check is done in the AudioParam
.
But this is also something that should be fixed on the rust side at some point because the panic
would occur in the render thread which is not good...
Hey, really good job thanks! It's very nice to have such move forward on that point. I will just add a small fix on |
Ok to merge on my side! Good for you? |
All good 👍 |
New results with all audioparam attributes and OfflineAudioContext::state
Previous results #42 (comment) |