Source: cccl_upstream/cub/cub/device/dispatch/dispatch_select_if.cuh
Target: vllm/core/block/block_table.py
CCCL system design applied:
- dispatch_select_if alias_temporaries: compute all allocation sizes
upfront, pack into single blob, then init all at once
- streaming_context_t.advance(): batch state changes instead of
mutating mid-iteration
- Applied to ensure_num_empty_slots: Phase 1 batch-allocate all
new blocks, Phase 2 batch-append to BlockList
- Separates allocation planning from execution, preventing
prev_block chain corruption during multi-block allocation