[muh/pipeline] derive_injection.py: bridge CCCL struct fields → vllm runtime injection
PROBLEM:
gen_patch.py extracts bi100_* struct fields (items, threads, vec) but
VLLM_INJECTION_POINTS keys are (_PARTITION_SIZE, BLOCK_M, NUM_WARPS, etc).
These sets don't intersect → zero patches generated → dead pipeline.
ROOT CAUSE:
enginex ships precompiled .so + Python + Triton — NO .cu source.
The csrc/*.cu injection paths in gen_patch.py are all DEAD.
Real injection is Python runtime params in paged_attn.py, prefix_prefill.py,
triton_flash_attention.py, _custom_ops.py, computility-run.yaml.
FIX:
derive_injection.py maps CCCL-level parameters to vllm-level parameters:
reduce.threads=512, items=24 → _PARTITION_SIZE derivation (GridEvenShare)
reduce.* → use_v1 heuristic restore (V2 enables cross-partition reduce)
scan.threads=384, items=22 → BLOCK_M=32 (SMEM constraint: 256 head_dim)
topk.bits_per_pass=11 → sampling RADIX_BITS
topk.threads=512 → sampling thread count
transform.bytes_in_flight=64KB → prefetch depth
Produces 6 derived values + 3 actionable patch commands.
Tested: python3 muh/derive_injection.py outputs all 6 values correctly.