The description for writeTimestamp currently states:
Writes a timestamp value into a querySet when all previous commands have completed executing.
Notably, this doesn't guarantee that subsequent commands haven't started yet. As a result, code like this:
writeTimestamp(A)
do_some_gpu_work(...)
writeTimestamp(B)
can actually be reordered by the GPU to be:
do_some_gpu_work(...)
writeTimestamp(A)
writeTimestamp(B)
resulting in the measured time being unreasonably short.
(This is related to, but not exactly the same as gfx-rs/wgpu#2521)