def ci(x, y, z):
    """
    Turn an (x, y, z) tuple into a chunk index.

    This is really a macro and not a function, but Python doesn't know the
    difference. Hopefully this is faster on PyPy than on CPython.
    """
    return (x * 16 + z) * 256 + y
