diff --git a/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md b/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md index a55717e9b..6ea3e90fa 100644 --- a/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md +++ b/docs/advanced_features/nsa_prefill_cp_page_aligned_cache_contract.md @@ -864,6 +864,24 @@ Tests: - Remote CUDA benchmark/runtime for the TAI materialize primitive and full ETE prefill run. +Verified C12 CPU/unit slice: + +- Local syntax verification passed for the touched runtime/prefetch/caller/test + files with `python -m py_compile`. +- Local targeted pytest remains blocked by the already-recorded local dependency + gap (`orjson` import via `sglang.srt.utils.common`), so this branch uses the + remote container as the authoritative unit-test environment for these files. +- Remote container `g0034:/mnt/beegfs/cjy/sglang-dev` passed the three-file CPU + suite: + + ```text + PYTHONPATH=python python -m pytest -q \ + test/registered/unit/layers/test_nsa_cp_utils.py \ + test/registered/unit/mem_cache/test_cp_shared_kv_layout.py \ + test/registered/unit/mem_cache/test_cp_shared_kv_runtime.py + # 123 passed, 5 warnings + ``` + ### C13. Remote source sync can expose mixed-version symbols Current state: @@ -898,10 +916,21 @@ Correction: Tests: -- Import-level check: - `python - <<'PY' ... import cp_shared_kv_mla_prefetch_should_trace_tiny_extend`. +- Import-level check for the matching caller set: + `import sglang.srt.layers.attention.nsa.nsa_indexer` and + `import sglang.srt.layers.attention.nsa_backend`. - Re-run the three-file remote pytest suite. +Completed C13: + +- The stale helper + `cp_shared_kv_mla_prefetch_should_trace_tiny_extend` is intentionally not a + runtime API in the current code. The fix was to sync matching caller files + (`nsa_indexer.py`, `nsa_backend.py`) with the current runtime instead of + reintroducing a dead compatibility helper. +- Remote caller import check prints `CALLER_IMPORT_OK`. +- The same remote three-file unit suite now passes (`123 passed, 5 warnings`). + ### C14. Wider remote unit suite still exposes non-page-padding regressions Current state: @@ -955,6 +984,36 @@ Tests: - Re-run the exact failed tests after each fix, then the three-file remote suite. +Completed C14: + +- Updated the stale unit expectations to the intended contracts: + - direct-write fallback logs require + `[CP_SHARED_KV_FALLBACK][direct_write]`; + - MLA/index prefix materialize is recorded on the current stream while async + reduce is recorded on the prefetch stream; + - `wait_attention_window()` remains a deferred historical hook and does not + launch/wait pending reduce work; + - negative + `SGLANG_CP_SHARED_KV_MLA_PREFETCH_MIN_PREFIX_PAGES` values use the dynamic + default `max(cp_size, ceil(default_tokens / page_size))`, so + `cp_size=4,page_size=64` returns `8` with the current 512-token default. +- Remote exact C14 regression set passed: + + ```text + test_local_out_cache_loc_logs_every_fallback_event + test_mla_prefetch_materializes_on_current_stream_and_reduces_on_prefetch_stream + test_index_prefetch_materializes_on_current_stream_and_reduces_on_prefetch_stream + test_mla_prefetch_attention_window_does_not_launch_pending_reduce + test_index_prefetch_attention_window_defers_pending_event_wait + test_mla_prefetch_min_prefix_pages_uses_cached_token_default_and_can_override + # 6 passed, 3 warnings + ``` +- Remote three-file suite passed after sync: + + ```text + 123 passed, 5 warnings + ``` + ## Testing requirements Add targeted tests before implementation: