from typing import List


def split_world_in_process_groups(world_size: int, group_size: int) -> List[List[int]]:
    """
    Split the process ids of the worlds (from 0 to world_size-1) into chunks
    of size bounded by group_size.

    Examples:

        > split_world_in_process_groups(world_size=9, group_size=3)
        [[0, 1, 2], [3, 4, 5], [6, 7, 8]]

        > split_world_in_process_groups(world_size=9, group_size=4)
        [[0, 1, 2, 3], [4, 5, 6, 7], [8]]

        > split_world_in_process_groups(world_size=15, group_size=4)
        [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14]]

    """
    all_groups = []
    all_ids = list(reversed(range(world_size)))
    while all_ids:
        all_groups.append(all_ids[-group_size:][::-1])
        all_ids = all_ids[:-group_size]
    return all_groups