WebGPU loops run 2 to 3 times faster on Macs
A speed release for WebGPU on Apple Silicon Macs. Loops in page shaders are now written in the shape the Mac graphics compiler handles best, and two loop test pages went from 5.5 and 5.9 ms to 2.1 and 2.0 ms, level with the reference browser. Before it trusts that shape, the browser checks the compiler on 15 small loops once per launch. While testing, one loop shape hung the graphics card of a test Mac; that shape is gone, loops with a continue are written the way the reference browser writes them, and we sent the case to Apple.
Loops the compiler keeps fast
Last release fixed Mac loops that lost their work, by adding a guard the graphics compiler could not throw away. That guard also made loops slow. Every page loop already carries our own pass counter, so the guard is now dropped and the loop is laid out the way the compiler likes: the test written inline and the buffer size read once. An operating system update could change the compiler, so at launch the browser runs 15 known loops and keeps the guard if any answer is wrong. Loops that read and write the same buffer are faster too, but still behind the reference browser.