BatchedMesh #setMatrixAt delay with webGPU

Using BatchedMesh with webGPU renderer: when setting a per instance matrix via #setMatrixAt, I notice that the matrices aren’t necessarily updated on GPU synchronously. Instances (sometimes) appear at the wrong location for a frame

Is there a specific API to call to ensure that BatchedMesh per instance matrices a synced with GPU?

This may be a bug/improvement so I apologies if this isn’t the right place to post. Since doc for webGPU is not always complete I thought I’d risk asking here first.

note:
I tried making the instances invisible for a few frames hoping for the buffers to be updated when I make them visible but that doesn’t work. I’m guessing invisible instance matrices aren’t updated..

The issue was manually resizing the BatchedMesh vertex and index buffers.

So if anybody encounters this. Pre-alocating the maxInstanceCount, maxVertexCount and maxIndexCount is best.

calling BatchedMesh#setGeometrySize and BatchedMesh#setInstanceCount seems to recreate and re-upload buffers/dataTextures asynchronously and the GPU seems to hold stale references

three.js 0.182.0 (webGPU)