selectBit static method
Branch-free select on a 0/1 bit: returns b iff bit == 1, else a.
The bit must already be a 0/1 Uint64 (never a bool), so no
bool-to-mask conversion — which would itself be a branch — is needed.
Implementation
static Uint64 selectBit(Uint64 a, Uint64 b, Uint64 bit) {
final m = Uint64.zero - bit;
return (a & ~m) | (b & m);
}