def mscb(t):
    """
    Find the index of the most significant change bit,
    the bit that will change when t is incremented
    aka the power of 2 boundary we are at

    >>> mscb(0)
    0
    >>> mscb(1)
    1
    >>> mscb(7)
    3
    >>> mscb(8)
    0
    """
    return (t^(t+1)).bit_length()-1