Add a test with intra-packet divergence

Improve the packet-switching mechanism. We just need to switch to the
next packet (modulo BATCH_SIZE) and jump to it.