On Mon, Mar 25, 2019 at 9:17 AM 'Steven Johnson' via emscripten-discuss <[email protected]> wrote: > > The Halide team (halide-lang.org) is experimenting with a WebAssembly > backend; as a newcomer to the wasm world, I'm still sorting out the > ecosystem, and need some advice.
Hi Steven! Glad to see you here. > > So far, we've been running all our unit tests using d8, as it's easy > to drive from our existing bash/make command-line-oriented system... > but if I understand correctly, none of the existing shell-oriented > wasm tools support the threads feature proposal, and (apparently) none > seem likely to do so in the near future. (I'd love to be wrong about > this; if there is such a tool now or soon-ish, please let me know.) Yes, you are correct: None of the CLI JS engines currently support Workers in the way that emscripten expects. However I don't know of any fundamental blockers to implementing emscriptens "threads" on top of Node workers. The API for creating and communicating with the workers is different form the web but similar enough that we should be able to make it work. If there isn't bug already for this we should open one. I would recommend using node over d8 BTW, as its the engine that we test with and so is less likely to be broken. > > So that probably means I need to look at a testing model that drives > an actual browser to do testing of threaded code, which is a little > complicated. (For our testing purposes, we have zero need for a full > browser environment -- everything in our tests is shell-based -- but > we'll do what we have to do.) > > The main contenders for making this easy would seem to be either Emrun > or Node+Puppeteer, but after some experimentation, both have > limitations that are problems for us. > > Emrun works with multiple browsers, so testing multiple wasm engines > is relatively simple. integration with Emscripten is fairly slick and > simple, capture of JS console output is flawless. But... it apparently > doesn't support Chrome in headless mode which is definitely suboptimal > for us (we'd like to be able to run units tests on various > single-board systems with very limited resources); additionally, > running multiple tests simultaneously requires work to avoid weird > glitches in the local server, which dramatically slows down test > throughput. > > Node+Puppeteer, on the other hand, supports headless mode perfectly; > on the other hand, it's Chrome-only, and capturing JS console output > from Emscripten-generated code doesn't seem to work out of the box > (though I'm guessing this latter bit can be corrected with some > tweaking of output templates). > > Are there other alternatives that I have overlooked? Anyone else have > suggestions or experience in this area? Thanks in advance for any > advice. You might want to look at how the emscripten browser tests run. See tests/runner.py. I'm not sure you will fundamentally better results than you are seeing with emrun or with Puppeteer but its another way to do it. Check out the circleci config for how to make firefox and chrome headless for testing. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
