Add MooncakeKVManager.build_per_layer_context: assembles a PerLayerTransferContext from the SAME CP-filtered (prefill_kv_indices, dst_kv_indices) the post-forward transfer uses — so the bytes moved are byte-identical to the monolithic path, and the CP owner mapping is NOT re-derived (eliminating the #1 correctness risk). It mirrors the MLA branch of _send_kvcache_generic exactly (get_mla_kv_ptrs_with_pp + group_concurrent_contiguous + build_layer_blocks, verified set_transfer_blocks- identical). Returns None for MHA / unregistered decode / empty owned set. Unit-tested (4 cases): per-layer address correctness + the None guards. Remaining A3-step3: call this in the send/scheduler flow (register before forward, finish after, skip the main-KV monolithic send), then output-equality + TTFT verification. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Registered Tests
Tests under this directory are auto-discovered by run_suite.py via CI registration decorators.
Where Should I Put My New Test?
No server / engine launch required
| What you're testing | Directory | Requires |
|---|---|---|
| Component logic in isolation (cache, scheduler, config, parser, etc.) | unit/<module>/ |
CPU or GPU |
| CUDA kernel correctness | kernels/ |
GPU |
Server / engine launch required (E2E)
| What you're testing | Directory | Requires |
|---|---|---|
| Model inference correctness | models/, 4-gpu-models/, 8-gpu-models/ |
GPU |
| Feature-specific (OpenAI API, LoRA, speculative, distributed, VLM, etc.) | openai_server/, lora/, spec/, distributed/, ... |
GPU |
| Benchmarks (performance, accuracy, stress) | benchmark/ |
GPU |
| Platform-specific | amd/, ascend/ |
Vendor GPU |
See unit/README.md for unit test conventions.