Boris Zbarsky writes: > On 5/2/18 5:21 AM, Karl Tomlinson wrote: >> [[AudioNode Lifetime]] https://github.com/WebAudio/web-audio-api/issues/1471 > > I've read through that thread, but I'm still a little unclear on > where thing stand. With the latest proposal, can there be > observable situations where the output sound depends on GC timing?
Thank you for taking a look, Boris. I'm quite unclear how any of the changes proposed in the [[March F2F resolution]] comment would resolve the issue, and so I expect not. [[March F2F resolution]] https://github.com/WebAudio/web-audio-api/issues/1471#issuecomment-376223916 > If so, that doesn't sound acceptable. It also sounds to me like > Alex Russell in > https://github.com/WebAudio/web-audio-api/issues/1471#issuecomment-362604396 > didn't believe there was an observable sound difference possible. > If one is possible, we should communicate this to him very > clearly.... The spec says that when a node is deleted, it will disconnect itself from other nodes. This disconnection definitely can lead to observable sound differences, if the node can be deleted. The spec is unclear on whether a node with observable connections can be deleted, but there is certainly reason to interpret it in this way and members of the working group were doing so. If anything, the March F2F resolution seems to reinforce this view. I was also quite unclear as to the point of Alex's comment. I didn't understand why he was highlighting "order of object tear-down", nor why he was implying that only "VERY fine-grained" knowledge was a problem. I'm not clear as to exactly what he was referring with "@joeberkovitz's change to cause the spec to not discuss GC", but changing the spec to not discuss GC would certainly resolve the issue. My take-away was that Alex was advocating no behavior changes on GC. He does seem to have misunderstood that there is a problem to fix. But I assume the way forward here is to help the WG find a solution that works. What is the advantage of explaining the situation to Alex? I'm happy to query the F2F resolution, but I wonder which is the best way to resolve this. Is having web specifications try to describe object lifetimes helpful, or is it just over-prescribing? Should specifications instead just focus on observable behavior, and leave it to implementations to optimize and to reclaim resources that are no longer required? Are you aware of any guidance I could reference, if advocating this? (The WG has been very keen to make this normative.) Perhaps it would be best to just have an informative section explaining design decisions made for the sake of making resource reclamation possible, such as lack of graph introspection. Perhaps it would also be helpful to have some informative reminders to implementations re what GC must not affect. If the whole normative AudioNode lifetime section were dropped then this would clearly be an implementation issue rather than a spec issue. The history here is: Initially the #lifetime-AudioNode section was only informative, providing some hints to the implementation re situations when GC must not be performed. These were not a complete list. At the same time, implementations had bugs that made GC observable, but this was not usually noticed in general Web Audio usage. These implementation bugs were fixable. An API/model was designed to support [[dynamic AudioWorkletNode lifetime]]. While not directly saying so at the time AFAIK, this API/model essentially depends on the implementation bugs to work as intended. This was stated much [[later]]. WG pressure in response to the [[dynamic AudioWorkletNode lifetime]] led to the #lifetime-AudioNode section being made [[normative]]. Subsequent additions were made to make it more comprehensive. This made the existing implementation bugs very much spec bugs. The bugs are now very noticeable in typical AudioWorkletNode usage. [[dynamic AudioWorkletNode lifetime]] https://github.com/WebAudio/web-audio-api/pull/959#issuecomment-260979231 [[later]] https://github.com/WebAudio/web-audio-api/issues/1453#issuecomment-349340594 [[normative]] https://github.com/WebAudio/web-audio-api/pull/1161#issuecomment-284499700 _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform